# HG changeset patch # User Martin von Zweigbergk # Date 1506719976 25200 # Node ID 255c761a52db28135c0112e38b2e44c497de4d05 # Parent b3538c03a8040c4f7904a83f1a8957ba528515e0 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 diff -r b3538c03a804 -r 255c761a52db contrib/perf.py --- 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) diff -r b3538c03a804 -r 255c761a52db hgext/largefiles/lfutil.py --- 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. diff -r b3538c03a804 -r 255c761a52db mercurial/cmdutil.py --- 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: diff -r b3538c03a804 -r 255c761a52db mercurial/context.py --- 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)) diff -r b3538c03a804 -r 255c761a52db mercurial/scmutil.py --- 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):