changeset 6825:177b3186f78a

dirstate.walk: unify match.dir logic
author Matt Mackall <mpm@selenic.com>
date Tue, 22 Jul 2008 13:03:17 -0500
parents c3fb7dc51a4b
children eca20fee0728
files mercurial/dirstate.py
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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):