comparison mercurial/manifest.py @ 44316: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 c86256bd4eb8
children 63d84c18247a
comparison
equal deleted inserted replaced
44315:aa0fc32ece9e 44316:48a1a974a92c
528 fset = set(match.files()) 528 fset = set(match.files())
529 529
530 # avoid the entire walk if we're only looking for specific files 530 # avoid the entire walk if we're only looking for specific files
531 if self._filesfastpath(match): 531 if self._filesfastpath(match):
532 for fn in sorted(fset): 532 for fn in sorted(fset):
533 yield fn 533 if fn in self:
534 yield fn
534 return 535 return
535 536
536 for fn in self: 537 for fn in self:
537 if fn in fset: 538 if fn in fset:
538 # specified pattern is the exact name 539 # specified pattern is the exact name