# HG changeset patch # User Durham Goode # Date 1478772799 28800 # Node ID 7c7d845f8b64d7a6c280574ebbe281b8a9e2cc48 # Parent fccc3eea2ddb0f154d8c84509633d1336355171c manifest: make manifestlog use it's own cache As we start to make manifestlog the primary manifest source, the dependency on manifest.manifest will cause circular dependency problems. Let's break this dependency by making manifestlog use it's own cache. In a near future patch we will remove the previous manifest cache so we're not duplicating it. diff -r fccc3eea2ddb -r 7c7d845f8b64 mercurial/manifest.py --- a/mercurial/manifest.py Thu Nov 10 02:13:19 2016 -0800 +++ b/mercurial/manifest.py Thu Nov 10 02:13:19 2016 -0800 @@ -1255,10 +1255,12 @@ self._repo = repo usetreemanifest = False + cachesize = 4 opts = getattr(opener, 'options', None) if opts is not None: usetreemanifest = opts.get('treemanifest', usetreemanifest) + cachesize = opts.get('manifestcachesize', cachesize) self._treeinmem = usetreemanifest self._oldmanifest = repo._constructmanifest() @@ -1266,15 +1268,9 @@ # A cache of the manifestctx or treemanifestctx for each directory self._dirmancache = {} + self._dirmancache[''] = util.lrucachedict(cachesize) - # We'll separate this into it's own cache once oldmanifest is no longer - # used - self._mancache = self._oldmanifest._mancache - self._dirmancache[''] = self._mancache - - # A future patch makes this use the same config value as the existing - # mancache - self.cachesize = 4 + self.cachesize = cachesize def __getitem__(self, node): """Retrieves the manifest instance for the given node. Throws a