# HG changeset patch # User Pierre-Yves David # Date 1490201824 -3600 # Node ID 7967d0b86364fde56c19e86e2fc2792c9c869d56 # Parent 0a06f5cbca4b45752b945b4ac3f3ff4e328c3524 stablerange: stop using '.index' inside the class itself We now access '[1]' as we'll do with the future tuple. diff -r 0a06f5cbca4b -r 7967d0b86364 hgext3rd/evolve/stablerange.py --- a/hgext3rd/evolve/stablerange.py Wed Mar 22 17:55:57 2017 +0100 +++ b/hgext3rd/evolve/stablerange.py Wed Mar 22 17:57:04 2017 +0100 @@ -349,7 +349,7 @@ def __repr__(self): nodehead = self._repo.changelog.node(self[0]) - return '%s %d %d %s' % (nodemod.short(nodehead), self.depth, self.index, nodemod.short(self.obshash)) + return '%s %d %d %s' % (nodemod.short(nodehead), self.depth, self[1], nodemod.short(self.obshash)) def __hash__(self): return self._id @@ -374,10 +374,10 @@ @util.propertycache def _stablekey(self): - return (self[0], self.index) + return (self[0], self[1]) def __len__(self): - return self.depth - self.index + return self.depth - self[1] @util.propertycache def depth(self): @@ -385,8 +385,8 @@ @util.propertycache def _revs(self): - r = stablesort(self._repo, [self[0]])[self.index:] - assert len(r) == len(self), (self[0], self.index, len(r), len(self)) + r = stablesort(self._repo, [self[0]])[self[1]:] + assert len(r) == len(self), (self[0], self[1], len(r), len(self)) return r def subranges(self):