dirstate: set more states in step 1 of walk
authorSimon Heimberg <simohe@besonet.ch>
Thu, 14 May 2009 10:50:45 +0200
changeset 8588 2624f485b9bc
parent 8587 8f15d54437b9
child 8589 3edf133dcb5a
dirstate: set more states in step 1 of walk
mercurial/dirstate.py
--- a/mercurial/dirstate.py	Sun May 24 02:56:22 2009 -0500
+++ b/mercurial/dirstate.py	Thu May 14 10:50:45 2009 +0200
@@ -476,6 +476,9 @@
                 st = lstat(join(nf))
                 kind = getkind(st.st_mode)
                 if kind == dirkind:
+                    if nf in dmap:
+                        #file deleted on disc but still in dirstate
+                        results[nf] = None
                     if not dirignore(nf):
                         wadd(nf)
                 elif kind == regkind or kind == lnkkind:
@@ -488,14 +491,19 @@
                 keep = False
                 prefix = nf + "/"
                 for fn in dmap:
-                    if nf == fn or fn.startswith(prefix):
+                    if nf == fn:
+                        if matchfn(nf):
+                            results[nf] = None
+                        keep = True
+                        break
+                    elif fn.startswith(prefix):
                         keep = True
                         break
                 if not keep:
                     if inst.errno != errno.ENOENT:
                         fwarn(ff, inst.strerror)
                     elif badfn(ff, inst.strerror):
-                        if (nf in dmap or not ignore(nf)) and matchfn(nf):
+                        if nf not in results and not ignore(nf) and matchfn(nf):
                             results[nf] = None
 
         # step 2: visit subdirectories