# HG changeset patch # User Matt Mackall # Date 1397502842 14400 # Node ID 76f68595ff8e5616a79dd79e962a97cc9ba58713 # Parent 25ee5dbebc6b804baef179e1126ced988b3dfa04# Parent a0f437e2f5a900fccd7812e66ce27b68a6ac4fad merge with stable diff -r 25ee5dbebc6b -r 76f68595ff8e hgext/histedit.py --- a/hgext/histedit.py Tue Nov 26 03:18:56 2013 +0100 +++ b/hgext/histedit.py Mon Apr 14 15:14:02 2014 -0400 @@ -404,6 +404,7 @@ _('Fix up the change and run hg histedit --continue')) message = oldctx.description() + '\n' message = ui.edit(message, ui.username()) + repo.savecommitmessage(message) commit = commitfuncfor(repo, oldctx) new = commit(text=message, user=oldctx.user(), date=oldctx.date(), extra=oldctx.extra()) diff -r 25ee5dbebc6b -r 76f68595ff8e tests/test-histedit-edit.t --- a/tests/test-histedit-edit.t Tue Nov 26 03:18:56 2013 +0100 +++ b/tests/test-histedit-edit.t Mon Apr 14 15:14:02 2014 -0400 @@ -189,6 +189,49 @@ modify the message + +check saving last-message.txt, at first + + $ cat > $TESTTMP/commitfailure.py < from mercurial import util + > def reposetup(ui, repo): + > class commitfailure(repo.__class__): + > def commit(self, *args, **kwargs): + > raise util.Abort('emulating unexpected abort') + > repo.__class__ = commitfailure + > EOF + $ cat > .hg/hgrc < [extensions] + > commitfailure = $TESTTMP/commitfailure.py + > EOF + + $ cat > $TESTTMP/editor.sh < echo "==== before editing" + > cat \$1 + > echo "====" + > echo "check saving last-message.txt" >> \$1 + > EOF + $ rm -f .hg/last-message.txt + $ HGEDITOR="sh $TESTTMP/editor.sh" hg histedit tip --commands - 2>&1 << EOF | fixbundle + > mess 1fd3b2fe7754 f + > EOF + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + ==== before editing + f + ==== + abort: emulating unexpected abort + $ cat .hg/last-message.txt + f + check saving last-message.txt + + $ cat > .hg/hgrc < [extensions] + > commitfailure = ! + > EOF + $ hg histedit --abort -q + +then, check "modify the message" itself + $ hg histedit tip --commands - 2>&1 << EOF | fixbundle > mess 1fd3b2fe7754 f > EOF