# HG changeset patch # User Augie Fackler # Date 2013-02-08 22:27:49 # Node ID 93f3a06b2035226f04b01f7b3cc906d203eed74b # Parent 42b620fc89e2f71908743ac9d5863bd95699dd2d histedit: switch from util.Abort to util.InterventionRequired where appropriate (bc) diff --git a/hgext/histedit.py b/hgext/histedit.py --- a/hgext/histedit.py +++ b/hgext/histedit.py @@ -301,8 +301,8 @@ def pick(ui, repo, ctx, ha, opts): hg.update(repo, ctx.node()) stats = applychanges(ui, repo, oldctx, opts) if stats and stats[3] > 0: - raise util.Abort(_('Fix up the change and run ' - 'hg histedit --continue')) + raise error.InterventionRequired(_('Fix up the change and run ' + 'hg histedit --continue')) # drop the second merge parent commit = commitfuncfor(repo, oldctx) n = commit(text=oldctx.description(), user=oldctx.user(), @@ -319,17 +319,17 @@ def edit(ui, repo, ctx, ha, opts): oldctx = repo[ha] hg.update(repo, ctx.node()) applychanges(ui, repo, oldctx, opts) - raise util.Abort(_('Make changes as needed, you may commit or record as ' - 'needed now.\nWhen you are finished, run hg' - ' histedit --continue to resume.')) + raise error.InterventionRequired( + _('Make changes as needed, you may commit or record as needed now.\n' + 'When you are finished, run hg histedit --continue to resume.')) def fold(ui, repo, ctx, ha, opts): oldctx = repo[ha] hg.update(repo, ctx.node()) stats = applychanges(ui, repo, oldctx, opts) if stats and stats[3] > 0: - raise util.Abort(_('Fix up the change and run ' - 'hg histedit --continue')) + raise error.InterventionRequired( + _('Fix up the change and run hg histedit --continue')) n = repo.commit(text='fold-temp-revision %s' % ha, user=oldctx.user(), date=oldctx.date(), extra=oldctx.extra()) if n is None: @@ -390,8 +390,8 @@ def message(ui, repo, ctx, ha, opts): hg.update(repo, ctx.node()) stats = applychanges(ui, repo, oldctx, opts) if stats and stats[3] > 0: - raise util.Abort(_('Fix up the change and run ' - 'hg histedit --continue')) + raise error.InterventionRequired( + _('Fix up the change and run hg histedit --continue')) message = oldctx.description() + '\n' message = ui.edit(message, ui.username()) commit = commitfuncfor(repo, oldctx) diff --git a/tests/test-histedit-edit.t b/tests/test-histedit-edit.t --- a/tests/test-histedit-edit.t +++ b/tests/test-histedit-edit.t @@ -63,7 +63,7 @@ log before edit edit the history $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle 0 files updated, 0 files merged, 2 files removed, 0 files unresolved - abort: Make changes as needed, you may commit or record as needed now. + Make changes as needed, you may commit or record as needed now. When you are finished, run hg histedit --continue to resume. Go at a random point and try to continue @@ -151,7 +151,7 @@ check histedit_source > EOF $ HGEDITOR="cat \"$EDITED\" > " hg histedit tip 2>&1 | fixbundle 0 files updated, 0 files merged, 1 files removed, 0 files unresolved - abort: Make changes as needed, you may commit or record as needed now. + Make changes as needed, you may commit or record as needed now. When you are finished, run hg histedit --continue to resume. $ hg status A f diff --git a/tests/test-histedit-fold-non-commute.t b/tests/test-histedit-fold-non-commute.t --- a/tests/test-histedit-fold-non-commute.t +++ b/tests/test-histedit-fold-non-commute.t @@ -91,7 +91,7 @@ edit the history merging e warning: conflicts during merge. merging e incomplete! (edit conflicts, then use 'hg resolve --mark') - abort: Fix up the change and run hg histedit --continue + Fix up the change and run hg histedit --continue fix up $ echo 'I can haz no commute' > e @@ -125,7 +125,7 @@ fix up merging e warning: conflicts during merge. merging e incomplete! (edit conflicts, then use 'hg resolve --mark') - abort: Fix up the change and run hg histedit --continue + Fix up the change and run hg histedit --continue just continue this time $ hg revert -r 'p1()' e diff --git a/tests/test-histedit-fold.t b/tests/test-histedit-fold.t --- a/tests/test-histedit-fold.t +++ b/tests/test-histedit-fold.t @@ -182,7 +182,7 @@ folding and creating no new change doesn merging file warning: conflicts during merge. merging file incomplete! (edit conflicts, then use 'hg resolve --mark') - abort: Fix up the change and run hg histedit --continue + Fix up the change and run hg histedit --continue [255] There were conflicts, we keep P1 content. This should effectively drop the changes from +6. @@ -247,7 +247,7 @@ dropped revision. merging file warning: conflicts during merge. merging file incomplete! (edit conflicts, then use 'hg resolve --mark') - abort: Fix up the change and run hg histedit --continue + Fix up the change and run hg histedit --continue [255] $ cat > file << EOF > 1 diff --git a/tests/test-histedit-no-change.t b/tests/test-histedit-no-change.t --- a/tests/test-histedit-no-change.t +++ b/tests/test-histedit-no-change.t @@ -92,7 +92,7 @@ editing a changeset without any actual c | edit e860deea161a 4 e | pick 652413bf663e 5 f 0 files updated, 0 files merged, 2 files removed, 0 files unresolved - abort: Make changes as needed, you may commit or record as needed now. + Make changes as needed, you may commit or record as needed now. When you are finished, run hg histedit --continue to resume. $ continueediting true "(leaving commit message unaltered)" % finalize changeset editing (leaving commit message unaltered) @@ -145,12 +145,12 @@ check state of working copy | edit e860deea161a 4 e | pick 652413bf663e 5 f 0 files updated, 0 files merged, 3 files removed, 0 files unresolved - abort: Make changes as needed, you may commit or record as needed now. + Make changes as needed, you may commit or record as needed now. When you are finished, run hg histedit --continue to resume. $ continueediting true "(leaving commit message unaltered)" % finalize changeset editing (leaving commit message unaltered) 0 files updated, 0 files merged, 0 files removed, 0 files unresolved - abort: Make changes as needed, you may commit or record as needed now. + Make changes as needed, you may commit or record as needed now. When you are finished, run hg histedit --continue to resume. $ graphlog "log after first edit" % log after first edit diff --git a/tests/test-histedit-non-commute-abort.t b/tests/test-histedit-non-commute-abort.t --- a/tests/test-histedit-non-commute-abort.t +++ b/tests/test-histedit-non-commute-abort.t @@ -79,7 +79,7 @@ edit the history merging e warning: conflicts during merge. merging e incomplete! (edit conflicts, then use 'hg resolve --mark') - abort: Fix up the change and run hg histedit --continue + Fix up the change and run hg histedit --continue abort the edit diff --git a/tests/test-histedit-non-commute.t b/tests/test-histedit-non-commute.t --- a/tests/test-histedit-non-commute.t +++ b/tests/test-histedit-non-commute.t @@ -92,7 +92,7 @@ edit the history merging e warning: conflicts during merge. merging e incomplete! (edit conflicts, then use 'hg resolve --mark') - abort: Fix up the change and run hg histedit --continue + Fix up the change and run hg histedit --continue abort the edit $ hg histedit --abort 2>&1 | fixbundle @@ -150,7 +150,7 @@ edit the history merging e warning: conflicts during merge. merging e incomplete! (edit conflicts, then use 'hg resolve --mark') - abort: Fix up the change and run hg histedit --continue + Fix up the change and run hg histedit --continue fix up $ echo 'I can haz no commute' > e @@ -160,7 +160,7 @@ fix up merging e warning: conflicts during merge. merging e incomplete! (edit conflicts, then use 'hg resolve --mark') - abort: Fix up the change and run hg histedit --continue + Fix up the change and run hg histedit --continue This failure is caused by 7b4e2f4b7bcd "e" not rebasing the non commutative former children. @@ -236,7 +236,7 @@ edit the history, this time with a fold merging e warning: conflicts during merge. merging e incomplete! (edit conflicts, then use 'hg resolve --mark') - abort: Fix up the change and run hg histedit --continue + Fix up the change and run hg histedit --continue $ echo 'I can haz no commute' > e $ hg resolve --mark e @@ -245,7 +245,7 @@ edit the history, this time with a fold merging e warning: conflicts during merge. merging e incomplete! (edit conflicts, then use 'hg resolve --mark') - abort: Fix up the change and run hg histedit --continue + Fix up the change and run hg histedit --continue second edit also fails, but just continue $ hg revert -r 'p1()' e $ hg resolve --mark e diff --git a/tests/test-histedit-obsolete.t b/tests/test-histedit-obsolete.t --- a/tests/test-histedit-obsolete.t +++ b/tests/test-histedit-obsolete.t @@ -139,7 +139,7 @@ Test that rewriting leaving instability $ hg histedit -r '.' --commands commands.txt 0 files updated, 0 files merged, 1 files removed, 0 files unresolved adding c - abort: Make changes as needed, you may commit or record as needed now. + Make changes as needed, you may commit or record as needed now. When you are finished, run hg histedit --continue to resume. [255] $ echo c >> c @@ -278,7 +278,7 @@ New-commit as draft (default) $ hg histedit -r 'b449568bf7fc' --commands commands.txt 0 files updated, 0 files merged, 6 files removed, 0 files unresolved adding f - abort: Make changes as needed, you may commit or record as needed now. + Make changes as needed, you may commit or record as needed now. When you are finished, run hg histedit --continue to resume. [255] $ echo f >> f @@ -328,7 +328,7 @@ New-commit as draft (default) $ hg histedit -r 'b449568bf7fc' --commands commands.txt 0 files updated, 0 files merged, 6 files removed, 0 files unresolved adding f - abort: Make changes as needed, you may commit or record as needed now. + Make changes as needed, you may commit or record as needed now. When you are finished, run hg histedit --continue to resume. [255] $ echo f >> f