diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -376,6 +376,8 @@ def rebase(ui, repo, **opts): if collapsef and not keepopen: p1, p2 = defineparents(repo, min(state), target, state, targetancestors) + editopt = opts.get('edit') + editform = 'rebase.collapse' if collapsemsg: commitmsg = collapsemsg else: @@ -383,8 +385,8 @@ def rebase(ui, repo, **opts): for rebased in state: if rebased not in skipped and state[rebased] > nullmerge: commitmsg += '\n* %s' % repo[rebased].description() - editform = 'rebase.collapse' - editor = cmdutil.getcommiteditor(edit=True, editform=editform) + editopt = True + editor = cmdutil.getcommiteditor(edit=editopt, editform=editform) newrev = concludenode(repo, rev, p1, external, commitmsg=commitmsg, extrafn=extrafn, editor=editor) for oldrev in state.iterkeys(): diff --git a/tests/test-rebase-collapse.t b/tests/test-rebase-collapse.t --- a/tests/test-rebase-collapse.t +++ b/tests/test-rebase-collapse.t @@ -148,7 +148,12 @@ Rebasing G onto H with custom message: abort: message can only be specified with collapse [255] - $ hg rebase --source 4 --collapse -m 'custom message' + $ cat > $TESTTMP/checkeditform.sh < env | grep HGEDITFORM + > true + > EOF + $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg rebase --source 4 --collapse -m 'custom message' -e + HGEDITFORM=rebase.collapse saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob) $ hg tglog