dirstate: fold statwalk and walk
authorMatt Mackall <mpm@selenic.com>
Thu, 26 Jun 2008 14:35:50 -0500
changeset 6755 f8299c84b5b6
parent 6754 0b700faaef32
child 6756 d56ceb82cddb
dirstate: fold statwalk and walk
mercurial/dirstate.py
mercurial/localrepo.py
--- a/mercurial/dirstate.py	Thu Jun 26 14:35:50 2008 -0500
+++ b/mercurial/dirstate.py	Thu Jun 26 14:35:50 2008 -0500
@@ -475,12 +475,7 @@
                 return True
         return False
 
-    def walk(self, match):
-        # filter out the src and stat
-        for src, f, st in self.statwalk(match):
-            yield f
-
-    def statwalk(self, match, unknown=True, ignored=False):
+    def walk(self, match, unknown, ignored):
         '''
         walk recursively through the directory tree, finding all files
         matched by the match function
@@ -631,7 +626,6 @@
 
     def status(self, match, ignored, clean, unknown):
         listignored, listclean, listunknown = ignored, clean, unknown
-
         lookup, modified, added, unknown, ignored = [], [], [], [], []
         removed, deleted, clean = [], [], []
 
@@ -648,7 +642,7 @@
         dadd = deleted.append
         cadd = clean.append
 
-        for src, fn, st in self.statwalk(match, listunknown, listignored):
+        for src, fn, st in self.walk(match, listunknown, listignored):
             if fn not in dmap:
                 if (listignored or match.exact(fn)) and self._dirignore(fn):
                     if listignored:
--- a/mercurial/localrepo.py	Thu Jun 26 14:35:50 2008 -0500
+++ b/mercurial/localrepo.py	Thu Jun 26 14:35:50 2008 -0500
@@ -968,7 +968,7 @@
                         and match(fn):
                     yield fn
         else:
-            for fn in self.dirstate.walk(match):
+            for src, fn, st in self.dirstate.walk(match, True, False):
                 yield fn
 
     def status(self, node1=None, node2=None, match=None,