changeset 1140:b7d85cd8ec7b

amend: allow the --logfile argument to work properly Though documented to work, using --logfile previously set the message option to that of the parent commit, and cause amend to abort with this message: abort: options --message and --logfile are mutually exclusive It's not clear why the 'edit' option is popped, but this option is only fetched in order to let the core commit command do the work.
author Matt Harbison <matt_harbison@yahoo.com>
date Sat, 25 Oct 2014 22:25:42 -0400
parents 07ccf868dfe1
children ca17770d2ee9
files README hgext/evolve.py tests/test-amend.t
diffstat 3 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/README	Wed Oct 22 15:05:54 2014 -0700
+++ b/README	Sat Oct 25 22:25:42 2014 -0400
@@ -57,6 +57,10 @@
 Changelog
 =========
 
+5.0.1 --
+
+- amend: fix --logfile argument
+
 5.0.0 -- 2014-10-22
 
 - drop compat with Mercurial pre 3.2
--- a/hgext/evolve.py	Wed Oct 22 15:05:54 2014 -0700
+++ b/hgext/evolve.py	Sat Oct 25 22:25:42 2014 -0400
@@ -1825,8 +1825,9 @@
     """
     opts = opts.copy()
     edit = opts.pop('edit', False)
+    log = opts.get('logfile')
     opts['amend'] = True
-    if not (edit or opts['message']):
+    if not (edit or opts['message'] or log):
         opts['message'] = repo['.'].description()
     _resolveoptions(ui, opts)
     _alias, commitcmd = cmdutil.findcmd('commit', commands.table)
--- a/tests/test-amend.t	Wed Oct 22 15:05:54 2014 -0700
+++ b/tests/test-amend.t	Sat Oct 25 22:25:42 2014 -0400
@@ -97,3 +97,9 @@
   $ HGUSER=newbie hg amend -U
   $ hg parents --template '{rev}  {author}\n'
   7  newbie
+
+Check that --logfile works
+  $ echo "logfile message" > logfile.txt
+  $ hg amend -l logfile.txt
+  $ hg log -r . -T "{desc}\n"
+  logfile message