fix dirstate.change: it should walk ignored files
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Fri, 28 Oct 2005 10:57:40 -0700
changeset 1476 17e8c70fb670
parent 1475 d791c335fb7b
child 1477 d3566eda2bcb
fix dirstate.change: it should walk ignored files
mercurial/dirstate.py
--- a/mercurial/dirstate.py	Thu Oct 27 13:49:15 2005 -0700
+++ b/mercurial/dirstate.py	Fri Oct 28 10:57:40 2005 -0700
@@ -11,7 +11,7 @@
 from node import *
 from i18n import gettext as _
 from demandload import *
-demandload(globals(), "time bisect stat util re")
+demandload(globals(), "time bisect stat util re errno")
 
 class dirstate:
     def __init__(self, opener, ui, root):
@@ -372,11 +372,16 @@
             except KeyError:
                 unknown.append(fn)
                 continue
-            # XXX: what to do with file no longer present in the fs
-            # who are not removed in the dirstate ?
-            if src == 'm' and not type == 'r':
-                deleted.append(fn)
-                continue
+            if src == 'm':
+                try:
+                    st = os.stat(fn)
+                except OSError, inst:
+                # XXX: what to do with file no longer present in the fs
+                # who are not removed in the dirstate ?
+                    if inst.errno != errno.ENOENT:
+                        raise
+                    deleted.append(fn)
+                    continue
             # check the common case first
             if type == 'n':
                 if not st: