stablerange: drop length from the class
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Wed, 22 Mar 2017 19:28:14 +0100
changeset 2180 7570e0683460
parent 2179 97d342655cd1
child 2181 eea1fdeb1eb3
stablerange: drop length from the class There is not remaining user.
hgext3rd/evolve/stablerange.py
--- 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