diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -1101,8 +1101,11 @@ class localrepository(object): 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 @@ class localrepository(object): 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 @@ class localrepository(object): 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 "" diff --git a/mercurial/phases.py b/mercurial/phases.py --- a/mercurial/phases.py +++ b/mercurial/phases.py @@ -104,7 +104,6 @@ import errno 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 @@ class phasecache(object): # 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 @@ class phasecache(object): 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.