--- a/mercurial/commands.py Wed Jun 28 17:08:10 2006 -0500
+++ b/mercurial/commands.py Wed Jun 28 17:11:42 2006 -0500
@@ -880,19 +880,10 @@
%d dirname of file being printed, or '.' if in repo root
%p root-relative path name of file being printed
"""
- mf = {}
- rev = opts['rev']
- if rev:
- node = repo.lookup(rev)
- else:
- node = repo.changelog.tip()
- change = repo.changelog.read(node)
- mf = repo.manifest.read(change[0])
- for src, abs, rel, exact in walk(repo, (file1,) + pats, opts, node):
- r = repo.file(abs)
- n = mf[abs]
- fp = make_file(repo, opts['output'], node, pathname=abs)
- fp.write(r.read(n))
+ ctx = repo.changectx(opts['rev'] or -1)
+ for src, abs, rel, exact in walk(repo, (file1,) + pats, opts, ctx.node()):
+ fp = make_file(repo, opts['output'], ctx.node(), pathname=abs)
+ fp.write(ctx.filectx(abs).data())
def clone(ui, source, dest=None, **opts):
"""make a copy of an existing repository