# HG changeset patch # User Mikael Berthe # Date 1126719310 18000 # Node ID 4a6efec8b6988f94b461568eea8e66b1a4b813ed # Parent 3b4f05ff31304bdf3abfef8d72ca50122d4cd765 Fix hg cat when the file cannot be found in the specified revision diff -r 3b4f05ff3130 -r 4a6efec8b698 mercurial/commands.py --- a/mercurial/commands.py Wed Sep 14 12:22:20 2005 -0500 +++ b/mercurial/commands.py Wed Sep 14 12:35:10 2005 -0500 @@ -579,8 +579,11 @@ change = repo.changelog.read(n) m = repo.manifest.read(change[0]) n = m[relpath(repo, [file1])[0]] - except hg.RepoError, KeyError: - n = r.lookup(rev) + except (hg.RepoError, KeyError): + try: + n = r.lookup(rev) + except KeyError, inst: + raise util.Abort('cannot find file %s in rev %s', file1, rev) else: n = r.tip() fp = make_file(repo, r, opts['output'], node=n)