Test that commit hooks are not run on interrupted commit
authorChristian Ebert <blacktrash@gmx.net>
Sat, 01 Dec 2007 10:32:40 +0100
changeset 305 d3cdaa49a644
parent 304 815dc4a04296
child 306 78b80b2511de
Test that commit hooks are not run on interrupted commit
tests/test-keyword
tests/test-keyword.out
--- a/tests/test-keyword	Sat Dec 01 09:52:00 2007 +0100
+++ b/tests/test-keyword	Sat Dec 01 10:32:40 2007 +0100
@@ -37,9 +37,19 @@
 echo % cat
 cat sym a b
 
+echo % addremove
+hg addremove
+echo % status
+hg status
+
 echo % default keyword expansion including commit hook
+echo % interrupted commit should not change state or run commit hook
+HGEDITOR=false hg --debug commit
+echo % status
+hg status
+
 echo % commit
-hg --debug commit -A -mabsym -d '0 0' -u 'User Name <user@example.com>'
+hg --debug commit -mabsym -d '0 0' -u 'User Name <user@example.com>'
 echo % status
 hg status
 echo % identify
@@ -121,7 +131,7 @@
 secondline
 EOF
 
-echo % interrupted commit
+echo % interrupted commit should not change state
 HGEDITOR=false hg commit
 echo % status
 hg status
--- a/tests/test-keyword.out	Sat Dec 01 09:52:00 2007 +0100
+++ b/tests/test-keyword.out	Sat Dec 01 10:32:40 2007 +0100
@@ -92,11 +92,27 @@
 do not process $Id:
 xxx $
 ignore $Id$
-% default keyword expansion including commit hook
-% commit
+% addremove
 adding a
 adding b
 adding sym
+% status
+A a
+A b
+A sym
+% default keyword expansion including commit hook
+% interrupted commit should not change state or run commit hook
+a
+b
+sym
+transaction abort!
+rollback completed
+abort: edit failed: false exited with status 1
+% status
+A a
+A b
+A sym
+% commit
 a
 b
 sym
@@ -193,7 +209,7 @@
 xxx $
 ignore $Id$
 a
-% interrupted commit
+% interrupted commit should not change state
 transaction abort!
 rollback completed
 abort: edit failed: false exited with status 1