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.
--- 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