more explicite name in revsfromrange
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Fri, 24 Mar 2017 03:30:14 +0100
changeset 2210 37bd878d2e58
parent 2209 d25d39b88c7f
child 2211 ecb46c7ee281
more explicite name in revsfromrange
hgext3rd/evolve/stablerange.py
--- a/hgext3rd/evolve/stablerange.py	Fri Mar 24 05:15:25 2017 +0100
+++ b/hgext3rd/evolve/stablerange.py	Fri Mar 24 03:30:14 2017 +0100
@@ -231,21 +231,22 @@
 
     def revsfromrange(self, repo, rangeid):
         revs = self._revsinrangecache.get(rangeid)
+        headrev, index = rangeid
         if revs is None:
             if self.rangelength(repo, rangeid) == 1:
-                revs = [rangeid[0]]
+                revs = [headrev]
             else:
                 # get all revs under heads in stable order
                 #
                 # note: In the general case we can just walk down and then request
                 # data about the merge. But I'm not sure this function will be even
                 # call for the general case.
-                allrevs = self._stablesortcache.get(rangeid[0])
+                allrevs = self._stablesortcache.get(headrev)
                 if allrevs is None:
-                    allrevs = stablesort(repo, [rangeid[0]])
-                    self._stablesortcache[rangeid[0]] = allrevs
+                    allrevs = stablesort(repo, [headrev])
+                    self._stablesortcache[headrev] = allrevs
                 # takes from index
-                revs = allrevs[rangeid[1]:]
+                revs = allrevs[index:]
             self._revsinrangecache[rangeid] = revs
         # sanity checks
         assert len(revs) == self.rangelength(repo, rangeid)