Patchwork D3868: manifest: make cachesize a private attribute

login
register
mail settings
Submitter phabricator
Date July 1, 2018, 1:35 a.m.
Message ID <differential-rev-PHID-DREV-6hlrbvxptowp7omjkk4d-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/32534/
State Superseded
Headers show

Comments

phabricator - July 1, 2018, 1:35 a.m.
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  AFAICT this isn't accessed outside the class. It is a private
  attribute and its naming should reflect that.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3868

AFFECTED FILES
  mercurial/manifest.py

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -1287,7 +1287,7 @@ 
         self._dirmancache = {}
         self._dirmancache[''] = util.lrucachedict(cachesize)
 
-        self.cachesize = cachesize
+        self._cachesize = cachesize
 
     def __getitem__(self, node):
         """Retrieves the manifest instance for the given node. Throws a
@@ -1333,7 +1333,7 @@ 
         if node != revlog.nullid:
             mancache = self._dirmancache.get(dir)
             if not mancache:
-                mancache = util.lrucachedict(self.cachesize)
+                mancache = util.lrucachedict(self._cachesize)
                 self._dirmancache[dir] = mancache
             mancache[node] = m
         return m