dirstate.walk: unify match.dir logic
authorMatt Mackall <mpm@selenic.com>
Tue, 22 Jul 2008 13:03:17 -0500
changeset 6825 177b3186f78a
parent 6824 c3fb7dc51a4b
child 6826 eca20fee0728
dirstate.walk: unify match.dir logic
mercurial/dirstate.py
--- a/mercurial/dirstate.py	Tue Jul 22 13:03:16 2008 -0500
+++ b/mercurial/dirstate.py	Tue Jul 22 13:03:17 2008 -0500
@@ -506,11 +506,11 @@
             if dirignore(nf):
                 continue
 
-            if hasattr(match, 'dir'):
-                match.dir(nf)
             wadd(nf)
             while work:
                 nd = work.pop()
+                if hasattr(match, 'dir'):
+                    match.dir(nd)
                 entries = listdir(_join(nd), stat=True)
                 # nd is the top of the repository dir tree
                 if nd == '.':
@@ -532,8 +532,6 @@
                     if kind == stat.S_IFDIR:
                         if not ignore(nf):
                             wadd(nf)
-                            if hasattr(match, 'dir'):
-                                match.dir(nf)
                         if nf in dmap and match(nf):
                             add((nf, None))
                     elif imatch(nf):