Mercurial > hg
changeset 18934:93f3a06b2035
histedit: switch from util.Abort to util.InterventionRequired where appropriate (bc)
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Fri, 08 Feb 2013 16:27:49 -0600 |
parents | 42b620fc89e2 |
children | e5d9441ec281 |
files | hgext/histedit.py tests/test-histedit-edit.t tests/test-histedit-fold-non-commute.t tests/test-histedit-fold.t tests/test-histedit-no-change.t tests/test-histedit-non-commute-abort.t tests/test-histedit-non-commute.t tests/test-histedit-obsolete.t |
diffstat | 8 files changed, 27 insertions(+), 27 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/histedit.py Fri Feb 08 16:27:59 2013 -0600 +++ b/hgext/histedit.py Fri Feb 08 16:27:49 2013 -0600 @@ -301,8 +301,8 @@ 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 @@ 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 @@ 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)
--- a/tests/test-histedit-edit.t Fri Feb 08 16:27:59 2013 -0600 +++ b/tests/test-histedit-edit.t Fri Feb 08 16:27:49 2013 -0600 @@ -63,7 +63,7 @@ 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 @@ > 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
--- a/tests/test-histedit-fold-non-commute.t Fri Feb 08 16:27:59 2013 -0600 +++ b/tests/test-histedit-fold-non-commute.t Fri Feb 08 16:27:49 2013 -0600 @@ -91,7 +91,7 @@ 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 @@ 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
--- a/tests/test-histedit-fold.t Fri Feb 08 16:27:59 2013 -0600 +++ b/tests/test-histedit-fold.t Fri Feb 08 16:27:49 2013 -0600 @@ -182,7 +182,7 @@ 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 @@ 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
--- a/tests/test-histedit-no-change.t Fri Feb 08 16:27:59 2013 -0600 +++ b/tests/test-histedit-no-change.t Fri Feb 08 16:27:49 2013 -0600 @@ -92,7 +92,7 @@ | 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 @@ | 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
--- a/tests/test-histedit-non-commute-abort.t Fri Feb 08 16:27:59 2013 -0600 +++ b/tests/test-histedit-non-commute-abort.t Fri Feb 08 16:27:49 2013 -0600 @@ -79,7 +79,7 @@ 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
--- a/tests/test-histedit-non-commute.t Fri Feb 08 16:27:59 2013 -0600 +++ b/tests/test-histedit-non-commute.t Fri Feb 08 16:27:49 2013 -0600 @@ -92,7 +92,7 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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
--- a/tests/test-histedit-obsolete.t Fri Feb 08 16:27:59 2013 -0600 +++ b/tests/test-histedit-obsolete.t Fri Feb 08 16:27:49 2013 -0600 @@ -139,7 +139,7 @@ $ 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 @@ $ 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 @@ $ 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