diff tests/test-commit-amend.t @ 18198:9b4adaef0db9 stable

amend: prevent loss of bookmark on failed amend The active bookmark were moved to the temporary commit. When the transaction were rollbacked, the bookmark were lost. We now temporarly disable the bookmark to prevent this effect.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Sun, 30 Dec 2012 03:49:15 +0100
parents 153659e86a5f
children 2c1276825e93
line wrap: on
line diff
--- a/tests/test-commit-amend.t	Sat Dec 29 18:00:18 2012 +0100
+++ b/tests/test-commit-amend.t	Sun Dec 30 03:49:15 2012 +0100
@@ -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