# HG changeset patch # User Pierre-Yves David # Date 1490212782 -3600 # Node ID 8e7b2918e1a31fe5c00b9473e13653bcbdbc33c6 # Parent 47bc8aa0730d8be19385f615f5c7ddcfc994e4f3 stablerange: directly use 'self' when possible Code movement introduced multiple silly case were we where accessing 'self' though 'repo.stablerange' for no good reasons. diff --git a/hgext3rd/evolve/stablerange.py b/hgext3rd/evolve/stablerange.py --- a/hgext3rd/evolve/stablerange.py +++ b/hgext3rd/evolve/stablerange.py @@ -355,8 +355,8 @@ top = stablerange(repo, rangeid[0], globalindex) self._revsinrangecache[top] = toprevs # update cache # - rangedepth = repo.stablerange.depthrev(repo, rangeid[0]) - toprootdepth = repo.stablerange.depthrev(repo, toprevs[0]) + rangedepth = self.depthrev(repo, rangeid[0]) + toprootdepth = self.depthrev(repo, toprevs[0]) if toprootdepth + self.rangelength(repo, top) == rangedepth + 1: bheads = [bottomrevs[-1]] else: @@ -369,7 +369,7 @@ # assert 1 == len(repo.revs('roots(%ld)', top._revs)) if len(bheads) == 1: newhead = bottomrevs[-1] - bottomdepth = repo.stablerange.depthrev(repo, newhead) + bottomdepth = self.depthrev(repo, newhead) newstart = bottomdepth - len(bottomrevs) bottom = stablerange(repo, newhead, newstart) self._revsinrangecache[bottom] = bottomrevs # update cache @@ -380,7 +380,7 @@ for h in bheads: subset = cl.ancestors([h], inclusive=True) hrevs = [r for r in bottomrevs if r in subset] - start = repo.stablerange.depthrev(repo, h) - len(hrevs) + start = self.depthrev(repo, h) - len(hrevs) entry = stablerange(repo, h, start) entryrevs = [r for r in bottomrevs if r in subset] self._revsinrangecache[entry] = entryrevs # update cache