stablerange: stop using '.head' inside the class
We now access '[0]' as we'll do with the future tuple.
--- a/hgext3rd/evolve/stablerange.py Wed Mar 22 17:45:21 2017 +0100
+++ b/hgext3rd/evolve/stablerange.py Wed Mar 22 17:45:39 2017 +0100
@@ -348,7 +348,7 @@
assert index < self.depth, (head, index, self.depth, revs)
def __repr__(self):
- nodehead = self._repo.changelog.node(self.head)
+ nodehead = self._repo.changelog.node(self[0])
return '%s %d %d %s' % (nodemod.short(nodehead), self.depth, self.index, nodemod.short(self.obshash))
def __hash__(self):
@@ -374,19 +374,19 @@
@util.propertycache
def stablekey(self):
- return (self.head, self.index)
+ return (self[0], self.index)
def __len__(self):
return self.depth - self.index
@util.propertycache
def depth(self):
- return self._repo.stablerange.depthrev(self._repo, self.head)
+ return self._repo.stablerange.depthrev(self._repo, self[0])
@util.propertycache
def _revs(self):
- r = stablesort(self._repo, [self.head])[self.index:]
- assert len(r) == len(self), (self.head, self.index, len(r), len(self))
+ r = stablesort(self._repo, [self[0]])[self.index:]
+ assert len(r) == len(self), (self[0], self.index, len(r), len(self))
return r
def subranges(self):