dirstate: more accurate use of match.dir callback
authorMatt Mackall <mpm@selenic.com>
Mon, 01 Jun 2009 20:25:01 -0500
changeset 8708 a645904c88c4
parent 8707 0550dfe4fca1
child 8709 b9e0ddb04c5c
dirstate: more accurate use of match.dir callback
mercurial/dirstate.py
--- a/mercurial/dirstate.py	Mon Jun 01 14:51:47 2009 -0500
+++ b/mercurial/dirstate.py	Mon Jun 01 20:25:01 2009 -0500
@@ -486,6 +486,7 @@
                     if nf in dmap:
                         #file deleted on disk but still in dirstate
                         results[nf] = None
+                    match.dir(nf)
                     if not dirignore(nf):
                         wadd(nf)
                 elif kind == regkind or kind == lnkkind:
@@ -501,6 +502,7 @@
                     prefix = nf + "/"
                     for fn in dmap:
                         if fn.startswith(prefix):
+                            match.dir(nf)
                             skipstep3 = False
                             break
                     else:
@@ -509,8 +511,6 @@
         # step 2: visit subdirectories
         while work:
             nd = work.pop()
-            if hasattr(match, 'dir'):
-                match.dir(nd)
             skip = None
             if nd == '.':
                 nd = ''
@@ -528,6 +528,7 @@
                 if nf not in results:
                     if kind == dirkind:
                         if not ignore(nf):
+                            match.dir(nf)
                             wadd(nf)
                         if nf in dmap and matchfn(nf):
                             results[nf] = None