Mercurial > public > mercurial-scm > hg
diff mercurial/localrepo.py @ 18105:312262ebc223
cache: group obscache and revsfiltercache invalidation in a single function
Both caches are very volatile and needs invalidation on the same kind of event.
revsfiltercache actually depends on the content of revsfiltercache.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Tue, 18 Dec 2012 02:04:37 +0100 |
parents | a464deecc9dd |
children | 2cf01eb74842 |
line wrap: on
line diff
--- a/mercurial/localrepo.py Mon Dec 17 17:27:12 2012 +0100 +++ b/mercurial/localrepo.py Tue Dec 18 02:04:37 2012 +0100 @@ -1101,8 +1101,11 @@ self.unfiltered()._branchcache = None # in UTF-8 self.unfiltered()._branchcachetip = None + self.invalidatevolatilesets() + + def invalidatevolatilesets(self): + self.filteredrevcache.clear() obsolete.clearobscaches(self) - self.filteredrevcache.clear() def invalidatedirstate(self): '''Invalidates the dirstate, causing the next call to dirstate @@ -1868,7 +1871,7 @@ if key.startswith('dump'): data = base85.b85decode(remoteobs[key]) self.obsstore.mergemarkers(tr, data) - self.filteredrevcache.clear() + self.invalidatevolatilesets() if tr is not None: tr.close() finally: @@ -2480,8 +2483,7 @@ self.ui.status(_("added %d changesets" " with %d changes to %d files%s\n") % (changesets, revisions, files, htext)) - obsolete.clearobscaches(self) - self.filteredrevcache.clear() + self.invalidatevolatilesets() if changesets > 0: p = lambda: cl.writepending() and self.root or ""