# HG changeset patch # User Pierre-Yves David # Date 1513769805 -3600 # Node ID 360a543930c656d1e532f6e192a79ff2f2f6599a # Parent bacb44f4f33efd8ab50af92f26fb6aa196c34737 stablesort: stop recording jump type There are no mature user of this "jump type" data and the current implementation is known to be buggy. So we drop the logic for now. This will make on disk storage simpler. The data will be reintroduced later diff -r bacb44f4f33e -r 360a543930c6 hgext3rd/evolve/stablesort.py --- a/hgext3rd/evolve/stablesort.py Wed Dec 20 12:29:02 2017 +0100 +++ b/hgext3rd/evolve/stablesort.py Wed Dec 20 12:36:45 2017 +0100 @@ -310,10 +310,6 @@ ' %s\n' % (first, second)) return second -JUMPSOFT = 1 # jump when a branch have been explored -JUMPHARD = 2 # jump because we reach the outside of the exclusive area -JUMPFINAL = 3 # jump because we are done sorting the exclusive area - class stablesortcache(object): def __init__(self): @@ -389,15 +385,15 @@ rev = current jumps = [] - def recordjump(source, destination, jumptype): - jump = (source, destination, jumptype) + def recordjump(source, destination): + jump = (source, destination) jumps.append(jump) process = self._process_exclusive_side for rev in process(lower_parent, higher_parent, cl, parents, tiebreaker, recordjump): yield rev - recordjump(rev, lower_parent, JUMPFINAL) + recordjump(rev, lower_parent) self._jumps[current] = jumps @@ -435,7 +431,7 @@ if 2 <= len(all_parents): max_parents = max(all_parents, key=tiebreaker) - jump_type = None + jump = False ready_parents = [p for p in all_parents if children[p].issubset(seen)] @@ -444,16 +440,16 @@ if (len(all_parents) != len(ready_parents) and max_parents not in ready_parents): - jump_type = JUMPSOFT + jump = True elif (len(ready_parents) != len(okay_parents) and max_parents not in okay_parents): - jump_type = JUMPHARD + jump = True elif not all_parents: - jump_type = JUMPSOFT + jump = True if not okay_parents: - if jump_type is None: - jump_type = JUMPSOFT + if jump is None: + jump = True if stack: next = stack.pop() else: @@ -464,8 +460,8 @@ lower_parent, higher_parent = sorted(ready_parents, key=tiebreaker) stack.append(lower_parent) next = higher_parent - if jump_type is not None and next is not None: - recordjump(current, next, jump_type) + if jump is not None and next is not None: + recordjump(current, next) current = next _methodmap = {