diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py index 2142691be14fc4a9049c6e209c1933bd2ed847b0_bWVyY3VyaWFsL2NtZHV0aWwucHk=..034e55bbf7c062c4a50e9f3faa911db70a223c84_bWVyY3VyaWFsL2NtZHV0aWwucHk= 100644 --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -1611,6 +1611,10 @@ # See if we got a message from -m or -l, if not, open the editor # with the message of the changeset to amend message = logmessage(ui, opts) + # ensure logfile does not conflict with later enforcement of the + # message. potential logfile content has been processed by + # `logmessage` anyway. + opts.pop('logfile') # First, do a regular commit to record all changes in the working # directory (if there are any) ui.callhooks = False diff --git a/tests/test-commit-amend.t b/tests/test-commit-amend.t index 2142691be14fc4a9049c6e209c1933bd2ed847b0_dGVzdHMvdGVzdC1jb21taXQtYW1lbmQudA==..034e55bbf7c062c4a50e9f3faa911db70a223c84_dGVzdHMvdGVzdC1jb21taXQtYW1lbmQudA== 100644 --- a/tests/test-commit-amend.t +++ b/tests/test-commit-amend.t @@ -65,5 +65,6 @@ saved backup bundle to $TESTTMP/.hg/strip-backup/43f1ba15f28a-amend-backup.hg (glob) Remove file that was added in amended commit: +(and test logfile option) $ hg rm b @@ -68,6 +69,7 @@ $ hg rm b - $ hg ci --amend -m 'amend base1 remove new file' + $ echo 'amend base1 remove new file' > ../logfile + $ hg ci --amend -l ../logfile saved backup bundle to $TESTTMP/.hg/strip-backup/b8e3cb2b3882-amend-backup.hg (glob) $ hg cat b