changeset 30218:1767723f71cf stable

manifest: move manifest creation to a helper function A future patch will be moving manifest creation to be inside manifestlog as part of improving our cache guarantees. bundlerepo and unionrepo currently rely on being able to hook into manifest creation, so let's temporarily move the actual manifest creation to a helper function for them to intercept. In the future manifest.manifest() will disappear entirely and this can disappear.
author Durham Goode <durham@fb.com>
date Tue, 18 Oct 2016 17:32:51 -0700
parents e478f11e4182
children 3c8811efdddc
files mercurial/bundlerepo.py mercurial/localrepo.py mercurial/unionrepo.py
diffstat 3 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bundlerepo.py	Tue Oct 18 14:27:30 2016 -0500
+++ b/mercurial/bundlerepo.py	Tue Oct 18 17:32:51 2016 -0700
@@ -343,8 +343,7 @@
         self.manstart = self.bundle.tell()
         return c
 
-    @localrepo.unfilteredpropertycache
-    def manifest(self):
+    def _constructmanifest(self):
         self.bundle.seek(self.manstart)
         # consume the header if it exists
         self.bundle.manifestheader()
--- a/mercurial/localrepo.py	Tue Oct 18 14:27:30 2016 -0500
+++ b/mercurial/localrepo.py	Tue Oct 18 17:32:51 2016 -0700
@@ -506,6 +506,12 @@
 
     @storecache('00manifest.i')
     def manifest(self):
+        return self._constructmanifest()
+
+    def _constructmanifest(self):
+        # This is a temporary function while we migrate from manifest to
+        # manifestlog. It allows bundlerepo and unionrepo to intercept the
+        # manifest creation.
         return manifest.manifest(self.svfs)
 
     @property
--- a/mercurial/unionrepo.py	Tue Oct 18 14:27:30 2016 -0500
+++ b/mercurial/unionrepo.py	Tue Oct 18 17:32:51 2016 -0700
@@ -208,8 +208,7 @@
         node = self.repo2.changelog.node(rev2)
         return self.changelog.rev(node)
 
-    @localrepo.unfilteredpropertycache
-    def manifest(self):
+    def _constructmanifest(self):
         return unionmanifest(self.svfs, self.repo2.svfs,
                              self.unfiltered()._clrev)