changeset 34343:255c761a52db

dirstate: use keyword arguments to clarify walk()'s callers The arguments are especially non-obvious because the order is different from dirstate.status(). Differential Revision: https://phab.mercurial-scm.org/D846
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 29 Sep 2017 14:19:36 -0700
parents b3538c03a804
children ac0cd81e2f83
files contrib/perf.py hgext/largefiles/lfutil.py mercurial/cmdutil.py mercurial/context.py mercurial/scmutil.py
diffstat 5 files changed, 15 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/perf.py	Fri Sep 29 14:23:41 2017 -0700
+++ b/contrib/perf.py	Fri Sep 29 14:19:36 2017 -0700
@@ -371,7 +371,8 @@
 def perfwalk(ui, repo, *pats, **opts):
     timer, fm = gettimer(ui, opts)
     m = scmutil.match(repo[None], pats, {})
-    timer(lambda: len(list(repo.dirstate.walk(m, [], True, False))))
+    timer(lambda: len(list(repo.dirstate.walk(m, subrepos=[], unknown=True,
+                                              ignored=False))))
     fm.end()
 
 @command('perfannotate', formatteropts)
--- a/hgext/largefiles/lfutil.py	Fri Sep 29 14:23:41 2017 -0700
+++ b/hgext/largefiles/lfutil.py	Fri Sep 29 14:19:36 2017 -0700
@@ -155,7 +155,8 @@
     # largefiles operation in a new clone.
     if create and not vfs.exists(vfs.join(lfstoredir, 'dirstate')):
         matcher = getstandinmatcher(repo)
-        standins = repo.dirstate.walk(matcher, [], False, False)
+        standins = repo.dirstate.walk(matcher, subrepos=[], unknown=False,
+                                      ignored=False)
 
         if len(standins) > 0:
             vfs.makedirs(lfstoredir)
@@ -428,7 +429,8 @@
     standins = []
     matcher = getstandinmatcher(repo)
     wctx = repo[None]
-    for standin in repo.dirstate.walk(matcher, [], False, False):
+    for standin in repo.dirstate.walk(matcher, subrepos=[], unknown=False,
+                                      ignored=False):
         lfile = splitstandin(standin)
         try:
             hash = readasstandin(wctx[standin])
@@ -573,7 +575,8 @@
     # Case 2: user calls commit with specified patterns: refresh
     # any matching big files.
     smatcher = composestandinmatcher(repo, match)
-    standins = repo.dirstate.walk(smatcher, [], False, False)
+    standins = repo.dirstate.walk(smatcher, subrepos=[], unknown=False,
+                                  ignored=False)
 
     # No matching big files: get out of the way and pass control to
     # the usual commit() method.
--- a/mercurial/cmdutil.py	Fri Sep 29 14:23:41 2017 -0700
+++ b/mercurial/cmdutil.py	Fri Sep 29 14:19:36 2017 -0700
@@ -2708,8 +2708,8 @@
     dirstate = repo.dirstate
     # We don't want to just call wctx.walk here, since it would return a lot of
     # clean files, which we aren't interested in and takes time.
-    for f in sorted(dirstate.walk(badmatch, sorted(wctx.substate),
-                                  True, False, full=False)):
+    for f in sorted(dirstate.walk(badmatch, subrepos=sorted(wctx.substate),
+                                  unknown=True, ignored=False, full=False)):
         exact = match.exact(f)
         if exact or not explicitonly and f not in wctx and repo.wvfs.lexists(f):
             if cca:
--- a/mercurial/context.py	Fri Sep 29 14:23:41 2017 -0700
+++ b/mercurial/context.py	Fri Sep 29 14:19:36 2017 -0700
@@ -1478,8 +1478,9 @@
 
     def walk(self, match):
         '''Generates matching file names.'''
-        return sorted(self._repo.dirstate.walk(match, sorted(self.substate),
-                                               True, False))
+        return sorted(self._repo.dirstate.walk(match,
+                                               subrepos=sorted(self.substate),
+                                               unknown=True, ignored=False))
 
     def matches(self, match):
         return sorted(self._repo.dirstate.matches(match))
--- a/mercurial/scmutil.py	Fri Sep 29 14:23:41 2017 -0700
+++ b/mercurial/scmutil.py	Fri Sep 29 14:19:36 2017 -0700
@@ -760,8 +760,8 @@
 
     ctx = repo[None]
     dirstate = repo.dirstate
-    walkresults = dirstate.walk(matcher, sorted(ctx.substate), True, False,
-                                full=False)
+    walkresults = dirstate.walk(matcher, subrepos=sorted(ctx.substate),
+                                unknown=True, ignored=False, full=False)
     for abs, st in walkresults.iteritems():
         dstate = dirstate[abs]
         if dstate == '?' and audit_path.check(abs):