Comments
Patch
@@ -1099,12 +1099,15 @@ class localrepository(object):
# can't use delattr on proxy
del self.__dict__['_tagscache']
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
to check if it was modified since the last time it was read,
rereading it if it has.
@@ -1866,11 +1869,11 @@ class localrepository(object):
tr = self.transaction(trname)
for key in sorted(remoteobs, reverse=True):
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:
if tr is not None:
tr.release()
@@ -2478,12 +2481,11 @@ class localrepository(object):
htext = _(" (%+d heads)") % dh
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 ""
self.hook('pretxnchangegroup', throw=True,
node=hex(cl.node(clstart)), source=srctype,
@@ -102,11 +102,10 @@ Note: old client behave as a publishing
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:]
phasenames = ['public', 'draft', 'secret']
@@ -246,12 +245,11 @@ class phasecache(object):
# some roots may need to be declared for lower phases
delroots.extend(olds - roots)
# 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
# phaseroots values, replace them.
@@ -265,12 +263,11 @@ class phasecache(object):
currentroots = currentroots.copy()
currentroots.update(newroots)
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.
This function move boundary *forward* this means that all nodes