Patchwork D7150: dirstate: respect request to not list unknown/ignored/clean files (API)

login
register
mail settings
Submitter phabricator
Date Nov. 13, 2019, 2 p.m.
Message ID <87df9e80fa1f8bd40489a9d15b5c135b@localhost.localdomain>
Download mbox | patch
Permalink /patch/43156/
State Not Applicable
Headers show

Comments

phabricator - Nov. 13, 2019, 2 p.m.
Closed by commit rHGdd773340a085: dirstate: respect request to not list unknown/ignored/clean files (API) (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7150?vs=18049&id=18054

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7150/new/

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

AFFECTED FILES
  mercurial/dirstate.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers, pulkit
Cc: mercurial-devel

Patch

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -1149,16 +1149,19 @@ 
             )
             return (lookup, status)
 
+        def noop(f):
+            pass
+
         dcontains = dmap.__contains__
         dget = dmap.__getitem__
         ladd = lookup.append  # aka "unsure"
         madd = modified.append
         aadd = added.append
-        uadd = unknown.append
-        iadd = ignored.append
+        uadd = unknown.append if listunknown else noop
+        iadd = ignored.append if listignored else noop
         radd = removed.append
         dadd = deleted.append
-        cadd = clean.append
+        cadd = clean.append if listclean else noop
         mexact = match.exact
         dirignore = self._dirignore
         checkexec = self._checkexec