changeset 2211:ecb46c7ee281

minor simplification around rangelength
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Fri, 24 Mar 2017 03:33:36 +0100
parents 37bd878d2e58
children afb35ad42040
files hgext3rd/evolve/stablerange.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/stablerange.py	Fri Mar 24 03:30:14 2017 +0100
+++ b/hgext3rd/evolve/stablerange.py	Fri Mar 24 03:33:36 2017 +0100
@@ -232,8 +232,9 @@
     def revsfromrange(self, repo, rangeid):
         revs = self._revsinrangecache.get(rangeid)
         headrev, index = rangeid
+        rangelength = self.rangelength(repo, rangeid)
         if revs is None:
-            if self.rangelength(repo, rangeid) == 1:
+            if rangelength == 1:
                 revs = [headrev]
             else:
                 # get all revs under heads in stable order
@@ -249,7 +250,7 @@
                 revs = allrevs[index:]
             self._revsinrangecache[rangeid] = revs
         # sanity checks
-        assert len(revs) == self.rangelength(repo, rangeid)
+        assert len(revs) == rangelength
         return revs
 
     def _parents(self, rev, func):