# HG changeset patch # User Martin von Zweigbergk # Date 1587418630 25200 # Node ID c6d31e659a28eac8193229a385c237489494a10d # Parent f44a7d8660eacbe7c99361138141aab1d2f7b722 commit: tell user what to do with .hg/last-message.txt I have always assumed that the message will be reused by the next `hg commit`, but it seems it's just silently dropped on the next commit. Let's try to be more helpful by telling the user that they have to manually tell hg to reuse it. The file will still be lost if the user runs some other operation in between (like a non-in-memory rebase). That will be fixed once we've switched all operations to be in-memory :) I didn't include `$(hg root)/` in the path in the message to the user because that would have made the message too long. Hopefully the user will figure that part out themselves. Differential Revision: https://phab.mercurial-scm.org/D8463 diff -r f44a7d8660ea -r c6d31e659a28 mercurial/localrepo.py --- a/mercurial/localrepo.py Fri Apr 17 19:35:18 2020 +0900 +++ b/mercurial/localrepo.py Mon Apr 20 14:37:10 2020 -0700 @@ -3016,6 +3016,12 @@ self.ui.write( _(b'note: commit message saved in %s\n') % msgfn ) + self.ui.write( + _( + b"note: use 'hg commit --logfile " + b".hg/last-message.txt --edit' to reuse it\n" + ) + ) raise def commithook(unused_success): diff -r f44a7d8660ea -r c6d31e659a28 tests/test-histedit-edit.t --- a/tests/test-histedit-edit.t Fri Apr 17 19:35:18 2020 +0900 +++ b/tests/test-histedit-edit.t Mon Apr 20 14:37:10 2020 -0700 @@ -373,6 +373,7 @@ transaction abort! rollback completed note: commit message saved in .hg/last-message.txt + note: use 'hg commit --logfile .hg/last-message.txt --edit' to reuse it abort: pretxncommit.unexpectedabort hook exited with status 1 [255] $ cat .hg/last-message.txt @@ -397,6 +398,7 @@ transaction abort! rollback completed note: commit message saved in .hg/last-message.txt + note: use 'hg commit --logfile .hg/last-message.txt --edit' to reuse it abort: pretxncommit.unexpectedabort hook exited with status 1 [255] diff -r f44a7d8660ea -r c6d31e659a28 tests/test-mq-qfold.t --- a/tests/test-mq-qfold.t Fri Apr 17 19:35:18 2020 +0900 +++ b/tests/test-mq-qfold.t Mon Apr 20 14:37:10 2020 -0700 @@ -230,6 +230,7 @@ HG: changed a ==== note: commit message saved in .hg/last-message.txt + note: use 'hg commit --logfile .hg/last-message.txt --edit' to reuse it transaction abort! rollback completed qrefresh interrupted while patch was popped! (revert --all, qpush to recover) diff -r f44a7d8660ea -r c6d31e659a28 tests/test-mq-qnew.t --- a/tests/test-mq-qnew.t Fri Apr 17 19:35:18 2020 +0900 +++ b/tests/test-mq-qnew.t Mon Apr 20 14:37:10 2020 -0700 @@ -308,6 +308,7 @@ transaction abort! rollback completed note: commit message saved in .hg/last-message.txt + note: use 'hg commit --logfile .hg/last-message.txt --edit' to reuse it abort: pretxncommit.unexpectedabort hook exited with status 1 [255] $ cat .hg/last-message.txt diff -r f44a7d8660ea -r c6d31e659a28 tests/test-mq-qrefresh-replace-log-message.t --- a/tests/test-mq-qrefresh-replace-log-message.t Fri Apr 17 19:35:18 2020 +0900 +++ b/tests/test-mq-qrefresh-replace-log-message.t Mon Apr 20 14:37:10 2020 -0700 @@ -186,6 +186,7 @@ HG: added file2 ==== note: commit message saved in .hg/last-message.txt + note: use 'hg commit --logfile .hg/last-message.txt --edit' to reuse it transaction abort! rollback completed qrefresh interrupted while patch was popped! (revert --all, qpush to recover) @@ -229,6 +230,7 @@ A file2 ==== note: commit message saved in .hg/last-message.txt + note: use 'hg commit --logfile .hg/last-message.txt --edit' to reuse it transaction abort! rollback completed qrefresh interrupted while patch was popped! (revert --all, qpush to recover) diff -r f44a7d8660ea -r c6d31e659a28 tests/test-rollback.t --- a/tests/test-rollback.t Fri Apr 17 19:35:18 2020 +0900 +++ b/tests/test-rollback.t Mon Apr 20 14:37:10 2020 -0700 @@ -116,6 +116,7 @@ transaction abort! rollback completed note: commit message saved in .hg/last-message.txt + note: use 'hg commit --logfile .hg/last-message.txt --edit' to reuse it abort: pretxncommit hook exited with status * (glob) [255] $ cat .hg/last-message.txt diff -r f44a7d8660ea -r c6d31e659a28 tests/test-tag.t --- a/tests/test-tag.t Fri Apr 17 19:35:18 2020 +0900 +++ b/tests/test-tag.t Mon Apr 20 14:37:10 2020 -0700 @@ -323,6 +323,7 @@ transaction abort! rollback completed note: commit message saved in .hg/last-message.txt + note: use 'hg commit --logfile .hg/last-message.txt --edit' to reuse it abort: pretxncommit.unexpectedabort hook exited with status 1 [255] $ cat .hg/last-message.txt