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

login
register
mail settings
Submitter Augie Fackler
Date May 19, 2017, 9:39 p.m.
Message ID <fbe9d489a31ebac31516.1495229958@augie-macbookpro2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/20745/
State Accepted
Headers show

Comments

Augie Fackler - May 19, 2017, 9:39 p.m.
# HG changeset patch
# User Augie Fackler <augie@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

Patch

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`