dirstate: use keyword arguments to clarify status()'s callers
The arguments are especially non-obvious because the order is
different from dirstate.walk().
Differential Revision: https://phab.mercurial-scm.org/D847
--- a/hgext/largefiles/lfutil.py Fri Sep 29 14:19:36 2017 -0700
+++ b/hgext/largefiles/lfutil.py Fri Sep 29 14:49:05 2017 -0700
@@ -169,7 +169,8 @@
def lfdirstatestatus(lfdirstate, repo):
pctx = repo['.']
match = matchmod.always(repo.root, repo.getcwd())
- unsure, s = lfdirstate.status(match, [], False, False, False)
+ unsure, s = lfdirstate.status(match, subrepos=[], ignored=False,
+ clean=False, unknown=False)
modified, clean = s.modified, s.clean
for lfile in unsure:
try:
@@ -551,8 +552,8 @@
# large.
lfdirstate = openlfdirstate(ui, repo)
dirtymatch = matchmod.always(repo.root, repo.getcwd())
- unsure, s = lfdirstate.status(dirtymatch, [], False, False,
- False)
+ unsure, s = lfdirstate.status(dirtymatch, subrepos=[], ignored=False,
+ clean=False, unknown=False)
modifiedfiles = unsure + s.modified + s.added + s.removed
lfiles = listlfiles(repo)
# this only loops through largefiles that exist (not
--- a/hgext/largefiles/overrides.py Fri Sep 29 14:19:36 2017 -0700
+++ b/hgext/largefiles/overrides.py Fri Sep 29 14:49:05 2017 -0700
@@ -1218,8 +1218,9 @@
return orig(repo, matcher, prefix, opts, dry_run, similarity)
# Get the list of missing largefiles so we can remove them
lfdirstate = lfutil.openlfdirstate(repo.ui, repo)
- unsure, s = lfdirstate.status(matchmod.always(repo.root, repo.getcwd()), [],
- False, False, False)
+ unsure, s = lfdirstate.status(matchmod.always(repo.root, repo.getcwd()),
+ subrepos=[], ignored=False, clean=False,
+ unknown=False)
# Call into the normal remove code, but the removing of the standin, we want
# to have handled by original addremove. Monkey patching here makes sure
@@ -1403,7 +1404,8 @@
lfdirstate = lfutil.openlfdirstate(repo.ui, repo)
unsure, s = lfdirstate.status(matchmod.always(repo.root,
repo.getcwd()),
- [], False, True, False)
+ subrepos=[], ignored=False,
+ clean=True, unknown=False)
oldclean = set(s.clean)
pctx = repo['.']
dctx = repo[node]
--- a/hgext/largefiles/reposetup.py Fri Sep 29 14:19:36 2017 -0700
+++ b/hgext/largefiles/reposetup.py Fri Sep 29 14:49:05 2017 -0700
@@ -162,8 +162,10 @@
if sfindirstate(f)]
# Don't waste time getting the ignored and unknown
# files from lfdirstate
- unsure, s = lfdirstate.status(match, [], False, listclean,
- False)
+ unsure, s = lfdirstate.status(match, subrepos=[],
+ ignored=False,
+ clean=listclean,
+ unknown=False)
(modified, added, removed, deleted, clean) = (
s.modified, s.added, s.removed, s.deleted, s.clean)
if parentworking:
--- a/mercurial/context.py Fri Sep 29 14:19:36 2017 -0700
+++ b/mercurial/context.py Fri Sep 29 14:49:05 2017 -0700
@@ -1756,12 +1756,11 @@
def _dirstatestatus(self, match, ignored=False, clean=False, unknown=False):
'''Gets the status from the dirstate -- internal use only.'''
- listignored, listclean, listunknown = ignored, clean, unknown
subrepos = []
if '.hgsub' in self:
subrepos = sorted(self.substate)
- cmp, s = self._repo.dirstate.status(match, subrepos, listignored,
- listclean, listunknown)
+ cmp, s = self._repo.dirstate.status(match, subrepos, ignored=ignored,
+ clean=clean, unknown=unknown)
# check for any possibly clean files
fixup = []
@@ -1770,7 +1769,7 @@
s.modified.extend(modified2)
s.deleted.extend(deleted2)
- if fixup and listclean:
+ if fixup and clean:
s.clean.extend(fixup)
self._poststatusfixup(s, fixup)