changeset 35441:98cc121099fe

phases: rename _phasemaxrev to _loadedrevslen to clarify it isn't max value "maxrev" sounds like max(0:tip), but it is actually len(0:tip).
author Yuya Nishihara <yuya@tcha.org>
date Thu, 14 Dec 2017 22:35:37 +0900
parents e333d27514b0
children 56745e58df07
files mercurial/phases.py
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/phases.py	Tue Dec 12 15:16:02 2017 -0500
+++ b/mercurial/phases.py	Thu Dec 14 22:35:37 2017 +0900
@@ -203,7 +203,7 @@
         if _load:
             # Cheap trick to allow shallow-copy without copy module
             self.phaseroots, self.dirty = _readroots(repo, phasedefaults)
-            self._phasemaxrev = nullrev
+            self._loadedrevslen = nullrev
             self._phasesets = None
             self.filterunknown(repo)
             self.opener = repo.svfs
@@ -248,13 +248,13 @@
         ph.phaseroots = self.phaseroots[:]
         ph.dirty = self.dirty
         ph.opener = self.opener
-        ph._phasemaxrev = self._phasemaxrev
+        ph._loadedrevslen = self._loadedrevslen
         ph._phasesets = self._phasesets
         return ph
 
     def replace(self, phcache):
         """replace all values in 'self' with content of phcache"""
-        for a in ('phaseroots', 'dirty', 'opener', '_phasemaxrev',
+        for a in ('phaseroots', 'dirty', 'opener', '_loadedrevslen',
                   '_phasesets'):
             setattr(self, a, getattr(phcache, a))
 
@@ -282,19 +282,19 @@
                 ps.add(root)
             ps.difference_update(self._phasesets[secret])
             self._phasesets[draft] = ps
-        self._phasemaxrev = len(cl)
+        self._loadedrevslen = len(cl)
 
     def loadphaserevs(self, repo):
         """ensure phase information is loaded in the object"""
         if self._phasesets is None:
             try:
                 res = self._getphaserevsnative(repo)
-                self._phasemaxrev, self._phasesets = res
+                self._loadedrevslen, self._phasesets = res
             except AttributeError:
                 self._computephaserevspure(repo)
 
     def invalidate(self):
-        self._phasemaxrev = nullrev
+        self._loadedrevslen = nullrev
         self._phasesets = None
 
     def phase(self, repo, rev):
@@ -307,7 +307,7 @@
             return public
         if rev < nullrev:
             raise ValueError(_('cannot lookup negative revision'))
-        if rev >= self._phasemaxrev:
+        if rev >= self._loadedrevslen:
             self.invalidate()
             self.loadphaserevs(repo)
         for phase in trackedphases: