diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -282,6 +282,19 @@ def rebase(ui, repo, **opts): if abortf: return abort(repo, originalwd, target, state, activebookmark=activebookmark) + + obsoletenotrebased = {} + if ui.configbool('experimental', 'rebaseskipobsolete', + default=True): + rebaseobsrevs = set([r for r, status in state.items() + if status == revprecursor]) + rebasesetrevs = set(state.keys()) + obsoletenotrebased = _computeobsoletenotrebased(repo, + rebaseobsrevs, + target) + rebaseobsskipped = set(obsoletenotrebased) + _checkobsrebase(repo, ui, rebaseobsrevs, rebasesetrevs, + rebaseobsskipped) else: dest, rebaseset = _definesets(ui, repo, destf, srcf, basef, revf) if dest is None: diff --git a/tests/test-rebase-obsolete.t b/tests/test-rebase-obsolete.t --- a/tests/test-rebase-obsolete.t +++ b/tests/test-rebase-obsolete.t @@ -805,3 +805,61 @@ With experimental.allowdivergence=True, phases: 8 draft divergent: 2 changesets +rebase --continue + skipped rev because their successors are in destination +we make a change in trunk and work on conflicting changes to make rebase abort. + + $ hg log -G -r 17:: + @ 17:61bd55f69bc4 bar foo + | + ~ + +Create the two changes in trunk + $ printf "a" > willconflict + $ hg add willconflict + $ hg commit -m "willconflict first version" + + $ printf "dummy" > C + $ hg commit -m "dummy change successor" + +Create the changes that we will rebase + $ hg update -C 17 -q + $ printf "b" > willconflict + $ hg add willconflict + $ hg commit -m "willconflict second version" + created new head + $ printf "dummy" > K + $ hg add K + $ hg commit -m "dummy change" + $ printf "dummy" > L + $ hg add L + $ hg commit -m "dummy change" + $ hg debugobsolete `hg log -r ".^" -T '{node}'` `hg log -r 19 -T '{node}'` --config experimental.evolution=all + + $ hg log -G -r 17:: + @ 22:7bdc8a87673d dummy change + | + x 21:8b31da3c4919 dummy change + | + o 20:b82fb57ea638 willconflict second version + | + | o 19:601db7a18f51 dummy change successor + | | + | o 18:357ddf1602d5 willconflict first version + |/ + o 17:61bd55f69bc4 bar foo + | + ~ + $ hg rebase -r ".^^ + .^ + ." -d 19 + rebasing 20:b82fb57ea638 "willconflict second version" + merging willconflict + warning: conflicts while merging willconflict! (edit, then use 'hg resolve --mark') + unresolved conflicts (see hg resolve, then hg rebase --continue) + [1] + + $ hg resolve --mark willconflict + (no more unresolved files) + continue: hg rebase --continue + $ hg rebase --continue + rebasing 20:b82fb57ea638 "willconflict second version" + note: not rebasing 21:8b31da3c4919 "dummy change", already in destination as 19:601db7a18f51 "dummy change successor" + rebasing 22:7bdc8a87673d "dummy change" (tip)