Patchwork [06,of,15] rebase: pass 'editform' argument to 'cmdutil.getcommiteditor'

login
register
mail settings
Submitter Katsunori FUJIWARA
Date Aug. 2, 2014, 1:02 p.m.
Message ID <533ebf02c9e1e98a5269.1406984535@feefifofum>
Download mbox | patch
Permalink /patch/5234/
State Accepted
Commit 3646716b11a7d617039dfc8b6acbbebd0519bdbd
Headers show

Comments

Katsunori FUJIWARA - Aug. 2, 2014, 1:02 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1406983586 -32400
#      Sat Aug 02 21:46:26 2014 +0900
# Node ID 533ebf02c9e1e98a526909980c8b089b945d23e0
# Parent  9e337d4198f7bfb26a45ca9e0086eaf31e1e5861
rebase: pass 'editform' argument to 'cmdutil.getcommiteditor'

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

  EXTENSION[.COMMAND][.ROUTE]

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

In this patch:

  - COMMAND is omitted
  - 'normal' and 'collapse' are used as ROUTE

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -138,7 +138,7 @@ 
     skipped = set()
     targetancestors = set()
 
-    editor = cmdutil.getcommiteditor(**opts)
+    editor = cmdutil.getcommiteditor(editform='rebase.normal', **opts)
 
     lock = wlock = None
     try:
@@ -383,7 +383,8 @@ 
                 for rebased in state:
                     if rebased not in skipped and state[rebased] > nullmerge:
                         commitmsg += '\n* %s' % repo[rebased].description()
-                editor = cmdutil.getcommiteditor(edit=True)
+                editform = 'rebase.collapse'
+                editor = cmdutil.getcommiteditor(edit=True, editform=editform)
             newrev = concludenode(repo, rev, p1, external, commitmsg=commitmsg,
                                   extrafn=extrafn, editor=editor)
             for oldrev in state.iterkeys():