Patchwork [09,of,15] backout: pass 'editform' argument to 'cmdutil.getcommiteditor'

login
register
mail settings
Submitter Katsunori FUJIWARA
Date Aug. 2, 2014, 1:02 p.m.
Message ID <6f1b80531218ad938705.1406984538@feefifofum>
Download mbox | patch
Permalink /patch/5236/
State Accepted
Commit a5bb0c4001ae49f8f90e4a48d07e0e465ef19a03
Headers show

Comments

Katsunori FUJIWARA - Aug. 2, 2014, 1:02 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1406983587 -32400
#      Sat Aug 02 21:46:27 2014 +0900
# Node ID 6f1b80531218ad9387054f47adeda39432c53b3f
# Parent  9de2c0a507e9f4159e5700b144d98602ae3f8934
backout: pass 'editform' argument to 'cmdutil.getcommiteditor'

This patch passes 'editform' argument according to the format below:

  COMMAND[.ROUTE]

  - ROUTE: name of route, if there are two or more routes in COMMAND

In this patch, ROUTE is omitted..

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -505,11 +505,12 @@ 
 
 
         def commitfunc(ui, repo, message, match, opts):
-            e = cmdutil.getcommiteditor(**opts)
+            editform = 'backout'
+            e = cmdutil.getcommiteditor(editform=editform, **opts)
             if not message:
                 # we don't translate commit messages
                 message = "Backed out changeset %s" % short(node)
-                e = cmdutil.getcommiteditor(edit=True)
+                e = cmdutil.getcommiteditor(edit=True, editform=editform)
             return repo.commit(message, opts.get('user'), opts.get('date'),
                                match, editor=e)
         newnode = cmdutil.commit(ui, repo, commitfunc, [], opts)