walk: use match.bad in statwalk
authorMatt Mackall <mpm@selenic.com>
Mon, 12 May 2008 11:37:08 -0500
changeset 6589 0f98cae7c77f
parent 6588 10c23c1d5f33
child 6590 9f80e062d71c
walk: use match.bad in statwalk
mercurial/dirstate.py
--- a/mercurial/dirstate.py	Mon May 12 11:37:08 2008 -0500
+++ b/mercurial/dirstate.py	Mon May 12 11:37:08 2008 -0500
@@ -418,11 +418,10 @@
 
     def walk(self, match):
         # filter out the src and stat
-        for src, f, st in self.statwalk(match.files(), match, badfn=match.bad):
+        for src, f, st in self.statwalk(match.files(), match):
             yield f
 
-    def statwalk(self, files, match, unknown=True,
-                 ignored=False, badfn=None):
+    def statwalk(self, files, match, unknown=True, ignored=False):
         '''
         walk recursively through the directory tree, finding all files
         matched by the match function
@@ -438,7 +437,9 @@
         def fwarn(f, msg):
             self._ui.warn('%s: %s\n' % (self.pathto(ff), msg))
             return False
-        badfn = badfn or fwarn
+        badfn = fwarn
+        if hasattr(match, 'bad'):
+            badfn = match.bad
 
         # walk all files by default
         if not files: