[PATCH 2 of 4] cmdutil: use repo[None].walk instead of repo.walk

Augie Fackler raf at durin42.com
Fri May 19 17:39:18 EDT 2017


# HG changeset patch
# User Augie Fackler <augie at google.com>
# Date 1495144852 14400
#      Thu May 18 18:00:52 2017 -0400
# Node ID fbe9d489a31ebac315164fbbb11989ab48faee43
# Parent  ea89086c4346e5f38bb1ccb4ea5fa0239ab0c931
cmdutil: use repo[None].walk instead of repo.walk

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -608,7 +608,7 @@ def copy(ui, repo, pats, opts, rename=Fa
         else:
             badstates = '?r'
         m = scmutil.match(repo[None], [pat], opts, globbed=True)
-        for abs in repo.walk(m):
+        for abs in repo[None].walk(m):
             state = repo.dirstate[abs]
             rel = m.rel(abs)
             exact = m.exact(abs)
@@ -2940,7 +2940,8 @@ def revert(ui, repo, ctx, parents, *pats
         targetsubs = sorted(s for s in wctx.substate if m(s))
 
         if not m.always():
-            for abs in repo.walk(matchmod.badmatch(m, lambda x, y: False)):
+            matcher = matchmod.badmatch(m, lambda x, y: False)
+            for abs in repo[None].walk(matcher):
                 names[abs] = m.rel(abs), m.exact(abs)
 
             # walk target manifest to fill `names`


More information about the Mercurial-devel mailing list