Mercurial > public > mercurial-scm > hg-stable
diff mercurial/localrepo.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 | 1767723f71cf |
children | 3d38a0bc774f |
line wrap: on
line diff
--- 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)