# HG changeset patch # User Pierre-Yves David # Date 1490204454 -3600 # Node ID 03baabcd1b9e700302d09f6f8feea13d9f058b12 # Parent 3012d4ddfb23c66ad5f39b4646bd747a4facd716 stablerange: use rangelength in '_slicesatrange' We stop using the building '__len__' this get use closer to be able to use a tuple. diff -r 3012d4ddfb23 -r 03baabcd1b9e hgext3rd/evolve/stablerange.py --- 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)