Mercurial > public > mercurial-scm > hg-stable
diff hgext/extdiff.py @ 6747:f6c00b17387c
use repo[changeid] to get a changectx
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 26 Jun 2008 14:35:46 -0500 |
parents | 41eb20cc1c02 |
children | 4faaa0535ea7 |
line wrap: on
line diff
--- a/hgext/extdiff.py Thu Jun 26 13:58:24 2008 -0500 +++ b/hgext/extdiff.py Thu Jun 26 14:35:46 2008 -0500 @@ -52,7 +52,6 @@ def snapshot_node(ui, repo, files, node, tmproot): '''snapshot files as of some revision''' - mf = repo.changectx(node).manifest() dirname = os.path.basename(repo.root) if dirname == "": dirname = "root" @@ -61,17 +60,18 @@ os.mkdir(base) ui.note(_('making snapshot of %d files from rev %s\n') % (len(files), short(node))) + ctx = repo[node] for fn in files: - if not fn in mf: + wfn = util.pconvert(fn) + if not wfn in ctx: # skipping new file after a merge ? continue - wfn = util.pconvert(fn) ui.note(' %s\n' % wfn) dest = os.path.join(base, wfn) destdir = os.path.dirname(dest) if not os.path.isdir(destdir): os.makedirs(destdir) - data = repo.wwritedata(wfn, repo.file(wfn).read(mf[wfn])) + data = repo.wwritedata(wfn, ctx[wfn].data()) open(dest, 'wb').write(data) return dirname