diff mercurial/localrepo.py @ 50673:5d84b1385f7f

treemanifest: make `updatecaches` update the nodemaps for all directories Without this, if the cache for a nested directory is in a bad state, it's very hard to repair it.
author Arseniy Alekseyev <aalekseyev@janestreet.com>
date Thu, 18 May 2023 19:23:59 +0100
parents 60f9602b413e
children 2aaabd8f4471
line wrap: on
line diff
--- a/mercurial/localrepo.py	Wed May 31 10:37:55 2023 +0100
+++ b/mercurial/localrepo.py	Thu May 18 19:23:59 2023 +0100
@@ -2936,6 +2936,14 @@
 
         if repository.CACHE_MANIFESTLOG_CACHE in caches:
             self.manifestlog.update_caches(transaction=tr)
+            for entry in self.store.walk():
+                if not entry.is_revlog:
+                    continue
+                if not entry.is_manifestlog:
+                    continue
+                manifestrevlog = entry.get_revlog_instance(self).get_revlog()
+                if manifestrevlog is not None:
+                    manifestrevlog.update_caches(transaction=tr)
 
         if repository.CACHE_REV_BRANCH in caches:
             rbc = unfi.revbranchcache()