tests/test-hook
changeset 1736 50de0887bbcd
parent 1734 9488d53233b5
child 1933 7544700fd931
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