[PATCH 5 of 6 RFC] manifest: move mancache to be a property of manifestlog

Durham Goode durham at fb.com
Thu Nov 3 18:27:41 EDT 2016


# HG changeset patch
# User Durham Goode <durham at fb.com>
# Date 1478211830 25200
#      Thu Nov 03 15:23:50 2016 -0700
# Branch stable
# Node ID 1f67aef8b9b6af927ac5e34020ec737eb233c9c8
# Parent  28c62d7ed65d98732218794380629a64db7d6cf1
manifest: move mancache to be a property of manifestlog

In an upcoming diff we're going to change repo.manifestlog from a storecache
property to a normal propertycache. This means it will no longer ever be
invalidated (the underlying revlog will be invalidated though, via the
manifestaccessor). Therefore we need to make sure the mancache is retrieved from
the revlog so that it gets invalidated too.

Once we get rid of the manifest class entirely, we'll get rid of this strange
cache sharing business entirely.

diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -1254,14 +1254,16 @@ class manifestlog(object):
             usetreemanifest = opts.get('treemanifest', usetreemanifest)
         self._treeinmem = usetreemanifest
 
-        # We'll separate this into it's own cache once oldmanifest is no longer
-        # used
-        self._mancache = self._revlog._mancache
-
     @property
     def _revlog(self):
         return self._mfaccessor.revlog
 
+    @property
+    def _mancache(self):
+        # We'll move this cache onto the manifestlog directly once the original
+        # manifest class goes away.
+        return self._revlog._mancache
+
     def __getitem__(self, node):
         """Retrieves the manifest instance for the given node. Throws a KeyError
         if not found.


More information about the Mercurial-devel mailing list