D4371: treemanifest: use visitchildrenset when doing a walk

spectral (Kyle Lippincott) phabricator at mercurial-scm.org
Tue Sep 11 08:36:30 EDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG3ba9ef0fb693: treemanifest: use visitchildrenset when doing a walk (authored by spectral, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4371?vs=10839&id=10879

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