dirstate.walk: move dirignore filter out of explicit walk code
authorSiddharth Agarwal <sid0@fb.com>
Tue, 07 May 2013 09:47:10 -0700
changeset 19171 252de7b77cfd
parent 19170 b184e5041f2f
child 19172 c6cea2e2031b
dirstate.walk: move dirignore filter out of explicit walk code This is a move towards factoring this code out into a separate function.
mercurial/dirstate.py
--- a/mercurial/dirstate.py	Tue May 07 09:29:43 2013 -0700
+++ b/mercurial/dirstate.py	Tue May 07 09:47:10 2013 -0700
@@ -626,8 +626,7 @@
                         results[nf] = None
                     if matchedir:
                         matchedir(nf)
-                    if not dirignore(nf):
-                        wadd(nf)
+                    wadd(nf)
                 elif kind == regkind or kind == lnkkind:
                     results[nf] = st
                 else:
@@ -649,6 +648,9 @@
                     else:
                         badfn(ff, inst.strerror)
 
+        work = [d for d in work if not dirignore(d)]
+        wadd = work.append
+
         # step 2: visit subdirectories
         while work:
             nd = work.pop()