changeset 44269:48a1a974a92c

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
author Augie Fackler <augie@google.com>
date Wed, 05 Feb 2020 16:16:15 -0500
parents aa0fc32ece9e
children f546d2170b0f
files mercurial/manifest.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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: