revert: don't re-create changeset context
authorKevin Bullock <kbullock@ringworld.org>
Fri, 04 May 2012 09:20:28 -0500
changeset 16583 146a00c162a0
parent 16581 48dfd9ae924a
child 16584 20cde586ae5a
revert: don't re-create changeset context
mercurial/cmdutil.py
--- a/mercurial/cmdutil.py	Fri May 04 14:40:11 2012 +0200
+++ b/mercurial/cmdutil.py	Fri May 04 09:20:28 2012 -0500
@@ -1481,7 +1481,7 @@
         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 @@
                     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)