diff tests/test-push-warn.t @ 29129:e6dfb0e4eeef

dispatch: add fail-* family of hooks The post-* family of hooks will not run in case a command fails (i.e. raises an exception). This makes it inconvenient to hook into events such as doing something in case of a failed push. We catch all exceptions to run the failure hook. I am not sure if this is too aggressive, but tests apparently pass.
author Jordi Guti?rrez Hermoso <jordigh@octave.org>
date Thu, 28 Apr 2016 10:37:47 -0400
parents 29cfc474c5fd
children 7eb9ee3e6b14
line wrap: on
line diff
--- a/tests/test-push-warn.t	Fri May 06 22:21:32 2016 +0530
+++ b/tests/test-push-warn.t	Thu Apr 28 10:37:47 2016 -0400
@@ -785,4 +785,14 @@
   no changes found
   [1]
 
+Test fail hook
+
+  $ hg push inner --config hooks.fail-push="echo running fail-push hook"
+  pushing to inner
+  searching for changes
+  running fail-push hook
+  abort: push creates new remote head 7d0f4fb6cf04 on branch 'A'!
+  (merge or see "hg help push" for details about pushing new heads)
+  [255]
+
   $ cd ..