Mercurial > hg
changeset 918:fe69ecd3437c
hg cat: accept changeset hashes
author | mpm@selenic.com |
---|---|
date | Tue, 16 Aug 2005 15:22:44 -0800 |
parents | 7f3f55903496 |
children | 1458d20df2a8 |
files | mercurial/commands.py |
diffstat | 1 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/commands.py Tue Aug 16 14:53:47 2005 -0800 +++ b/mercurial/commands.py Tue Aug 16 15:22:44 2005 -0800 @@ -455,7 +455,14 @@ """output the latest or given revision of a file""" r = repo.file(relpath(repo, [file1])[0]) if rev: - n = r.lookup(rev) + try: + # assume all revision numbers are for changesets + n = repo.lookup(rev) + 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) else: n = r.tip() fp = make_file(repo, r, opts['output'], node=n)