tests/test-hook
changeset 1736 50de0887bbcd
parent 1734 9488d53233b5
child 1933 7544700fd931
--- a/tests/test-hook	Thu Feb 16 14:34:59 2006 -0800
+++ b/tests/test-hook	Fri Feb 17 08:26:21 2006 -0800
@@ -74,3 +74,17 @@
 echo 'pretxnchangegroup.forbid = echo pretxnchangegroup.forbid hook: tip=`hg -q tip`; exit 1' >> .hg/hgrc
 hg pull ../a
 hg -q tip
+
+# outgoing hooks can see env vars
+rm .hg/hgrc
+echo '[hooks]' > ../a/.hg/hgrc
+echo 'preoutgoing = echo preoutgoing hook: s=$HG_SOURCE' >> ../a/.hg/hgrc
+echo 'outgoing = echo outgoing hook: n=$HG_NODE s=$HG_SOURCE' >> ../a/.hg/hgrc
+hg pull ../a
+hg undo
+
+# preoutgoing hook can prevent outgoing changes
+echo 'preoutgoing.forbid = echo preoutgoing.forbid hook; exit 1' >> ../a/.hg/hgrc
+hg pull ../a
+
+exit 0