changeset 2169:03baabcd1b9e

stablerange: use rangelength in '_slicesatrange' We stop using the building '__len__' this get use closer to be able to use a tuple.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Wed, 22 Mar 2017 18:40:54 +0100
parents 3012d4ddfb23
children f8d3d965552e
files hgext3rd/evolve/stablerange.py
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/stablerange.py	Wed Mar 22 18:40:19 2017 +0100
+++ b/hgext3rd/evolve/stablerange.py	Wed Mar 22 18:40:54 2017 +0100
@@ -296,8 +296,7 @@
             slices.append(top)
             return slices
 
-    @staticmethod
-    def _slicesrangeatmerge(repo, rangeid, globalindex):
+    def _slicesrangeatmerge(self, repo, rangeid, globalindex):
         localindex = globalindex - rangeid[1]
         cl = repo.changelog
 
@@ -306,7 +305,7 @@
         top = stablerange(repo, rangeid[0], globalindex, rangeid._revs[localindex:])
         #
         toprootdepth = repo.stablerange.depthrev(repo, top._revs[0])
-        if toprootdepth + len(top) == rangeid.depth + 1:
+        if toprootdepth + self.rangelength(repo, top) == rangeid.depth + 1:
             bheads = [bottom[-1]]
         else:
             bheads = set(bottom)