Mercurial > public > mercurial-scm > hg
diff mercurial/manifest.py @ 30219:3c8811efdddc stable
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.
author | Durham Goode <durham@fb.com> |
---|---|
date | Tue, 18 Oct 2016 17:33:39 -0700 |
parents | 9d06b65c5df2 |
children | acc8885a6450 |
line wrap: on
line diff
--- 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