localrepo: refresh filecache entries after releasing a repo.lock()
authorIdan Kamara <idankk86@gmail.com>
Mon, 25 Jul 2011 15:08:37 +0300
changeset 14931 a710936c3037
parent 14930 372d9d8b1da4
child 14932 d3ac759a6d66
localrepo: refresh filecache entries after releasing a repo.lock()
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Mon Jul 25 15:08:37 2011 +0300
+++ b/mercurial/localrepo.py	Mon Jul 25 15:08:37 2011 +0300
@@ -842,7 +842,14 @@
             l.lock()
             return l
 
-        l = self._lock(self.sjoin("lock"), wait, self.store.write,
+        def unlock():
+            self.store.write()
+            for k, ce in self._filecache.items():
+                if k == 'dirstate':
+                    continue
+                ce.refresh()
+
+        l = self._lock(self.sjoin("lock"), wait, unlock,
                        self.invalidate, _('repository %s') % self.origroot)
         self._lockref = weakref.ref(l)
         return l