D4371: treemanifest: use visitchildrenset when doing a walk
spectral (Kyle Lippincott)
phabricator at mercurial-scm.org
Sat Sep 8 01:22:21 UTC 2018
spectral updated this revision to Diff 10839.
spectral edited the summary of this revision.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D4371?vs=10837&id=10839
REVISION DETAIL
https://phab.mercurial-scm.org/D4371
AFFECTED FILES
mercurial/manifest.py
CHANGE DETAILS
diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -1036,20 +1036,22 @@
def _walk(self, match):
'''Recursively generates matching file names for walk().'''
- if not match.visitdir(self._dir[:-1] or '.'):
+ visit = match.visitchildrenset(self._dir[:-1] or '.')
+ if not visit:
return
# yield this dir's files and walk its submanifests
self._load()
- self._loadalllazy()
+ visit = self._loadchildrensetlazy(visit)
for p in sorted(list(self._dirs) + list(self._files)):
if p in self._files:
fullp = self._subpath(p)
if match(fullp):
yield fullp
else:
- for f in self._dirs[p]._walk(match):
- yield f
+ if not visit or p[:-1] in visit:
+ for f in self._dirs[p]._walk(match):
+ yield f
def matches(self, match):
'''generate a new manifest filtered by the match argument'''
To: spectral, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list