D6710: branchmap: properly refresh/warm all branchmap caches
spectral (Kyle Lippincott)
phabricator at mercurial-scm.org
Fri Aug 2 21:27:14 EDT 2019
spectral created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
The comment about 'served' refreshing all the others only applies when served is
the head of the branchmap cache subsets. This was already no longer the case
(and is presumably why served.hidden was added) but the comment was not
adjusted. Currently, the "heads" of the branchmap cache subsets are the three
specified here: visible, visible-hidden, served.hidden.
Additionally, 'full' claims it will warm all of the caches that are known about,
but this is not the case - it does not actually warm the branchmap caches for
subsets that we haven't requested or for subsets that are still considered
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
@@ -2192,10 +2192,13 @@
if tr is None or tr.changes['origrepolen'] < len(self):
- # accessing the 'ser ved' branchmap should refresh all the others,
+ # There are three "heads" to the cache hierarchy: visible,
+ # visible-hidden, and served.hidden. Updating any of these three
+ # should cause all of the others (currently: served, immutable,
+ # base) that are stale to be updated.
self.ui.debug('updating the branch cache\n')
+ for filt in ['visible', 'visible-hidden', 'served.hidden']:
unfi = self.unfiltered()
@@ -2214,6 +2217,12 @@
+ # Warm the branchmap caches even for caches we haven't needed yet,
+ # including forcing a write to disk.
+ for filt in repoview.filtertable.keys():
+ filtered = self.filtered(filt)
if r'_tagscache' in vars(self):
To: spectral, #hg-reviewers
More information about the Mercurial-devel