changeset 3330:a67a586792dc

stablerange: use cached size data instead of walking the graph Less iteration is better.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 20 Dec 2017 19:47:19 +0100
parents c056f125e17d
children 846bdf081871
files hgext3rd/evolve/stablerange.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/stablerange.py	Wed Dec 20 17:56:38 2017 +0100
+++ b/hgext3rd/evolve/stablerange.py	Wed Dec 20 19:47:19 2017 +0100
@@ -486,12 +486,12 @@
         while 0 < skips:
             jumphead = jumpdest
             currentjump = next(jumps)
-            skipped = size = until(jumphead, currentjump[0])
+            skipped = size = currentjump[2]
             jumpdest = currentjump[1]
             if size == skips:
                 jumphead = jumpdest
                 mainjump = next(jumps)
-                mainsize = until(jumphead, mainjump[0])
+                mainsize = mainjump[2]
             elif skips < size:
                 revs = walkfrom(jumphead)
                 next(revs)
@@ -535,7 +535,7 @@
                 size += mainsize
                 jumphead = mainjump[1]
                 mainjump = next(jumps, None)
-                mainsize = until(jumphead, mainjump[0])
+                mainsize = mainjump[2]
                 ref = next(refjumps, None)
                 if ref is None:
                     # we are doing with section specific to the last merge
@@ -552,7 +552,7 @@
                     size = 0
                     jumphead = rangehead = mainjump[1]
                     mainjump = next(jumps, None)
-                    mainsize = until(jumphead, mainjump[0])
+                    mainsize = mainjump[2]
                     refjumps = None
 
         if tomap: