dirstate.walk: move dirignore filter out of explicit walk code
This is a move towards factoring this code out into a separate function.
--- 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()