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
--- 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: