diff mercurial/branchmap.py @ 51548:1a9bdd0e1c44

branchcache: write branchmap in subset inheritance order This way, we can guarantee a valid subset has been written before touching the branchmap of another filter. This is especially useful as we are bout to start deleting outdated branchmap file.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 08 Mar 2024 15:50:15 +0100
parents 0ddc34330d41
children 94f821490645
line wrap: on
line diff
--- a/mercurial/branchmap.py	Fri Mar 08 15:06:54 2024 +0100
+++ b/mercurial/branchmap.py	Fri Mar 08 15:50:15 2024 +0100
@@ -166,7 +166,10 @@
 
     def write_delayed(self, repo):
         unfi = repo.unfiltered()
-        for filtername, cache in self._per_filter.items():
+        for filtername in repoviewutil.get_ordered_subset():
+            cache = self._per_filter.get(filtername)
+            if cache is None:
+                continue
             if cache._delayed:
                 if filtername is None:
                     repo = unfi