Patchwork [5,of,6] qrefresh: allow to specify '--message/'--logfile' and '--edit' at the same time

mail settings
Submitter Katsunori FUJIWARA
Date May 31, 2014, 3:26 p.m.
Message ID <10efb4225739e586a7f5.1401549975@feefifofum>
Download mbox | patch
Permalink /patch/4907/
State Accepted
Headers show


Katsunori FUJIWARA - May 31, 2014, 3:26 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <>
# Date 1401548912 -32400
#      Sun Jun 01 00:08:32 2014 +0900
# Node ID 10efb4225739e586a7f5de4c1882c880c40292e0
# Parent  78dce791e39b7d0d8776b9add44ebc126a135a2f
qrefresh: allow to specify '--message/'--logfile' and '--edit' at the same time

Before this patch, 'hg qrefresh' disallows to specify
'--message/'--logfile' and '--edit' at the same time.

'hg qrefresh' has disallowed such combination since Mercurial 0.9.2,
but this restriction seems not to be reasonable for recent Mercurial,
because all other commands creating new changeset allow it.

This patch allows 'hg qrefresh' to specify '--message/'--logfile' and
'--edit' at the same time like other commands creating new changeset.


diff --git a/hgext/ b/hgext/
--- a/hgext/
+++ b/hgext/
@@ -2489,9 +2489,6 @@ 
     q =
     message = cmdutil.logmessage(ui, opts)
-    if opts.get('edit'):
-        if message:
-            raise util.Abort(_('option "-e" incompatible with "-m" or "-l"'))
     setupheaderopts(ui, opts)
     wlock = repo.wlock()
diff --git a/tests/test-mq-qrefresh-replace-log-message.t b/tests/test-mq-qrefresh-replace-log-message.t
--- a/tests/test-mq-qrefresh-replace-log-message.t
+++ b/tests/test-mq-qrefresh-replace-log-message.t
@@ -26,9 +26,19 @@ 
   First commit message
 Testing changing message with -m
+(this tests also that '--edit' can be used with '--message')
   $ echo bbbb > file
-  $ hg qrefresh -m "Second commit message"
+  $ HGEDITOR=cat hg qrefresh -m "Second commit message" -e
+  Second commit message
+  HG: Enter commit message.  Lines beginning with 'HG:' are removed.
+  HG: Leave message empty to use default message.
+  HG: --
+  HG: user: test
+  HG: branch 'default'
+  HG: added file
 Should display 'Second commit message'