stablerange: directly use 'self' when possible
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Wed, 22 Mar 2017 20:59:42 +0100
changeset 2194 8e7b2918e1a3
parent 2193 47bc8aa0730d
child 2195 bd3d35047181
stablerange: directly use 'self' when possible Code movement introduced multiple silly case were we where accessing 'self' though 'repo.stablerange' for no good reasons.
hgext3rd/evolve/stablerange.py
--- a/hgext3rd/evolve/stablerange.py	Wed Mar 22 20:56:17 2017 +0100
+++ b/hgext3rd/evolve/stablerange.py	Wed Mar 22 20:59:42 2017 +0100
@@ -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