[PATCH 1 of 2] revert: don't re-create changeset context
Kevin Bullock
kbullock+mercurial at ringworld.org
Fri May 4 10:16:10 CDT 2012
# HG changeset patch
# User Kevin Bullock <kbullock at ringworld.org>
# Date 1336141228 18000
# Branch stable
# Node ID e19cb9f091f89a90afffcc57935b86aac0689437
# Parent 91323a78aac252b630144f66e1039321cd41c9ef
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)
More information about the Mercurial-devel
mailing list