diff --git a/hgext/histedit.py b/hgext/histedit.py --- a/hgext/histedit.py +++ b/hgext/histedit.py @@ -680,11 +680,9 @@ def bootstrapcontinue(ui, repo, parentct if action in ('f', 'fold'): message = 'fold-temp-revision %s' % currentnode else: - message = ctx.description() + '\n' - if action in ('e', 'edit', 'm', 'mess'): - editor = cmdutil.commitforceeditor - else: - editor = False + message = ctx.description() + editopt = action in ('e', 'edit', 'm', 'mess') + editor = cmdutil.getcommiteditor(edit=editopt) commit = commitfuncfor(repo, ctx) new = commit(text=message, user=ctx.user(), date=ctx.date(), extra=ctx.extra(), 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 @@ -156,7 +156,19 @@ check histedit_source update: 1 new changesets (update) hist: 1 remaining (histedit --continue) - $ HGEDITOR='true' hg histedit --continue +(test also that editor is invoked if histedit is continued for +"edit" action) + + $ HGEDITOR='cat' hg histedit --continue + f + + + HG: Enter commit message. Lines beginning with 'HG:' are removed. + HG: Leave message empty to abort commit. + HG: -- + HG: user: test + HG: branch 'default' + HG: added f 0 files updated, 0 files merged, 0 files removed, 0 files unresolved saved backup bundle to $TESTTMP/r/.hg/strip-backup/b5f70786f9b0-backup.hg (glob) @@ -271,6 +283,25 @@ check saving last-message.txt, at first check saving last-message.txt +(test also that editor is invoked if histedit is continued for "message" +action) + + $ HGEDITOR=cat hg histedit --continue + f + + + HG: Enter commit message. Lines beginning with 'HG:' are removed. + HG: Leave message empty to abort commit. + HG: -- + HG: user: test + HG: branch 'default' + HG: added f + transaction abort! + rollback completed + note: commit message saved in .hg/last-message.txt + abort: pretxncommit.unexpectedabort hook exited with status 1 + [255] + $ cat >> .hg/hgrc < [hooks] > pretxncommit.unexpectedabort =