comparison mercurial/localrepo.py @ 42712:cdf0e9523de1

branchmap: explicitly warm+write all subsets of the branchmap caches 'full' claims it will warm all of the caches that are known about, but this was not the case - it did not actually warm the branchmap caches for subsets that we haven't requested, or for subsets that are still considered "valid". By explicitly writing them to disk, we can force the subsets for ex: "served" to be written ("immutable" and "base"), making it cheaper to calculate "served" the next time it needs to be updated. Differential Revision: https://phab.mercurial-scm.org/D6710
author Kyle Lippincott <spectral@google.com>
date Mon, 05 Aug 2019 13:31:12 -0700
parents 863e9e7f8850
children 268662aac075
comparison
equal deleted inserted replaced
42711:53c07f08fea1 42712:cdf0e9523de1
2218 tagsmod.fnoderevs(self.ui, unfi, unfi.changelog.revs()) 2218 tagsmod.fnoderevs(self.ui, unfi, unfi.changelog.revs())
2219 # accessing tags warm the cache 2219 # accessing tags warm the cache
2220 self.tags() 2220 self.tags()
2221 self.filtered('served').tags() 2221 self.filtered('served').tags()
2222 2222
2223 # The `full` arg is documented as updating even the lazily-loaded
2224 # caches immediately, so we're forcing a write to cause these caches
2225 # to be warmed up even if they haven't explicitly been requested
2226 # yet (if they've never been used by hg, they won't ever have been
2227 # written, even if they're a subset of another kind of cache that
2228 # *has* been used).
2229 for filt in repoview.filtertable.keys():
2230 filtered = self.filtered(filt)
2231 filtered.branchmap().write(filtered)
2232
2223 def invalidatecaches(self): 2233 def invalidatecaches(self):
2224 2234
2225 if r'_tagscache' in vars(self): 2235 if r'_tagscache' in vars(self):
2226 # can't use delattr on proxy 2236 # can't use delattr on proxy
2227 del self.__dict__[r'_tagscache'] 2237 del self.__dict__[r'_tagscache']