# HG changeset patch # User Boris Feld # Date 2018-09-26 20:45:44 # Node ID 0428feb1f0d7fbe49b7ada4a1754e8341bebb029 # Parent a8318c9cb2ade10ac55eee7f462ec12f244bc7f7 rebase: explicitly track collapses as fold A collapse is a large fold. It is now explicitly tracked (at the cleanupnodes API level). diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -1764,6 +1764,8 @@ def clearrebased(ui, repo, destmap, stat replacements = {} moves = {} stripcleanup = not obsolete.isenabled(repo, obsolete.createmarkersopt) + + collapsednodes = [] for rev, newrev in sorted(state.items()): if newrev >= 0 and newrev != rev: oldnode = tonode(rev) @@ -1774,10 +1776,14 @@ def clearrebased(ui, repo, destmap, stat if rev in skipped: if stripcleanup or not repo[rev].obsolete(): succs = () + elif collapsedas: + collapsednodes.append(oldnode) else: succs = (newnode,) if succs is not None: replacements[(oldnode,)] = succs + if collapsednodes: + replacements[tuple(collapsednodes)] = (collapsedas,) scmutil.cleanupnodes(repo, replacements, 'rebase', moves, backup=backup) if fm: hf = fm.hexfunc