# HG changeset patch # User Idan Kamara # Date 1343504430 -10800 # Node ID 9f94358f9f937d738893d57c98a8e72bec18882c # Parent 2be2a070f294a2aa4868bb1167d09c8b09848cce 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. diff -r 2be2a070f294 -r 9f94358f9f93 mercurial/localrepo.py --- 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