comparison mercurial/manifest.py @ 38510:561a450c7b64

manifest: make cachesize a private attribute AFAICT this isn't accessed outside the class. It is a private attribute and its naming should reflect that. Differential Revision: https://phab.mercurial-scm.org/D3868
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 30 Jun 2018 16:06:05 -0700
parents cf59de802883
children c82ea938efbb
comparison
equal deleted inserted replaced
38509:5cfb01d5ff26 38510:561a450c7b64
1285 1285
1286 # A cache of the manifestctx or treemanifestctx for each directory 1286 # A cache of the manifestctx or treemanifestctx for each directory
1287 self._dirmancache = {} 1287 self._dirmancache = {}
1288 self._dirmancache[''] = util.lrucachedict(cachesize) 1288 self._dirmancache[''] = util.lrucachedict(cachesize)
1289 1289
1290 self.cachesize = cachesize 1290 self._cachesize = cachesize
1291 1291
1292 def __getitem__(self, node): 1292 def __getitem__(self, node):
1293 """Retrieves the manifest instance for the given node. Throws a 1293 """Retrieves the manifest instance for the given node. Throws a
1294 LookupError if not found. 1294 LookupError if not found.
1295 """ 1295 """
1331 m = manifestctx(self, node) 1331 m = manifestctx(self, node)
1332 1332
1333 if node != revlog.nullid: 1333 if node != revlog.nullid:
1334 mancache = self._dirmancache.get(dir) 1334 mancache = self._dirmancache.get(dir)
1335 if not mancache: 1335 if not mancache:
1336 mancache = util.lrucachedict(self.cachesize) 1336 mancache = util.lrucachedict(self._cachesize)
1337 self._dirmancache[dir] = mancache 1337 self._dirmancache[dir] = mancache
1338 mancache[node] = m 1338 mancache[node] = m
1339 return m 1339 return m
1340 1340
1341 def clearcaches(self): 1341 def clearcaches(self):