diff mercurial/phases.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 767d1c602c8b
line wrap: on
line diff
--- a/mercurial/phases.py	Mon Dec 17 17:27:12 2012 +0100
+++ b/mercurial/phases.py	Tue Dec 18 02:04:37 2012 +0100
@@ -104,7 +104,6 @@
 from node import nullid, nullrev, bin, hex, short
 from i18n import _
 import util, error
-import obsolete
 
 allphases = public, draft, secret = range(3)
 trackedphases = allphases[1:]
@@ -248,8 +247,7 @@
             # declare deleted root in the target phase
             if targetphase != 0:
                 self.retractboundary(repo, targetphase, delroots)
-        obsolete.clearobscaches(repo)
-        repo.filteredrevcache.clear()
+        repo.invalidatevolatilesets()
 
     def retractboundary(self, repo, targetphase, nodes):
         # Be careful to preserve shallow-copied values: do not update
@@ -267,8 +265,7 @@
             ctxs = repo.set('roots(%ln::)', currentroots)
             currentroots.intersection_update(ctx.node() for ctx in ctxs)
             self._updateroots(targetphase, currentroots)
-        obsolete.clearobscaches(repo)
-        repo.filteredrevcache.clear()
+        repo.invalidatevolatilesets()
 
 def advanceboundary(repo, targetphase, nodes):
     """Add nodes to a phase changing other nodes phases if necessary.