manifest: fix _very_ subtle bug with exact matchers passed to walk()
authorAugie Fackler <augie@google.com>
Wed, 05 Feb 2020 16:16:15 -0500
changeset 44269 48a1a974a92c
parent 44268 aa0fc32ece9e
child 44270 f546d2170b0f
manifest: fix _very_ subtle bug with exact matchers passed to walk() Prior to this fix, manifestdict.walk() with an exact matcher would blindly list the files in the matcher, even if they weren't in the manifest. This was exposed by my next patch where I rewrite filesnotin() to use walk() instead of matches(). Differential Revision: https://phab.mercurial-scm.org/D8081
mercurial/manifest.py
--- a/mercurial/manifest.py	Tue Jan 14 17:08:45 2020 +0100
+++ b/mercurial/manifest.py	Wed Feb 05 16:16:15 2020 -0500
@@ -530,7 +530,8 @@
         # avoid the entire walk if we're only looking for specific files
         if self._filesfastpath(match):
             for fn in sorted(fset):
-                yield fn
+                if fn in self:
+                    yield fn
             return
 
         for fn in self: