changeset 17324:9f94358f9f93 stable

localrepo: clear the filecache on _rollback() and destroyed() This restores the old behaviour of clearing the filecache when the repo is destroyed but combines it with also clearing it on _rollback. Before, we tried to only call it through _rollback but that ruined callers of destroyed. Doing it on both code paths covers destroyed being called from somewhere else, e.g. strip.
author Idan Kamara <idankk86@gmail.com>
date Sat, 28 Jul 2012 22:40:30 +0300
parents 2be2a070f294
children e4db509c08ec
files mercurial/localrepo.py
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Wed Aug 01 00:20:10 2012 +0200
+++ b/mercurial/localrepo.py	Sat Jul 28 22:40:30 2012 +0300
@@ -1000,6 +1000,9 @@
                         self.sjoin('phaseroots'))
         self.invalidate()
 
+        # Discard all cache entries to force reloading everything.
+        self._filecache.clear()
+
         parentgone = (parents[0] not in self.changelog.nodemap or
                       parents[1] not in self.changelog.nodemap)
         if parentgone:
@@ -1067,9 +1070,6 @@
                 pass
         self.invalidatecaches()
 
-        # Discard all cache entries to force reloading everything.
-        self._filecache.clear()
-
     def _lock(self, lockname, wait, releasefn, acquirefn, desc):
         try:
             l = lock.lock(lockname, 0, releasefn, desc=desc)
@@ -1503,6 +1503,9 @@
         # tag cache retrieval" case to work.
         self.invalidatecaches()
 
+        # Discard all cache entries to force reloading everything.
+        self._filecache.clear()
+
     def walk(self, match, node=None):
         '''
         walk recursively through the directory tree or a given