inotify: avoid status getting out of sync
authorMatt Mackall <mpm@selenic.com>
Sun, 12 Oct 2008 15:21:08 -0500
changeset 7086 4033195d455b
parent 7085 1fcc282e2c43
child 7087 62c71741ae7d
inotify: avoid status getting out of sync Always looking up oldstatus keeps us from failing to update our state when we disagree with the dirstate.
hgext/inotify/server.py
--- a/hgext/inotify/server.py	Sun Oct 12 15:21:08 2008 -0500
+++ b/hgext/inotify/server.py	Sun Oct 12 15:21:08 2008 -0500
@@ -266,15 +266,14 @@
             return 'i'
         return type_
 
-    def updatestatus(self, wfn, st=None, status=None, oldstatus=None):
+    def updatestatus(self, wfn, st=None, status=None):
         if st:
             status = self.filestatus(wfn, st)
         else:
             self.statcache.pop(wfn, None)
         root, fn = self.split(wfn)
         d = self.dir(self.tree, root)
-        if oldstatus is None:
-            oldstatus = d.get(fn)
+        oldstatus = d.get(fn)
         isdir = False
         if oldstatus:
             try:
@@ -343,7 +342,7 @@
             if status == 'r' and not st:
                 self.updatestatus(wfn, st, status=status)
             else:
-                self.updatestatus(wfn, st, oldstatus=status)
+                self.updatestatus(wfn, st)
         self.check_deleted('!')
         self.check_deleted('r')