tests/test-hook
changeset 8907 e9ef409e6399
parent 4659 7a7d4937272b
child 9014 87c05a78e588
equal deleted inserted replaced
8906:bb255fe7c27e 8907:e9ef409e6399
   105 
   105 
   106 # preoutgoing hook can prevent outgoing changes
   106 # preoutgoing hook can prevent outgoing changes
   107 echo 'preoutgoing.forbid = python ../printenv.py preoutgoing.forbid 1' >> ../a/.hg/hgrc
   107 echo 'preoutgoing.forbid = python ../printenv.py preoutgoing.forbid 1' >> ../a/.hg/hgrc
   108 hg pull ../a
   108 hg pull ../a
   109 
   109 
       
   110 # outgoing hooks work for local clones
       
   111 cd ..
       
   112 echo '[hooks]' > a/.hg/hgrc
       
   113 echo 'preoutgoing = python ../printenv.py preoutgoing' >> a/.hg/hgrc
       
   114 echo 'outgoing = python ../printenv.py outgoing' >> a/.hg/hgrc
       
   115 hg clone a c
       
   116 rm -rf c
       
   117 
       
   118 # preoutgoing hook can prevent outgoing changes for local clones
       
   119 echo 'preoutgoing.forbid = python ../printenv.py preoutgoing.forbid 1' >> a/.hg/hgrc
       
   120 hg clone a zzz
       
   121 cd b
       
   122 
   110 cat > hooktests.py <<EOF
   123 cat > hooktests.py <<EOF
   111 from mercurial import util
   124 from mercurial import util
   112 
   125 
   113 uncallable = 0
   126 uncallable = 0
   114 
   127