tests/test-hook.t
branchstable
changeset 27924 24361fb68cba
parent 27739 d6d3cf5fda6f
child 28079 0c9e914029be
--- a/tests/test-hook.t	Wed Jan 20 22:39:51 2016 -0600
+++ b/tests/test-hook.t	Tue Jan 19 15:18:21 2016 -0800
@@ -724,3 +724,25 @@
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     b
   
+  $ cd ..
+
+pretxnclose hook failure should abort the transaction
+
+  $ hg init txnfailure
+  $ cd txnfailure
+  $ touch a && hg commit -Aqm a
+  $ cat >> .hg/hgrc <<EOF
+  > [hooks]
+  > pretxnclose.error = exit 1
+  > EOF
+  $ hg strip -r 0 --config extensions.strip=
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  saved backup bundle to * (glob)
+  transaction abort!
+  rollback completed
+  strip failed, full bundle stored in * (glob)
+  abort: pretxnclose.error hook exited with status 1
+  [255]
+  $ hg recover
+  no interrupted transaction available
+  [1]