Patchwork [6,of,6,RFC] manifest: change repo.manifestlog to be propertycache instead of storecache

login
register
mail settings
Submitter Durham Goode
Date Nov. 3, 2016, 10:27 p.m.
Message ID <fa009ddb7f16b81c833b.1478212062@dev111.prn1.facebook.com>
Download mbox | patch
Permalink /patch/17330/
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 1478210034 25200
#      Thu Nov 03 14:53:54 2016 -0700
# Branch stable
# Node ID fa009ddb7f16b81c833bd96004d6f7f33aedef10
# Parent  1f67aef8b9b6af927ac5e34020ec737eb233c9c8
manifest: change repo.manifestlog to be propertycache instead of storecache

Now that all the manifest revlog invalidation happens down at the
maniestaccessor layer, we can remove the invalidation that happens on the
manifestlog.

We also have to fix a couple of weird edge cases that try to set the
manifestlog. Notably, the statichttprepo tries to construct it manually for some
reason. It's not clear why this was happening, instead of just relying on the
property to construct it later.

Patch

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -407,8 +407,7 @@  def perftags(ui, repo, **opts):
     repocleartagscache = repocleartagscachefunc(repo)
     def t():
         repo.changelog = mercurial.changelog.changelog(svfs)
-        repo.manifestlog = mercurial.manifest.manifestlog(svfs,
-                                                          repo.manifestaccessor)
+        repo.manifestaccessor.clear(True)
         repocleartagscache()
         return len(repo.tags())
     timer(t)
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -517,7 +517,7 @@  class localrepository(object):
         return revlogaccessor('00manifest.i', svfs,
                               _constructmanifest)
 
-    @storecache('00manifest.i')
+    @unfilteredpropertycache
     def manifestlog(self):
         return manifest.manifestlog(self.svfs, self.manifestaccessor)
 
diff --git a/mercurial/statichttprepo.py b/mercurial/statichttprepo.py
--- a/mercurial/statichttprepo.py
+++ b/mercurial/statichttprepo.py
@@ -18,7 +18,6 @@  from . import (
     changelog,
     error,
     localrepo,
-    manifest,
     namespaces,
     scmutil,
     store,
@@ -155,8 +154,6 @@  class statichttprepository(localrepo.loc
         self._filecache = {}
         self.requirements = requirements
 
-        self.manifestlog = manifest.manifestlog(self.svfs,
-                                                self.manifestaccessor)
         self.changelog = changelog.changelog(self.svfs)
         self._tags = None
         self.nodetagscache = None