changeset 43620:dd773340a085

dirstate: respect request to not list unknown/ignored/clean files (API) Unknown files that are explicitly mentioned by the matcher are returned even if the caller said unknown=False (and it seems the same is done for ignored files). That seems pretty surprising. Let's make the interface less surprising by respecting the caller's request. Differential Revision: https://phab.mercurial-scm.org/D7150
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 22 Oct 2019 23:21:26 -0700
parents c207c46a86b9
children 975e517451a6
files mercurial/dirstate.py
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstate.py	Wed Nov 13 09:09:42 2019 +0100
+++ b/mercurial/dirstate.py	Tue Oct 22 23:21:26 2019 -0700
@@ -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