changeset 51557:79a7616a82b8

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.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 10 Mar 2024 03:29:12 +0100
parents 0c684ca692a4
children 0239ebdd0740
files mercurial/localrepo.py
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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)