# HG changeset patch # User Kevin Bullock # Date 2012-05-04 14:20:28 # Node ID 146a00c162a0e8437a1de3523921f91b221e2336 # Parent 48dfd9ae924a07b01bf7d67af5118392821caf1a revert: don't re-create changeset context diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -1481,7 +1481,7 @@ def revert(ui, repo, ctx, parents, *pats def badfn(path, msg): if path in names: return - if path in repo[node].substate: + if path in ctx.substate: return path_ = path + '/' for f in names: @@ -1489,14 +1489,14 @@ def revert(ui, repo, ctx, parents, *pats return ui.warn("%s: %s\n" % (m.rel(path), msg)) - m = scmutil.match(repo[node], pats, opts) + m = scmutil.match(ctx, pats, opts) m.bad = badfn - for abs in repo[node].walk(m): + for abs in ctx.walk(m): if abs not in names: names[abs] = m.rel(abs), m.exact(abs) # get the list of subrepos that must be reverted - targetsubs = [s for s in repo[node].substate if m(s)] + targetsubs = [s for s in ctx.substate if m(s)] m = scmutil.matchfiles(repo, names) changes = repo.status(match=m)[:4] modified, added, removed, deleted = map(set, changes)