stablerange: use depthrevs in range slicing
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Wed, 22 Mar 2017 18:54:45 +0100
changeset 2172 e2394b33ae51
parent 2171 3be48332b802
child 2173 53352bf5b7fc
stablerange: use depthrevs in range slicing We stop using the property from the class to get us closer to tuple.
hgext3rd/evolve/stablerange.py
--- a/hgext3rd/evolve/stablerange.py	Wed Mar 22 18:53:25 2017 +0100
+++ b/hgext3rd/evolve/stablerange.py	Wed Mar 22 18:54:45 2017 +0100
@@ -304,8 +304,9 @@
         bottom = rangeid._revs[:localindex]
         top = stablerange(repo, rangeid[0], globalindex, rangeid._revs[localindex:])
         #
+        rangedepth = repo.stablerange.depthrev(repo, rangeid[0])
         toprootdepth = repo.stablerange.depthrev(repo, top._revs[0])
-        if toprootdepth + self.rangelength(repo, top) == rangeid.depth + 1:
+        if toprootdepth + self.rangelength(repo, top) == rangedepth + 1:
             bheads = [bottom[-1]]
         else:
             bheads = set(bottom)