# HG changeset patch # User Martin von Zweigbergk # Date 2019-10-23 06:21:26 # Node ID dd773340a0853818101e6c45e79d7e8eeaf47f4a # Parent c207c46a86b92ad7be05de2bf85bb36757e8ae3a 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 diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -1149,16 +1149,19 @@ class dirstate(object): ) 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