1253 they receive (i.e. tree or flat or lazily loaded, etc).""" |
1253 they receive (i.e. tree or flat or lazily loaded, etc).""" |
1254 def __init__(self, opener, repo): |
1254 def __init__(self, opener, repo): |
1255 self._repo = repo |
1255 self._repo = repo |
1256 |
1256 |
1257 usetreemanifest = False |
1257 usetreemanifest = False |
|
1258 cachesize = 4 |
1258 |
1259 |
1259 opts = getattr(opener, 'options', None) |
1260 opts = getattr(opener, 'options', None) |
1260 if opts is not None: |
1261 if opts is not None: |
1261 usetreemanifest = opts.get('treemanifest', usetreemanifest) |
1262 usetreemanifest = opts.get('treemanifest', usetreemanifest) |
|
1263 cachesize = opts.get('manifestcachesize', cachesize) |
1262 self._treeinmem = usetreemanifest |
1264 self._treeinmem = usetreemanifest |
1263 |
1265 |
1264 self._oldmanifest = repo._constructmanifest() |
1266 self._oldmanifest = repo._constructmanifest() |
1265 self._revlog = self._oldmanifest |
1267 self._revlog = self._oldmanifest |
1266 |
1268 |
1267 # A cache of the manifestctx or treemanifestctx for each directory |
1269 # A cache of the manifestctx or treemanifestctx for each directory |
1268 self._dirmancache = {} |
1270 self._dirmancache = {} |
1269 |
1271 self._dirmancache[''] = util.lrucachedict(cachesize) |
1270 # We'll separate this into it's own cache once oldmanifest is no longer |
1272 |
1271 # used |
1273 self.cachesize = cachesize |
1272 self._mancache = self._oldmanifest._mancache |
|
1273 self._dirmancache[''] = self._mancache |
|
1274 |
|
1275 # A future patch makes this use the same config value as the existing |
|
1276 # mancache |
|
1277 self.cachesize = 4 |
|
1278 |
1274 |
1279 def __getitem__(self, node): |
1275 def __getitem__(self, node): |
1280 """Retrieves the manifest instance for the given node. Throws a |
1276 """Retrieves the manifest instance for the given node. Throws a |
1281 LookupError if not found. |
1277 LookupError if not found. |
1282 """ |
1278 """ |