stablesort: move jump recording inside the exclusive function
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 20 Dec 2017 17:59:14 +0100
changeset 3328 ff262ae59541
parent 3327 0abc8fb7f49f
child 3329 c056f125e17d
stablesort: move jump recording inside the exclusive function This will allow use to record to cache size of segment in a later changeset. If the exclusive set is empty, we need to record it outside that function.
hgext3rd/evolve/stablesort.py
--- a/hgext3rd/evolve/stablesort.py	Wed Dec 20 17:49:41 2017 +0100
+++ b/hgext3rd/evolve/stablesort.py	Wed Dec 20 17:59:14 2017 +0100
@@ -413,7 +413,8 @@
                                    tiebreaker, recordjump):
                     yield rev
 
-                recordjump(rev, lower_parent)
+                if rev == current:
+                    recordjump(rev, lower_parent)
 
                 self._jumps[current] = jumps
 
@@ -486,6 +487,8 @@
             # any in processed head has to go in the hard stack
             nextjump = True
             hardstack.extend(softstack)
+        if previous is not None:
+            recordjump(previous, lower)
 
 _methodmap = {
     'branchpoint': stablesort_branchpoint,