mercurial/dirstate.py
changeset 6032 b41f0d6a74fc
parent 5516 f252ba975925
child 6033 a1ebd5cd7e55
--- a/mercurial/dirstate.py	Fri Feb 08 18:07:55 2008 -0200
+++ b/mercurial/dirstate.py	Fri Feb 08 18:07:55 2008 -0200
@@ -369,6 +369,14 @@
                           % (self.pathto(f), kind))
         return False
 
+    def _dirignore(self, f):
+        if self._ignore(f):
+            return True
+        for c in strutil.findall(f, '/'):
+            if self._ignore(f[:c]):
+                return True
+        return False
+
     def walk(self, files=None, match=util.always, badmatch=None):
         # filter out the stat
         for src, f, st in self.statwalk(files, match, badmatch=badmatch):
@@ -404,9 +412,11 @@
             return match(file_)
 
         ignore = self._ignore
+        dirignore = self._dirignore
         if ignored:
             imatch = match
             ignore = util.never
+            dirignore = util.never
 
         # self._root may end with a path separator when self._root == '/'
         common_prefix_len = len(self._root)
@@ -492,8 +502,9 @@
                         yield 'b', ff, None
                 continue
             if s_isdir(st.st_mode):
-                for f, src, st in findfiles(f):
-                    yield src, f, st
+                if not dirignore(nf):
+                    for f, src, st in findfiles(f):
+                        yield src, f, st
             else:
                 if nf in known:
                     continue