diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py index 153659e86a5f441cc04544f71a34715bc161c28f_bWVyY3VyaWFsL2NtZHV0aWwucHk=..9b4adaef0db9809973d45e252b1bd8f1b7648b69_bWVyY3VyaWFsL2NtZHV0aWwucHk= 100644 --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -1635,4 +1635,5 @@ # First, do a regular commit to record all changes in the working # directory (if there are any) ui.callhooks = False + currentbookmark = repo._bookmarkcurrent try: @@ -1638,4 +1639,5 @@ try: + repo._bookmarkcurrent = None opts['message'] = 'temporary amend commit for %s' % old node = commit(ui, repo, commitfunc, pats, opts) finally: @@ -1639,6 +1641,7 @@ opts['message'] = 'temporary amend commit for %s' % old node = commit(ui, repo, commitfunc, pats, opts) finally: + repo._bookmarkcurrent = currentbookmark ui.callhooks = True ctx = repo[node] diff --git a/tests/test-commit-amend.t b/tests/test-commit-amend.t index 153659e86a5f441cc04544f71a34715bc161c28f_dGVzdHMvdGVzdC1jb21taXQtYW1lbmQudA==..9b4adaef0db9809973d45e252b1bd8f1b7648b69_dGVzdHMvdGVzdC1jb21taXQtYW1lbmQudA== 100644 --- a/tests/test-commit-amend.t +++ b/tests/test-commit-amend.t @@ -243,6 +243,24 @@ book1 1:48bb6e53a15f * book2 1:48bb6e53a15f +abort does not loose bookmarks + + $ cat > editor.sh << '__EOF__' + > #!/bin/sh + > echo "" > "$1" + > __EOF__ + $ echo a >> a + $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend + transaction abort! + rollback completed + abort: empty commit message + [255] + $ hg book + book1 1:48bb6e53a15f + * book2 1:48bb6e53a15f + $ hg revert -Caq + $ rm editor.sh + $ echo '[defaults]' >> $HGRCPATH $ echo "commit=-d '0 0'" >> $HGRCPATH