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

login
register
mail settings
Submitter Durham Goode
Date Nov. 3, 2016, 10:27 p.m.
Message ID <1f67aef8b9b6af927ac5.1478212061@dev111.prn1.facebook.com>
Download mbox | patch
Permalink /patch/17331/
State Changes Requested
Headers show

Comments

Durham Goode - Nov. 3, 2016, 10:27 p.m.
# HG changeset patch
# User Durham Goode <durham@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.

Patch

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.