changeset 44864:97ebdb192b00

nodemap: also warm manifest nodemap with other caches The `hg debugupdatecache` command now also warm the persistent nodemap for the manifest (when applicable). Differential Revision: https://phab.mercurial-scm.org/D8411
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 05 Apr 2020 18:32:46 +0200
parents 640d5b3bd060
children 6493f0a567c2
files mercurial/interfaces/repository.py mercurial/localrepo.py mercurial/manifest.py
diffstat 3 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/interfaces/repository.py	Sun Apr 05 13:12:05 2020 +0200
+++ b/mercurial/interfaces/repository.py	Sun Apr 05 18:32:46 2020 +0200
@@ -1395,6 +1395,9 @@
         Raises ``error.LookupError`` if the node is not known.
         """
 
+    def update_caches(transaction):
+        """update whatever cache are relevant for the used storage."""
+
 
 class ilocalrepositoryfilestorage(interfaceutil.Interface):
     """Local repository sub-interface providing access to tracked file storage.
--- a/mercurial/localrepo.py	Sun Apr 05 13:12:05 2020 +0200
+++ b/mercurial/localrepo.py	Sun Apr 05 18:32:46 2020 +0200
@@ -2509,6 +2509,7 @@
             unfi = self.unfiltered()
 
             self.changelog.update_caches(transaction=tr)
+            self.manifestlog.update_caches(transaction=tr)
 
             rbc = unfi.revbranchcache()
             for r in unfi.changelog:
--- a/mercurial/manifest.py	Sun Apr 05 13:12:05 2020 +0200
+++ b/mercurial/manifest.py	Sun Apr 05 18:32:46 2020 +0200
@@ -1951,6 +1951,9 @@
     def rev(self, node):
         return self._rootstore.rev(node)
 
+    def update_caches(self, transaction):
+        return self._rootstore._revlog.update_caches(transaction=transaction)
+
 
 @interfaceutil.implementer(repository.imanifestrevisionwritable)
 class memmanifestctx(object):