stablerange: stop using '.head' in '_slicesrangeat'
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Wed, 22 Mar 2017 17:45:21 +0100
changeset 2153 7c5149a129d2
parent 2152 c00fb215cd80
child 2154 f02f63c26424
stablerange: stop using '.head' in '_slicesrangeat' We now access '[0]' as we'll do with the future tuple.
hgext3rd/evolve/stablerange.py
--- a/hgext3rd/evolve/stablerange.py	Wed Mar 22 17:44:10 2017 +0100
+++ b/hgext3rd/evolve/stablerange.py	Wed Mar 22 17:45:21 2017 +0100
@@ -271,16 +271,16 @@
         return slicepoint
 
     def _slicesrangeat(self, repo, rangeid, globalindex):
-        p1, p2 = repo.changelog.parentrevs(rangeid.head)
+        p1, p2 = repo.changelog.parentrevs(rangeid[0])
         if p2 != nodemod.nullrev:
             return self._slicesrangeatmerge(repo, rangeid, globalindex)
         assert p1 != nodemod.nullrev
-        rangedepth = self.depthrev(repo, rangeid.head)
+        rangedepth = self.depthrev(repo, rangeid[0])
         topsize = rangedepth - globalindex
 
         parentrange = stablerange(repo, p1, rangeid.index, rangeid._revs[:-1])
         if topsize == 1:
-            top = stablerange(repo, rangeid.head, globalindex, [rangeid.head])
+            top = stablerange(repo, rangeid[0], globalindex, [rangeid[0]])
             return [parentrange, top]
         else:
             # XXX recursive call, python have issue with them
@@ -291,7 +291,7 @@
             # wait for that heavy object to be gone.
             parentsubranges = self.subranges(repo, parentrange)
             slices = parentsubranges[:-1] # pop the top
-            top = stablerange(repo, rangeid.head, globalindex, rangeid._revs[-topsize:])
+            top = stablerange(repo, rangeid[0], globalindex, rangeid._revs[-topsize:])
             slices.append(top)
             return slices
 
@@ -302,7 +302,7 @@
 
         result = []
         bottom = rangeid._revs[:localindex]
-        top = stablerange(repo, rangeid.head, globalindex, rangeid._revs[localindex:])
+        top = stablerange(repo, rangeid[0], globalindex, rangeid._revs[localindex:])
         #
         toprootdepth = repo.stablerange.depthrev(repo, top._revs[0])
         if toprootdepth + len(top) == rangeid.depth + 1: