branchcache: use update_disk to refresh 'served' and 'served.hidden'
The `update_disk` method is dedicated to this kind of usecase. Now that the writting patterns are more consistent, we can use it to warm these two important cache.
I am dropping the first comment about "refreshing all the others" because it is
false. If a branchmap already exist for "served", none of the subset will be
updated.
--- a/mercurial/localrepo.py Sun Mar 10 03:25:04 2024 +0100
+++ b/mercurial/localrepo.py Sun Mar 10 03:29:12 2024 +0100
@@ -2923,10 +2923,9 @@
if repository.CACHE_BRANCHMAP_SERVED in caches:
if tr is None or tr.changes[b'origrepolen'] < len(self):
- # accessing the 'served' branchmap should refresh all the others,
self.ui.debug(b'updating the branch cache\n')
- self.filtered(b'served').branchmap()
- self.filtered(b'served.hidden').branchmap()
+ self._branchcaches.update_disk(self.filtered(b'served'))
+ self._branchcaches.update_disk(self.filtered(b'served.hidden'))
if repository.CACHE_CHANGELOG_CACHE in caches:
self.changelog.update_caches(transaction=tr)