Patchwork D847: dirstate: use keyword arguments to clarify status()'s callers

login
register
mail settings
Submitter phabricator
Date Sept. 30, 2017, 6:28 a.m.
Message ID <4ac62d7f8b5bc74ae719996dc78e1152@localhost.localdomain>
Download mbox | patch
Permalink /patch/24227/
State Not Applicable
Headers show

Comments

phabricator - Sept. 30, 2017, 6:28 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGac0cd81e2f83: dirstate: use keyword arguments to clarify status()&#039;s callers (authored by martinvonz, committed by ).

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D847?vs=2167&id=2171#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D847?vs=2167&id=2171

REVISION DETAIL
  https://phab.mercurial-scm.org/D847

AFFECTED FILES
  hgext/largefiles/lfutil.py
  hgext/largefiles/overrides.py
  hgext/largefiles/reposetup.py
  mercurial/context.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers, quark, yuja
Cc: yuja, mercurial-devel

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1756,21 +1756,20 @@ 
 
     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 = []
         if cmp:
             modified2, deleted2, fixup = self._checklookup(cmp)
             s.modified.extend(modified2)
             s.deleted.extend(deleted2)
 
-            if fixup and listclean:
+            if fixup and clean:
                 s.clean.extend(fixup)
 
         self._poststatusfixup(s, fixup)
diff --git a/hgext/largefiles/reposetup.py b/hgext/largefiles/reposetup.py
--- a/hgext/largefiles/reposetup.py
+++ b/hgext/largefiles/reposetup.py
@@ -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:
diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -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]
diff --git a/hgext/largefiles/lfutil.py b/hgext/largefiles/lfutil.py
--- a/hgext/largefiles/lfutil.py
+++ b/hgext/largefiles/lfutil.py
@@ -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