diff hgext/histedit.py @ 21407:47bfe5d433ac

histedit: use the editor gotten by "getcommiteditor()" for "message" Before this patch, "hg histedit" for "message" uses "ui.edit()" for commit message editing. It shows original commit message, but not detail about the target revision: status of each modified/added/removed files, for example. This patch uses the editor gotten by "getcommiteditor()" instead of "ui.edit()" for "message" In "test-histedit-edit.t", this patch omits "fixbundle" invocation, because it prevents from confirming the "HG: added f" line in commit message by filtering " added " lines. Omiting "fixbundle" invocation causes that the exit code of "hg histedit" appears as one of command line: in this case, "hg histedit" is aborted by (expected) exception raising.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Sun, 11 May 2014 00:49:35 +0900
parents 19d98da5c018
children 6a48713cb72e
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
@@ -402,11 +402,10 @@
         raise error.InterventionRequired(
             _('Fix up the change and run hg histedit --continue'))
     message = oldctx.description()
-    def editor(repo, ctx, subs):
-        return ui.edit(ctx.description() + "\n", ctx.user())
     commit = commitfuncfor(repo, oldctx)
     new = commit(text=message, user=oldctx.user(), date=oldctx.date(),
-                 extra=oldctx.extra(), editor=editor)
+                 extra=oldctx.extra(),
+                 editor=cmdutil.getcommiteditor(edit=True))
     newctx = repo[new]
     if oldctx.node() != newctx.node():
         return newctx, [(oldctx.node(), (new,))]