diff 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
line wrap: on
line diff
--- a/hgext/histedit.py	Sun May 11 00:49:35 2014 +0900
+++ b/hgext/histedit.py	Sun May 11 00:49:35 2014 +0900
@@ -680,11 +680,9 @@
         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(),