# HG changeset patch # User Arseniy Alekseyev # Date 1684434239 -3600 # Node ID 5d84b1385f7fce06e6099aa507baff0ce16634f2 # Parent 3b56395404a1d6dac6ea373a4820728c533ccf1f 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. diff -r 3b56395404a1 -r 5d84b1385f7f mercurial/localrepo.py --- 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() diff -r 3b56395404a1 -r 5d84b1385f7f tests/test-fncache.t --- a/tests/test-fncache.t Wed May 31 10:37:55 2023 +0100 +++ b/tests/test-fncache.t Thu May 18 19:23:59 2023 +0100 @@ -514,6 +514,7 @@ $ hg clone -q . tobundle fncache load triggered! fncache load triggered! + fncache load triggered! $ echo 'new line' > tobundle/bar $ hg -R tobundle ci -qm bar diff -r 3b56395404a1 -r 5d84b1385f7f tests/test-treemanifest.t --- a/tests/test-treemanifest.t Wed May 31 10:37:55 2023 +0100 +++ b/tests/test-treemanifest.t Thu May 18 19:23:59 2023 +0100 @@ -897,3 +897,8 @@ .hg/store/meta/dir/00manifest.i: size=721 $ hg files --rev tip | wc -l \s*20 (re) + +testing cache update warming persistent nodemaps +------------------------------------------------ + + $ hg debugupdatecache