Bug 3675 - Nonsensical error from commit --amend --logfile
Summary: Nonsensical error from commit --amend --logfile
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: earlier
Hardware: All All
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-22 20:15 UTC by Bryan O'Sullivan
Modified: 2017-11-01 18:05 UTC (History)
6 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bryan O'Sullivan 2012-10-22 20:15 UTC
Repro:

  hg init a
  cd a
  echo a>a
  hg ci -Ama

  echo a>>a

  echo msg > msg.txt
  hg ci --amend --logfile msg.txt

Error message:

  abort: options --message and --logfile are mutually exclusive
Comment 1 David Soria Parra 2012-10-22 20:35 UTC
the temporary commit in cmdutil.amend (line 1619 in 2.4-rc+10-6da47b655d97) overwrites opts['message']. Therefore if logfile is specified the temporary commit fails as commit calls cmdutil.logmessage which checks for --message and --logfile.

also cmdutil.amend always forces an editor anyway.
Comment 2 Idan Kamara 2012-10-23 06:42 UTC
bisect says:

The first bad revision is:
changeset:   17473:9732473aa24b
user:        Pierre-Yves David <pierre-yves.david@logilab.fr>
date:        Sat Aug 25 16:20:41 2012 +0200
summary:     amend: use an explicit commit message for temporary amending commit
Comment 3 Pierre-Yves David 2012-10-23 11:31 UTC
I'll tackle this soon.
Comment 4 HG Bot 2012-10-24 18:43 UTC
Fixed by http://selenic.com/repo/hg/rev/034e55bbf7c0
Pierre-Yves David <pierre-yves.david@logilab.fr>
amend: fix incompatibity between logfile and message option (issue3675)

Bug introduced by 9732473aa24b

(please test the fix)