nodemap: also warm manifest nodemap with other caches
authorPierre-Yves David <pierre-yves.david@octobus.net>
Sun, 05 Apr 2020 18:32:46 +0200
changeset 44787 97ebdb192b00
parent 44786 640d5b3bd060
child 44788 6493f0a567c2
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
mercurial/interfaces/repository.py
mercurial/localrepo.py
mercurial/manifest.py
--- 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):