Mercurial > hg
comparison hgext/histedit.py @ 21409:37a3ac247c0d
histedit: use "getcommiteditor()" instead of explicit editor choice for "--continue"
This omits (redundant) adding "\n' to "message", because:
- empty line is inserted by "commitforceeditor", if editor is invoked
- tail white-spaces are stripped at storing into chaneglog, otherwise
This patch also enhances "test-histedit-edit.t", because "hg histedit"
hasn't been explicitly tested around editor invocation and
"--continue" option.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Sun, 11 May 2014 00:49:35 +0900 |
parents | 6a48713cb72e |
children | 503bb3af70fe |
comparison
equal
deleted
inserted
replaced
21408:6a48713cb72e | 21409:37a3ac247c0d |
---|---|
678 if m or a or r or d: | 678 if m or a or r or d: |
679 # prepare the message for the commit to comes | 679 # prepare the message for the commit to comes |
680 if action in ('f', 'fold'): | 680 if action in ('f', 'fold'): |
681 message = 'fold-temp-revision %s' % currentnode | 681 message = 'fold-temp-revision %s' % currentnode |
682 else: | 682 else: |
683 message = ctx.description() + '\n' | 683 message = ctx.description() |
684 if action in ('e', 'edit', 'm', 'mess'): | 684 editopt = action in ('e', 'edit', 'm', 'mess') |
685 editor = cmdutil.commitforceeditor | 685 editor = cmdutil.getcommiteditor(edit=editopt) |
686 else: | |
687 editor = False | |
688 commit = commitfuncfor(repo, ctx) | 686 commit = commitfuncfor(repo, ctx) |
689 new = commit(text=message, user=ctx.user(), | 687 new = commit(text=message, user=ctx.user(), |
690 date=ctx.date(), extra=ctx.extra(), | 688 date=ctx.date(), extra=ctx.extra(), |
691 editor=editor) | 689 editor=editor) |
692 if new is not None: | 690 if new is not None: |