changeset 2180:7570e0683460

stablerange: drop length from the class There is not remaining user.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Wed, 22 Mar 2017 19:28:14 +0100
parents 97d342655cd1
children eea1fdeb1eb3
files hgext3rd/evolve/stablerange.py
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/stablerange.py	Wed Mar 22 19:26:40 2017 +0100
+++ b/hgext3rd/evolve/stablerange.py	Wed Mar 22 19:28:14 2017 +0100
@@ -345,7 +345,8 @@
         self._head = head
         self._index = index
         if revs is not None:
-            assert len(revs) == self._len()
+            length = self._repo.stablerange.rangelength(self._repo, self)
+            assert len(revs) == length
             self._revs = revs
         depth = self._repo.stablerange.depthrev(self._repo, self[0])
         assert index < depth, (head, index, depth, revs)
@@ -375,13 +376,11 @@
     def _stablekey(self):
         return (self[0], self[1])
 
-    def _len(self):
-        return self._repo.stablerange.rangelength(self._repo, self)
-
     @util.propertycache
     def _revs(self):
+        length = self._repo.stablerange.rangelength(self._repo, self)
         r = stablesort(self._repo, [self[0]])[self[1]:]
-        assert len(r) == self._len(), (self[0], self[1], len(r), self._len())
+        assert len(r) == length, (self[0], self[1], len(r), length)
         return r
 
 @eh.reposetup