Mercurial > hg > mercurial-crew-with-dirclash
comparison tests/test-hook @ 1736:50de0887bbcd
add preoutgoing and outgoing hooks.
preoutgoing lets prevent pull over http or ssh.
outgoing lets notify after pull.
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Fri, 17 Feb 2006 08:26:21 -0800 |
parents | 9488d53233b5 |
children | 7544700fd931 |
comparison
equal
deleted
inserted
replaced
1735:791405fe9991 | 1736:50de0887bbcd |
---|---|
72 # incoming changes no longer there after | 72 # incoming changes no longer there after |
73 echo '[hooks]' > .hg/hgrc | 73 echo '[hooks]' > .hg/hgrc |
74 echo 'pretxnchangegroup.forbid = echo pretxnchangegroup.forbid hook: tip=`hg -q tip`; exit 1' >> .hg/hgrc | 74 echo 'pretxnchangegroup.forbid = echo pretxnchangegroup.forbid hook: tip=`hg -q tip`; exit 1' >> .hg/hgrc |
75 hg pull ../a | 75 hg pull ../a |
76 hg -q tip | 76 hg -q tip |
77 | |
78 # outgoing hooks can see env vars | |
79 rm .hg/hgrc | |
80 echo '[hooks]' > ../a/.hg/hgrc | |
81 echo 'preoutgoing = echo preoutgoing hook: s=$HG_SOURCE' >> ../a/.hg/hgrc | |
82 echo 'outgoing = echo outgoing hook: n=$HG_NODE s=$HG_SOURCE' >> ../a/.hg/hgrc | |
83 hg pull ../a | |
84 hg undo | |
85 | |
86 # preoutgoing hook can prevent outgoing changes | |
87 echo 'preoutgoing.forbid = echo preoutgoing.forbid hook; exit 1' >> ../a/.hg/hgrc | |
88 hg pull ../a | |
89 | |
90 exit 0 |