mercurial/localrepo.py
branchstable
changeset 26831 0a7610758c42
parent 26781 1aee2ab0f902
child 26906 e40af07e518e
child 27102 f97bb61b51e6
--- a/mercurial/localrepo.py	Wed Oct 28 16:27:09 2015 +0100
+++ b/mercurial/localrepo.py	Sat Oct 24 18:58:57 2015 +0900
@@ -1014,6 +1014,8 @@
                 # out) in this transaction
                 repo.vfs.rename('journal.dirstate', 'dirstate')
 
+                repo.invalidate(clearfilecache=True)
+
         tr = transaction.transaction(rp, self.svfs, vfsmap,
                                      "journal",
                                      "undo",
@@ -1205,13 +1207,15 @@
                     pass
             delattr(self.unfiltered(), 'dirstate')
 
-    def invalidate(self):
+    def invalidate(self, clearfilecache=False):
         unfiltered = self.unfiltered() # all file caches are stored unfiltered
-        for k in self._filecache:
+        for k in self._filecache.keys():
             # dirstate is invalidated separately in invalidatedirstate()
             if k == 'dirstate':
                 continue
 
+            if clearfilecache:
+                del self._filecache[k]
             try:
                 delattr(unfiltered, k)
             except AttributeError: