# HG changeset patch # User Durham Goode # Date 1476837219 25200 # Node ID 3c8811efdddcee3e54632e62af8ebd808220c806 # Parent 1767723f71cf626ea2b9fa49efee8a7153310527 manifest: make manifestlog a storecache The old @property on manifestlog was broken. It meant that we would always recreate the manifestlog instance, which meant the cache was never hit. Since we'll eventually remove repo.manifest and make manifestlog the only property, let's go ahead and make manifestlog the @storecache property, have manifestlog own the manifest instance, and have repo.manifest refer to it via manifestlog. This means all accesses go through repo.manifestlog, which is now invalidated correctly. diff -r 1767723f71cf -r 3c8811efdddc contrib/perf.py --- a/contrib/perf.py Tue Oct 18 17:32:51 2016 -0700 +++ b/contrib/perf.py Tue Oct 18 17:33:39 2016 -0700 @@ -407,7 +407,7 @@ repocleartagscache = repocleartagscachefunc(repo) def t(): repo.changelog = mercurial.changelog.changelog(svfs) - repo.manifest = mercurial.manifest.manifest(svfs) + repo.manifestlog = mercurial.manifest.manifestlog(svfs, repo) repocleartagscache() return len(repo.tags()) timer(t) diff -r 1767723f71cf -r 3c8811efdddc mercurial/localrepo.py --- a/mercurial/localrepo.py Tue Oct 18 17:32:51 2016 -0700 +++ b/mercurial/localrepo.py Tue Oct 18 17:33:39 2016 -0700 @@ -504,9 +504,9 @@ c.readpending('00changelog.i.a') return c - @storecache('00manifest.i') + @property def manifest(self): - return self._constructmanifest() + return self.manifestlog._oldmanifest def _constructmanifest(self): # This is a temporary function while we migrate from manifest to @@ -514,7 +514,7 @@ # manifest creation. return manifest.manifest(self.svfs) - @property + @storecache('00manifest.i') def manifestlog(self): return manifest.manifestlog(self.svfs, self) diff -r 1767723f71cf -r 3c8811efdddc mercurial/manifest.py --- a/mercurial/manifest.py Tue Oct 18 17:32:51 2016 -0700 +++ b/mercurial/manifest.py Tue Oct 18 17:33:39 2016 -0700 @@ -1254,13 +1254,12 @@ usetreemanifest = opts.get('treemanifest', usetreemanifest) self._treeinmem = usetreemanifest + self._oldmanifest = repo._constructmanifest() + self._revlog = self._oldmanifest + # We'll separate this into it's own cache once oldmanifest is no longer # used - self._mancache = repo.manifest._mancache - - @property - def _revlog(self): - return self._repo.manifest + self._mancache = self._oldmanifest._mancache def __getitem__(self, node): """Retrieves the manifest instance for the given node. Throws a KeyError diff -r 1767723f71cf -r 3c8811efdddc mercurial/statichttprepo.py --- a/mercurial/statichttprepo.py Tue Oct 18 17:32:51 2016 -0700 +++ b/mercurial/statichttprepo.py Tue Oct 18 17:33:39 2016 -0700 @@ -155,7 +155,7 @@ self._filecache = {} self.requirements = requirements - self.manifest = manifest.manifest(self.svfs) + self.manifestlog = manifest.manifestlog(self.svfs, self) self.changelog = changelog.changelog(self.svfs) self._tags = None self.nodetagscache = None