
foozy@708: \chapter{Handling repository events with hooks}
foozy@708: \label{chap:hook}
foozy@708: 
foozy@708: Mercurial $B$O!"%j%]%8%H%j$KH/@8$7$?%$%Y%s%H$K1~$8$F!"(B
foozy@708: $B<+F0E*$J=hM}$r<B9T$9$k6/NO$J;EAH$_$rDs6!$7$F$$$^$9!#(B
foozy@708: $B4v$D$+$N>u67$G$O!"(B
foozy@708: $B%$%Y%s%H$KBP$9$k(B Mercurial $B$N1~Ez7k2L$r@)8f$9$k$3$H$b$G$-$^$9!#(B
foozy@708: 
foozy@708: Mercurial $B$,MxMQ$9$k$3$l$i$N=hM}$O!"(B
foozy@708: \emph{$B%U%C%/(B}$B!J(Bhook$B!K$H8F$P$l$F$$$^$9!#(B
foozy@708: $B9=@.4IM}%7%9%F%`$K$h$C$F$O%U%C%/$r(B``$B%H%j%,(B''$B$H8F$V$3$H$b$"$j$^$9$,!"(B
foozy@708: $B$3$l$i$O6&$KF1$89M$(J}$r;X$7$^$9!#(B
foozy@708: 
foozy@708: \section{An overview of hooks in Mercurial}
foozy@708: 
foozy@708: Mercurial $B$,Ds6!$9$k%U%C%/$N4JC1$J%j%9%H$r<($7$^$9!#(B
foozy@708: $B$3$l$i$N%U%C%/$K4X$9$k>\:Y$O(B \ref{sec:hook:ref}~$B@a$G@bL@$7$^$9!#(B
foozy@708: 
foozy@708: \begin{description}
foozy@708: 
foozy@708: \item[\small\hook{changegroup}]
foozy@708:   $B30It%j%]%8%H%j$+$i%A%'%s%8%;%C%H72$,;}$A9~$^$l$?8e$K<B9T$5$l$^$9!#(B
foozy@708: 
foozy@708: \item[\small\hook{commit}] 
foozy@708:   $B%m!<%+%k%j%]%8%H%j$K$*$$$F?7$?$J%A%'%s%8%;%C%H$,:n@.$5$l$?8e$K<B9T$5$l$^$9!#(B
foozy@708: 
foozy@708: \item[\small\hook{incoming}] 
foozy@708:   $B30It%j%]%8%H%j$+$i;}$A9~$^$l$??7$?$J%A%'%s%8%;%C%HKh$K#12s$E$D<B9T$5$l$^$9!#(B
foozy@708:   $B;}$A9~$^$l$?%A%'%s%8%;%C%H$N(B\emph{$B$^$H$^$j(B}$B$NC10L$G5/F0$5$l$k(B
foozy@708:   \hook{changegroup} $B$H$N0c$$$KCm0U$7$F$/$@$5$$!#(B
foozy@708: 
foozy@708: \item[\small\hook{outgoing}] 
foozy@708:   $B30It%j%]%8%H%j$X%A%'%s%8%;%C%H72$,E>Aw$5$l$?8e$K<B9T$5$l$^$9!#(B
foozy@708: 
foozy@708: \item[\small\hook{prechangegroup}] 
foozy@708:   $B30It%j%]%8%H%j$+$i%A%'%s%8%;%C%H72$,;}$A9~$^$l$kA0$K<B9T$5$l$^$9!#(B
foozy@708: 
foozy@708: \item[\small\hook{precommit}] 
foozy@708:   $B@)8fMQ!#(B
foozy@708:   $B%m!<%+%k%j%]%8%H%j$X$N%3%_%C%HA0$K<B9T$5$l$^$9!#(B
foozy@708: 
foozy@708: \item[\small\hook{preoutgoing}] 
foozy@708:   $B@)8fMQ!#(B
foozy@708:   $B30It%j%]%8%H%j$X%A%'%s%8%;%C%H72$,E>Aw$5$l$kA0$K<B9T$5$l$^$9!#(B
foozy@708: 
foozy@708: \item[\small\hook{pretag}] 
foozy@708:   $B@)8fMQ!#%?%0@8@.A0$K<B9T$5$l$^$9!#(B
foozy@708: 
foozy@708: \item[\small\hook{pretxnchangegroup}] 
foozy@708:   $B@)8fMQ!#(B
foozy@708:   $B30It$+$i%m!<%+%k%j%]%8%H%j$X$H%A%'%s%8%;%C%H72$,;}$A9~$^$l$?:]$K!"(B
foozy@708:   $BJQ99$r915WE*$J$b$N$K$9$k%H%i%s%6%/%7%g%s$,40N;$9$kA0$K<B9T$5$l$^$9!#(B
foozy@708: 
foozy@708: \item[\small\hook{pretxncommit}] 
foozy@708:   $B@)8fMQ!#(B
foozy@708:   $B%m!<%+%k%j%]%8%H%j$K$*$$$F?7$?$J%A%'%s%8%;%C%H$,:n@.$5$l$?:]$K!"(B
foozy@708:   $BJQ99$r915WE*$J$b$N$K$9$k%H%i%s%6%/%7%g%s$,40N;$9$kA0$K<B9T$5$l$^$9!#(B
foozy@708: 
foozy@708: \item[\small\hook{preupdate}] 
foozy@708:   $B@)8fMQ!#(B
foozy@708:   $B:n6HNN0h%G%#%l%/%H%j$N99?7!&%^!<%8$,<B;\$5$l$kA0$K<B9T$5$l$^$9!#(B
foozy@708: 
foozy@708: \item[\small\hook{tag}] 
foozy@708:   $B%?%0$,@8@.$5$l$?8e$K<B9T$5$l$^$9!#(B
foozy@708: 
foozy@708: \item[\small\hook{update}] 
foozy@708:   $B:n6HNN0h%G%#%l%/%H%j$N99?7!&%^!<%8$,40N;$7$?8e$K<B9T$5$l$^$9!#(B
foozy@708: 
foozy@708: \end{description}
foozy@708: 
foozy@708: ``$B@)8fMQ(B''$B$H=q$+$l$F$$$k%U%C%/$O!"(B
foozy@708: $B=hM}$N7QB3@-$N2DH]$rH=Dj$9$k5!G=$r;}$C$F$$$^$9!#(B
foozy@708: $B%U%C%/$N<B9T$,@.8y$7$?>l9g!"(B
foozy@708: $B%U%C%/$KBP1~$9$k=hM}$O7QB3$5$l$^$9$,!"(B
foozy@708: $B%U%C%/$N<B9T$,<:GT$7$?>l9g!"(B
foozy@708: $BBP1~$9$k=hM}$O5v2D$5$l$J$$$+<B9T$7$J$+$C$?$3$H$K$J$j$^$9(B
foozy@708: $B!J$I$A$i$K$J$k$+$O%U%C%/$K1~$8$F7h$^$j$^$9!K!#(B
foozy@708: 
foozy@708: \section{Hooks and security}
foozy@708: 
foozy@708: \subsection{Hooks are run with your privileges}
foozy@708: 
foozy@708: $B%j%]%8%H%j$K$*$$$F(B Mercurial $B$N%3%^%s%I$r<B9T$7!"(B
foozy@708: $B$=$N%3%^%s%I$,%U%C%/$r5/F0$9$k$3$H$K$J$C$?>l9g!"(B
foozy@708: \emph{$B%3%^%s%I<B9T<T$N(B}$B%7%9%F%`>e$K$*$$$F!"(B
foozy@708: \emph{$B%3%^%s%I<B9T<T$N(B}$B%f!<%6%"%+%&%s%H$K$h$j!"(B
foozy@708: \emph{$B%3%^%s%I<B9T<T$N(B}$B8"8B%l%Y%k$G<B9T$5$l$^$9!#(B
foozy@708: $B%U%C%/$OG$0U$N<B9T%3!<%I$G$9$+$i!"(B
foozy@708: $B==J,$JG[N8$r;}$C$F07$&I,MW$,$"$j$^$9!#(B
foozy@708: $BC/$,:n@.$7$F2?$r$9$k%U%C%/$J$N$+$r=OCN$7$F$$$k3N?.L5$7$K!"(B
foozy@708: $B%U%C%/$r%$%s%9%H!<%k$7$J$$$G$/$@$5$$!#(B
foozy@708: 
foozy@708: $B;~$K$O!"(B
foozy@708: $B<+J,$G%$%s%9%H!<%k$7$?$N$G$O$J$$%U%C%/$K;/$5$l$k$+$b$7$l$^$;$s!#(B
foozy@708: $BFk@w$_$NL5$$%7%9%F%`>e$G(B Mercurial $B$r;HMQ$9$k:]$K$O!"(B
foozy@708: Mercurial $B$,%7%9%F%`6&DL$N(B \hgrc\ 
foozy@708: $B%U%!%$%k$GDj5A$5$l$?%U%C%/$r<B9T$9$k$+$b$7$l$^$;$s!#(B
foozy@708: 
foozy@708: $BB>$N%f!<%6$,=jM-$9$k%j%]%8%H%j$G:n6H$9$k>l9g!"(B
foozy@708: Mercurial $B$O$=$N%f!<%6$N%j%]%8%H%j$GDj5A$5$l$?%U%C%/$r<B9T$G$-$^$9$,!"(B
foozy@708: $B$=$l$O(B``$B$"$J$?$N(B''$B8"8B$G<B9T$5$l$^$9!#(B
foozy@708: $BNc$($P!"$"$k%j%]%8%H%j$+$i(B \hgcmd{pull} $B$7$?:]$K!"(B
foozy@708: $B$=$N%j%]%8%H%j$N(B \sfilename{.hg/hgrc} $B%U%!%$%k$,(B
foozy@708: \hook{outgoing} $B%U%C%/$rDj5A$7$F$$$?>l9g!"(B
foozy@708: $B%j%b!<%H%j%]%8%H%j$N=jM-<T$GL5$+$C$?$H$7$F$b!"(B
foozy@708: $B%U%C%/$O$"$J$?$N%"%+%&%s%H$G<B9T$5$l$^$9!#(B
foozy@708: 
foozy@708: \begin{note}
foozy@708:   $B$3$N86B'$O!"(B
foozy@708:   $B%m!<%+%k%U%!%$%k%7%9%F%`$+%M%C%H%o!<%/%U%!%$%k%7%9%F%`>e$N%j%]%8%H%j$+$i(B
foozy@708:   pull $B$7$?>l9g$K$N$_E,MQ$5$l$^$9!#(B
foozy@708:   http $B$d(B ssh $B7PM3$G(B pull $B$7$?>l9g!"(B
foozy@708:   $B%U%C%/$,<B9T$5$l$k:]$N%"%+%&%s%H$O!"(B
foozy@708:   $B%5!<%P>e$G%5!<%P%W%m%;%9$r<B9T$9$k%"%+%&%s%H$G$9!#(B
foozy@708: \end{note}
foozy@708: 
foozy@708: $B%j%]%8%H%j$K$*$1$k%U%C%/$NDj5A>u67$r8+$k$K$O!"(B
foozy@708: \hgcmdargs{showconfig}{hooks} $B%3%^%s%I$,MxMQ$G$-$^$9!#(B
foozy@708: $B$"$k%j%]%8%H%j$G:n6HCf$K!"(B
foozy@708: $B<+J,$N=jM-$7$F$$$J$$JL$J%j%]%8%H%j(B
foozy@708: $B$H$NO"7H!JNc!'(B \hgcmd{pull} $B$J$$$7(B \hgcmd{incoming}$B!K$,I,MW$K$J$C$?>l9g!"(B
foozy@708: $B%j%]%8%H%j$N%U%C%/Dj5A>u67$r3NG'$9$Y$-$G$9(B\footnote{$BLuCm(B:
foozy@708: ``XXX'' $B$,IUM?$5$l$F$$$k$3$H$+$i86J8L$40!)(B}$B!#(B
foozy@708: 
foozy@708: \subsection{Hooks do not propagate}
foozy@708: 
foozy@708: Mercurial $B$G$O!"%U%C%/@_Dj$N9=@.4IM}$O9T$o$l$J$$$?$a!"(B
foozy@708: $B%j%]%8%H%j$N(B clone $B$J$$$7(B pull $B$N:]$K!"(B
foozy@708: $B%U%C%/@_Dj$OEAGE$7$^$;$s!#(B
foozy@708: $B$=$NM}M3$O4JC1$G!"%U%C%/$O40A4$KG$0U$N<B9T%3!<%I$@$+$i$G$9!#(B
foozy@708: $B%U%C%/$O!"(B
foozy@708: $B%3%^%s%I<B9T<T$N%^%7%s>e$K$*$$$F!"(B
foozy@708: $B%3%^%s%I<B9T<T$N%f!<%6%"%+%&%s%H$K$h$j!"(B
foozy@708: $B%3%^%s%I<B9T<T$N8"8B%l%Y%k$G<B9T$5$l$^$9!#(B
foozy@708: 
foozy@708: $B%U%C%/$N9=@.4IM}$N<BAu$O!"(B
foozy@708: $B9=@.4IM}%7%9%F%`MxMQ<T$N%"%+%&%s%H$r<eBN2=$5$;$k>e$G!"(B
foozy@708: $BMF0W$K0-MQ2DG=$JJ}K!$rDs6!$7$F$7$^$&$?$a!"(B
foozy@708: $B$"$i$f$kJ,;69=@.4IM}%7%9%F%`$K$H$C$F6K$a$FL5KE$H8@$($^$9!#(B
foozy@708: 
foozy@708: Mercurial $B$O%U%C%/$rEAGE$7$J$$$?$a!"(B
foozy@708: $B6&DL$N%W%m%8%'%/%H$G$NB>$N%a%s%P!<$H$NO"7H$N:]$K$O!"(B
foozy@708: $BH`$i$,<+J,$HF1$8(B Mercurial $B$N%U%C%/$rMxMQ$7$F$$$k$3$H$d!"(B
foozy@708: $BH`$i$,%U%C%/$r@5$7$/@_Dj$7$F$$$k$3$H$r2>Dj$7$F$O$$$1$^$;$s!#(B
foozy@708: $BH`$i$K%U%C%/$N;HMQ$r4|BT$9$k$N$G$"$l$P!"(B
foozy@708: $B$=$l$rJ8=q2=$9$Y$-$G$9!#(B
foozy@708: 
foozy@708: $B4k6H$N%$%s%H%i%M%C%H$N>l9g!"(B
foozy@708: $BNc$($P(B Mercurial $B$N(B``$BI8=`E*$J(B''$B%$%s%9%H!<%k$r(B NFS $B>e$G9T$$!"(B
foozy@708: $BAH?%$G6&DL$N(B \hgrc\ $B%U%!%$%k$GA4$F$N%f!<%6$,;HMQ$9$Y$-%U%C%/$rDj5A$9$k!"(B
foozy@708: $B$H$$$C$?$3$H$,2DG=$G$"$k$?$a!"(B
foozy@708: $B%U%C%/$N4IM}$O4vJ,MF0W$K$J$j$^$9!#(B
foozy@708: $B$7$+$7!"$=$l$G$b8e=R$9$k$h$&$J@)8B$,@8$8$^$9!#(B
foozy@708: 
foozy@708: \subsection{Hooks can be overridden}
foozy@708: 
foozy@708: Mercurial $B$O!":FDj5A$K$h$k%U%C%/$N>e=q$-$r5v$7$F$$$^$9!#(B
foozy@708: $B%U%C%/;XDj$K6uJ8;zNs$r@_Dj$9$k$3$H$G%U%C%/@_Dj$rL58z$K$9$k$3$H$b$G$-$^$9$7!"(B
foozy@708: $B4uK>DL$j$K?6$kIq$$$rJQ$($k$3$H$b$G$-$^$9!#(B
foozy@708: 
foozy@708: $B4v$D$+$N%U%C%/$rDj5A$7$?!"(B
foozy@708: $B%^%7%s$J$$$7AH?%6&DL$N(B \hgrc\ $B%U%!%$%k$rG[Hw$7$?$H$7$F$b!"(B
foozy@708: $BMxMQ<T$K$h$k%U%C%/$NL58z2=$d>e=q$-$,9T$o$l$k2DG=@-$,$"$k$3$H$r!"(B
foozy@708: $BM}2r$7$F$*$/I,MW$,$"$j$^$9!#(B
foozy@708: 
foozy@708: \subsection{Ensuring that critical hooks are run}
foozy@708: 
foozy@708: $BB>$N%a%s%P!<$K<B;\$7$FM_$7$/$J$$;vJA$K$D$$$FE;$a$?J}?K$r!"(B
foozy@708: $B6/@)$7$?$$$3$H$b;~$K$O$"$k$+$b$7$l$^$;$s!#(B
foozy@708: $BNc$($P!"A4$F$N%A%'%s%8%;%C%H$K$OI,$:87L)$J%F%9%H0l<0$KDL$C$F$$$FM_$7$$!"(B
foozy@708: $B$H;W$&$+$b$7$l$^$;$s!#(B
foozy@708: $B$3$NMWK>$r<B8=$9$k$?$a$K!"(B
foozy@708: $BAH?%6&DL$N(B \hgrc\ $B%U%!%$%k$G%U%C%/$rDj5A$7$?$H$7$F$b!"(B
foozy@708: $B%b%P%$%k(B PC $B$+$i%"%/%;%9$9$k1s3V%f!<%6Ey$K$O5!G=$7$^$;$s$7!"(B
foozy@708: $BL^O@%m!<%+%k%f!<%6$K$H$C$F$b%U%C%/$N>e=q$-$K$h$C$FL58z2=$,2DG=$G$9!#(B
foozy@708: 
foozy@708: $B!J%W%m%8%'%/%H$K$*$1$k!K(BMercurial $B$NMxMQJ}?K$H$7$F!"(B
foozy@708: $B%a%s%P!<$,JQ99EAGE$9$k:]$K$O!"(B
foozy@708: $B4XLg$N5!G=$r2L$?$9$h$&$KE,@Z$K@_Dj$5$l$?<~CN$N(B``$B@55,(B''$B%5!<%P$rDL$9!"(B
foozy@708: $B$H:vDj$9$k$3$H$G!"(B
foozy@708: $B%U%C%/$K$h$kMxMQJ}?K$N6/@)$rBeBX$9$k$3$H$,2DG=$G$9!#(B
foozy@708: 
foozy@708: $B<B8=J}K!$N0l$D$H$7$F!"(B
foozy@708: $B%=!<%7%c%k%(%s%8%K%"%j%s%0$H5;=Q$NAH$_9g$o$;$K$h$k$b$N$,$"$j$^$9!#(B
foozy@708: $B%"%/%;%9@)8BIU$-%"%+%&%s%H$rMQ0U$7!"(B
foozy@708: $BEv3:%"%+%&%s%H$G4IM}$5$l$?%j%]%8%H%j$K!"(B
foozy@708: $B3F%a%s%P!<$O%M%C%H%o!<%/7PM3$GJQ99$r(B push $B$G$-$k$h$&$K$7$^$9$,!"(B
foozy@708: $B$=$N%"%+%&%s%H$G%m%0%$%s$7$?$j!"(B
foozy@708: $BDL>o$N%7%'%k%3%^%s%I$r<B9T$7$?$j$G$-$J$$$h$&$K$7$^$9!#(B
foozy@708: $B$3$N$^$^$G$O!"(B
foozy@708: $B%a%s%P!<$O!V%4%_!W$r4^$`$h$&$J%A%'%s%8%;%C%H$N%3%_%C%H$b2DG=$G$9!#(B
foozy@708: 
foozy@708: $B%a%s%P!<$,(B pull $B$9$k%5!<%P!<$X$HC/$+$,%A%'%s%8%;%C%H$r(B push $B$7$?>l9g!"(B
foozy@708: $B$=$N%A%'%s%8%;%C%H$,1JB32=$5$l$kA0$K%5!<%P!<$O%F%9%H$r<B;\(B\footnote{
foozy@708: $BLuCm(B: $B%F%9%H<B;\$O%U%C%/$G<B8=$5$l$^$9$,!"(B
foozy@708: (1) $B%U%C%/$N<B9T$O%"%/%;%9@)8BIU$-%"%+%&%s%H$N8"8B$G<B9T$5$l!"(B
foozy@708: (2) $B%j%b!<%H$+$i$N(B push $B$N>l9g$O%U%C%/$N>e=q$-$,$G$-$J$$!"(B
foozy@708: $B$H$$$&$3$H$+$i!"%;%-%e%j%F%#!&%U%C%/@_Dj$NLdBj$,6&$K2r>C$5$l$^$9!#(B}$B$7!"(B
foozy@708: $B%F%9%H0l<0$KDL$i$J$1$l$P$=$N%A%'%s%8%;%C%H$r5qH]$7$^$9!#(B
foozy@708: $B%a%s%P!<$,$3$N%U%#%k%?%5!<%P$+$i$7$+%A%'%s%8%;%C%H$N(B pull $B$r$7$J$$$N$G$"$l$P!"(B
foozy@708: $B%a%s%P!<$,(B pull $B$9$kA4$F$N%A%'%s%8%;%C%H$O!"(B
foozy@708: $B<+F0E*$KE@8!$5$l$F$$$k$3$H$,J]>Z$5$l$^$9!#(B
foozy@708: 
foozy@708: \section{Care with \texttt{pretxn} hooks in a shared-access repository}
foozy@708: \label{sec:hook:carepretxn}
foozy@708: 
foozy@708: $BB?$/$N?M$K$h$j6&M-$5$l$F$$$k%j%]%8%H%j$KBP$7$F!"(B
foozy@708: $B%U%C%/$K$h$k<+F0<B9T$r@_Dj$9$k>l9g!"(B
foozy@708: $B<B;\J}<0$K$OCm0U$,I,MW$G$9!#(B
foozy@708: 
foozy@708: Mercurial $B$,%j%]%8%H%j$K%m%C%/$r3]$1$k$N$O!"(B
foozy@708: $B%j%]%8%H%j$K=q$-9~$_$r9T$&;~$@$1$G$"$j!"(B
foozy@708: $B3n$D%m%C%/$KBP$7$FCm0U$rJ'$&$N$O!"(B
foozy@708: Mercurial $B$N=q$-9~$_=hM}$NItJ,E*$J2U=j$@$1$G$9!#(B
foozy@708: $B=q$-9~$_%m%C%/$O!"(B
foozy@708: $BJ#?t$N=hM}$NF1;~=q$-9~$_$K$h$k%j%]%8%H%jGKB;$rKI$0$3$H$G!"(B
foozy@708: $B$*8_$$$N=q$-9~$_FbMF$rJ]8n$7$^$9!#(B
foozy@708: 
foozy@708: Mercurial $B$O%G!<%?$NFI$_9~$_=q$-=P$7=g=x$KCm0U$rJ'$C$F$$$^$9$+$i!"(B
foozy@708: $B%j%]%8%H%j$+$i$N%G!<%?FI$_9~$_$N:]$K%m%C%/$OI,MW$"$j$^$;$s!#(B
foozy@708: Mercurial $B$,%j%]%8%H%j$+$i%G!<%?$rFI$_9~$`:]$K$O!"(B
foozy@708: $B%m%C%/$KBP$7$FCm0U$rJ'$$$^$;$s!#(B
foozy@708: $B%m%C%/$rI,MW$H$7$J$$$3$N;EAH$_$O!"(B
foozy@708: $B@-G=$HJ?9T@-$rBg$-$/8~>e$5$;$F$$$^$9!#(B
foozy@708: 
foozy@708: $B$7$+$7$J$,$i!"(B
foozy@708: $B!V%m%C%/$5$l$J$$!W$H$$$&$3$H$O!"(B
foozy@708: $B$=$l$rCN$i$J$$$H!"(B
foozy@708: $BBg$-$J@-G=8~>e$H0z$-49$($K%H%i%V%kH/@8$N@x:_E*$J4m81@-$r;}$C$F$$$^$9!#(B
foozy@708: $B$3$N4m81@-$K$D$$$F@bL@$9$k$K$O!"(B
foozy@708: $B%j%]%8%H%j$X$N%A%'%s%8%;%C%H$NDI2C!"(B
foozy@708: $B$*$h$S$=$l$i%A%'%s%8%;%C%H$NFI$_=P$7$r!"(B
foozy@708: Mercurial $B$,$I$&$$$C$?<j=g$G9T$&$+$K$D$$$F!"(B
foozy@708: $B4vJ,>\:Y$JCN<1$,I,MW$H$J$j$^$9!#(B
foozy@708: 
foozy@708: Mercurial $B$,%a%?%G!<%?$r(B\emph{$B=q$-=P$9(B}$B:]$K$O!"(B
foozy@708: $BBP>]%U%!%$%k$K%a%?%G!<%?$rD>@\=q$-=P$7$^$9!#(B
foozy@708: $B:G=i$K(B filelog $B$K%a%?%G!<%?$r=q$-=P$7!"(B
foozy@708: $B<!$K(B manifest $B$N%G!<%?!J$3$l$K$O!"(B
foozy@708: filelog $B$K=q$-=P$7$??7$7$$%G!<%?$X$N%]%$%s%?$,4^$^$l$^$9!K!"(B
foozy@708: $B$=$7$F(Bchangelog$B$N%G!<%?!J$3$l$K$O!"(B
foozy@708: manifest $B$K=q$-=P$7$??7$7$$%G!<%?$X$N%]%$%s%?$,4^$^$l$^$9!K$,=q$-=P$5$l$^$9!#(B
foozy@708: $B8D!9$N%U%!%$%k$X$N:G=i$N=q$-=P$7$NA0$K!"(B
foozy@708: Mercurial $B$O8D!9$N%U%!%$%k$N=*C<0LCV>pJs$r%H%i%s%6%/%7%g%s%m%0$K5-O?$7$^$9!#(B
foozy@708: Mercurial $B$K$h$j%H%i%s%6%/%7%g%s$,4,$-La$5$l$k:]$K$O!"(B
foozy@708: $B%H%i%s%6%/%7%g%s3+;O;~E@$N%5%$%:$K$^$G8D!9$N%U%!%$%k$,@Z$j5M$a$i$l$^$9!#(B
foozy@708: 
foozy@708: Mercurial $B$,%a%?%G!<%?$r(B\emph{$BFI$_9~$`(B}$B:]$K$O!"(B
foozy@708: changelog $B$rFI$_9~$s$@8e$G$=$NB>$N%U%!%$%k$NFI$_9~$_$r9T$$$^$9!#(B
foozy@708: $B%G!<%?FI$_9~$_$N:]$K$O!"(B
foozy@708: $B@h$KFI$_9~$s$@(B changelog $B$+$iE~C#2DG=$J(B
foozy@708: manifest $B$d(B filelog $B$NItJ,$K$7$+%"%/%;%9$7$J$$$N$G!"(B
foozy@708: $BIT==J,$J=q$-=P$7Cf$N%G!<%?$rFI$`$3$H$O$"$j$^$;$s!#(B
foozy@708: 
foozy@708: $B4v$D$+$N@)8fMQ%U%C%/$N!J(B\hook{pretxncommit} $B$d(B \hook{pretxnchangegroup}$B!K(B
foozy@708: $B$O!"%H%i%s%6%/%7%g%s$N40N;D>A0$K<B9T$5$l$^$9!#(B
foozy@708: $B$3$N;~E@$GA4$F$N%a%?%G!<%?$O=q$-=P$7:Q$_$G$9$,!"(B
foozy@708: Mercurial $B$O%H%i%s%6%/%7%g%s$r4,$-La$9$3$H$G!"(B
foozy@708: $B?7$?$K=q$-=P$5$l$?%G!<%?$rGK4~$9$k$3$H$,$G$-$^$9!#(B
foozy@708: 
foozy@708: $B%H%i%s%6%/%7%g%s40N;A0$N%A%'%s%8%;%C%H$O1JB3@-$,3NDj$7$F$*$i$:!"(B
foozy@708: $B$=$N$?$a(B``$BK\Ev$KB8:_$9$k(B''$B$H$_$J$9$3$H$,$G$-$J$$$3$H$+$i!"(B
foozy@708: $B%H%i%s%6%/%7%g%s40N;A0$K<B9T$5$l$k@)8fMQ%U%C%/$,=*N;$^$G$KD9;~4V$rMW$9$k>l9g!"(B
foozy@708: $B1JB3@-$,3NDj$7$F$$$J$$%A%'%s%8%;%C%H$N%a%?%G!<%?$,!"(B
foozy@708: $BJ?9T$7$FF0:n$7$F$$$kB>$N=hM}$K$h$jFI$_=P$5$l$k;~4VBS$,H/@8$7$^$9!#(B
foozy@708: $B%U%C%/$N<B9T;~4V$,D9$/$J$kDx!"$3$N;~4VBS$,D9$/$J$j$^$9!#(B
foozy@708: 
foozy@708: \subsection{The problem illustrated}
foozy@708: 
foozy@708: $B86B'E*$K(B \hook{pretxnchangegroup} $B%U%C%/$O!"(B
foozy@708: $B=8LsMQ%j%]%8%H%j$G$N<u$1F~$lA0$K!"(B
foozy@708: $B?75,%A%'%s%8%;%C%H$N%S%k%I$d%F%9%H$r<+F02=$9$k$N$KE,$7$F$$$^$9!#(B
foozy@708: $B$3$NMQK!$O(B
foozy@708: ``$B%S%k%I$r<:GT$5$;$k(B''$BJQ99$,=8LsMQ%j%]%8%H%j$KH?1G$5$l$J$$$3$H$rJ]>Z$7$^$9!#(B
foozy@708: $B$7$+$7!"(B
foozy@708: \hook{pretxnchangegroup} $B%U%C%/$K$h$k%F%9%HES>e$NJQ99$r!"(B
foozy@708: $BB>$NMxMQ<T$,(B pull $B$G$-$F$7$^$&$h$&$G$O!"(B
foozy@708: $B%F%9%H$NM-MQ@-$,L5$/$J$C$F$7$^$$$^$9!#(B
foozy@708: $B%j%]%8%H%jFbMF$N@09g@-$K5?$$$r;}$?$J$$MxMQ<T$O!"(B
foozy@708: $B%S%k%I$r<:GT$5$;$k@x:_E*$J2DG=@-$r;}$D%F%9%HL$<B;\$NJQ99$r!"(B
foozy@708: $B<+?H$N%j%]%8%H%j$X$HH?1G$7$F$7$^$&$+$i$G$9!#(B
foozy@708: 
foozy@708: $B$3$N$h$&$JFqBj$X$N:G$b0BA4$J5;=QE*2rK!$O!"(B
foozy@708: ``$BLgHV(B''$B%j%]%8%H%j$NMxMQ$r(B\emph{$BC1J}8~(B}$B$K8BDj$7$F$7$^$&$3$H$G$9!#(B
foozy@708: $BLgHV%j%]%8%H%j$O!"(B
foozy@708: $B30It$+$i$N%A%'%s%8%;%C%H$N(B push $B$O5v$7$F$b!"(B
foozy@708: pull $B$O$G$-$J$$$h$&$K$7$^$9(B
foozy@708: $B!J(B\hook{preoutgoing} $B%U%C%/$G$=$N$h$&$J9T0Y$r6X;_$7$^$9!K!#(B
foozy@708: $B?7$7$$%A%'%s%8%;%C%H$K$*$1$k%S%k%I$J$$$7%F%9%H$,@.8y$7$?$J$i$P!"(B
foozy@708: $B$=$N%A%'%s%8%;%C%H$rJL$J%j%]%8%H%j$X$H(B push $B$9$k$h$&$K(B
foozy@708: \hook{changegroup} $B%U%C%/$r@_Dj$7!"(B
foozy@708: $BMxMQ<T$O$=$A$i$N%j%]%8%H%j$+$i(B pull \emph{$B$G$-$k(B}$B$h$&$K$7$^$7$g$&!#(B
foozy@708: 
foozy@708: $B<B:]LdBj!"(B
foozy@708: $B$3$N$h$&$J=8Ls$5$l$?%\%H%k%M%C%/$r@_$1$k$3$H$O!"(B
foozy@708: $B$"$^$jNI$$%"%$%G%#%"$G$O$J$/(B(XXXX ?)$B!"(B
foozy@708: In practice, putting a centralised bottleneck like this in place is
foozy@708: not often a good idea
foozy@708: $B%H%i%s%6%/%7%g%s$NO31L(B\footnote{$BLuCm(B: 
foozy@708: $B1JB32=L$3NDj$N%A%'%s%8%;%C%H$,8+$($F$7$^$&$3$H(B}$B$OLdBj$K$J$j$^$;$s!#(B
foozy@708: $B%A%'%s%8%;%C%H$r<h$j07$&;~4V$h$j$b$=$l$r%F%9%H$9$k$N$K;~4V$rMW$9$k>u67$G$O!"(B
foozy@708: $B%W%m%8%'%/%H$NBg$-$5(B---$B$*$h$S%S%k%I!&%F%9%H$KMW$9$k;~4V(B
foozy@708: ---$B$,A}2C$9$k$[$I!"(B
foozy@708: ``$B9XF~A0$N;nMQ(B''$B<jK!$K$h$jJI$NFbB&$KAGAa$/Av$j$3$a$^$9!#(BXXXXX ????
foozy@708: As the size of a project---and the time it takes to
foozy@708: build and test---grows, you rapidly run into a wall with this ``try
foozy@708: before you buy'' approach, where you have more changesets to test than
foozy@708: time in which to deal with them.  
foozy@708: $BHr$1$i$l$J$$7k2L$O!"(B
foozy@708: $B$9$Y$F$,4,$-9~$^$l$?ItJ,$K$*$1$k%U%i%9%H%l!<%7%g%s$G$9!#(BXXXXXXX ????
foozy@708: The inevitable result is frustration
foozy@708: on the part of all involved.
foozy@708: 
foozy@708: $B$h$jBg5,LO2=2DG=$J<jK!$O!"(B
foozy@708: push $BA0$K3F<+$G%S%k%I!&%F%9%H$r<B;\$7$F$b$i$$!"(B
foozy@708: push $B$N(B \emph{$B8e(B}$B$KCf1{$G<+F0E*$K%S%k%I!&%F%9%H$r9T$&$3$H$G!"(B
foozy@708: $BA4$F$N%A%'%s%8%;%C%H$,NI9%$G$"$k$3$H$r3NG'$9$k!"$H$$$&$b$N$G$9!#(B
foozy@708: $B$3$N<jK!$NMxE@$O!"(B
foozy@708: $B%j%]%8%H%j$K$*$1$k%A%'%s%8%;%C%H$N<uM}?JEY$K4X$7$F!"(B
foozy@708: $B@)8B$,2]$5$l$k$3$H$,L5$$E@$K$"$j$^$9!#(B
foozy@708: 
foozy@708: \section{A short tutorial on using hooks}
foozy@708: \label{sec:hook:simple}
foozy@708: 
foozy@708: Mercurial $B$N%U%C%/$O4JC1$K=q$1$^$9!#(B
foozy@708: \hgcmd{commit} $B$,40N;$7$?:]$K<B9T$5$l!"(B
foozy@708: $B:n@.$7$?$P$+$j$N%A%'%s%8%;%C%H$N%O%C%7%eCM$rI=<($9$k$@$1$N!"(B
foozy@708: $B4JC1$J%U%C%/$r=q$$$F$_$^$7$g$&!#(B
foozy@708: 
foozy@708: \begin{figure}[ht]
foozy@708:   \interaction{hook.simple.init}
foozy@708:   \caption{A simple hook that runs when a changeset is committed}
foozy@708:   \label{ex:hook:init}
foozy@708: \end{figure}
foozy@708: 
foozy@708: $BA4$F$N%U%C%/$O!"(B\ref{ex:hook:init} $B$NNc$K$*$1$k7A<0$rF'=1$7$^$9!#(B
foozy@708:  \hgrc\ $B%U%!%$%k$N(B
foozy@708: \rcsection{hooks} $B%;%/%7%g%s$K%(%s%H%j$rDI2C$7$^$9!#(B
foozy@708: $B:8JU$O<B9T7@5!$K$J$k%$%Y%s%H$NL>A0$G!"(B
foozy@708: $B1&JU$O<B9T$5$l$k=hM}$G$9!#(B
foozy@708: $B8+$F$o$+$k$h$&$K!"(B
foozy@708: $B%U%C%/$K$*$$$F$OG$0U$N%7%'%k%3%^%s%I$r<B9T$G$-$^$9!#(B
foozy@708: $B4D6-JQ?t(B
foozy@708: $B!JNc$K$*$1$k(B \envar{HG\_NODE} $B$r;2>H$7$F$/$@$5$$!K$rMQ$$$F!"(B
foozy@708: Mercurial $B$O%U%C%/$KIU2C>pJs$rEO$7$^$9!#(B
foozy@708: 
foozy@708: \subsection{Performing multiple actions per event}
foozy@708: 
foozy@708: \ref{ex:hook:ext} $B$NNc$K<($9$h$&$J!"(B
foozy@708: $BFCDj$N<oN`$N%$%Y%s%H$KBP$7$F#1$D0J>e$N%U%C%/$rDj5A$7$?$$>u67$,!"(B
foozy@708: $B$7$P$7$PH/@8$9$k$3$H$G$7$g$&!#(B
foozy@708: Mercurial $B$G$O!"(B
foozy@708: $B%U%C%/L>$NKvHx$K(B\emph{$B3HD%;R(B}$B$rIUM?$9$k$3$H$G!"(B
foozy@708: $BF10l%$%Y%s%H$X$NJ#?t%U%C%/$NDj5A$,2DG=$K$J$j$^$9!#(B
foozy@708: $B3HD%;R$NIUM?$O!"(B
foozy@708: $B%U%C%/L>$K!"(B
foozy@708: $B%T%j%*%I!J(B``\texttt{.}'' $BJ8;z!K$HG$0U$KA*$s$@J8;zNs$rB3$1$k$3$H$G9T$$$^$9!#(B
foozy@708: $BNc$($P!"(B
foozy@708: \texttt{commit} $B$,H/@8$7$?>l9g!"(B
foozy@708: Mercurial $B$O(B 
foozy@708: \texttt{commit.foo} $B$*$h$S(B
foozy@708: \texttt{commit.bar} $B%U%C%/$r<B9T$7$^$9!#(B
foozy@708: 
foozy@708: \begin{figure}[ht]
foozy@708:   \interaction{hook.simple.ext}
foozy@708:   \label{ex:hook:ext}
foozy@708:   \caption{Defining a second \hook{commit} hook}
foozy@708: \end{figure}
foozy@708: 
foozy@708: $B$"$k%$%Y%s%H$KJ#?t$N%U%C%/$,Dj5A$5$l$F$$$k:]$K!"(B
foozy@708: $B$=$N<B9T=g=x$rL@3N$KDj5A$9$k$?$a$K!"(B
foozy@708: Mercurial $B$O%U%C%/$r3HD%;R$G@0Ns$5$;!"(B
foozy@708: $B%U%C%/%3%^%s%I$r$3$N@0Ns$5$l$?=g=x$G<B9T$7$^$9!#(B
foozy@708: $B>e5-$NNc$G$O!"(B
foozy@708: \texttt{commit.foo}
foozy@708: $B$NA0$K(B
foozy@708: \texttt{commit.bar} $B$r!"(B
foozy@708: $B$3$l$i$NA0$K(B
foozy@708: \texttt{commit} $B$r<B9T$7$^$9!#(B
foozy@708: 
foozy@708: $B?7$7$$%U%C%/$rDj5A$9$k:]$K!"(B
foozy@708: $B2?$i$+$N@bL@E*$J3HD%;R$r;HMQ$9$k$N$ONI$$%"%$%G%#%"$G$9!#(B
foozy@708: $B$=$&$9$k$3$H$G!"(B
foozy@708: $B$=$N%U%C%/$,2?$r$9$k$?$a$N$b$N$+$r;W$$=P$7$d$9$/$J$j$^$9!#(B
foozy@708: $B%U%C%/$N<B9T$,<:GT$7$?>l9g!"(B
foozy@708: $B%U%C%/L>$H3HD%;R$r4^$`%(%i!<%a%C%;!<%8$,I=<($5$l$^$9$+$i!"(B
foozy@708: $B%U%C%/$,<:GT$7$?M}M3$K4X$7$F!"(B
foozy@708: $B@bL@E*$J3HD%;R$+$iB(@=$N%R%s%H$rF@$k$3$H$,$G$-$^$9(B
foozy@708: $B!JNc$K4X$7$F$O!"(B\ref{sec:hook:perm}~$B@a$r;2>H$7$F$/$@$5$$!K!#(B
foozy@708: 
foozy@708: \subsection{Controlling whether an activity can proceed}
foozy@708: \label{sec:hook:perm}
foozy@708: 
foozy@708: $B@h$NNc$G$O!"(B
foozy@708: $B%3%_%C%HA`:n$,40N;$7$?8e$G<B9T$5$l$k(B
foozy@708: \hook{commit} $B%U%C%/$r;HMQ$7$^$7$?!#(B
foozy@708: $B$3$N%U%C%/$O!"(B
foozy@708: $BA`:n$,40N;$7$?8e$G<B9T$5$l$k(B Mercurial $B$N%U%C%/$N#1$D$G$9!#(B
foozy@708: $B$3$l$i$N%U%C%/$O!"A`:n$=$N$b$N$K1F6A$r5Z$\$9$3$H$O$"$j$^$;$s!#(B
foozy@708: 
foozy@708: Mercurial $B$G$O!"(B
foozy@708: $BA`:n$,3+;O$5$l$kA0$d!"(B
foozy@708: $BA`:n$,40N;$9$k$^$G$N4V$KH/@8$9$k%$%Y%s%H$,Dj5A$5$l$F$$$^$9!#(B
foozy@708: $B$3$l$i$N%$%Y%s%H$N:]$K5/F0$5$l$k%U%C%/$O!"(B
foozy@708: $BA`:n$r7QB32DG=$+CfCG$9$Y$-$+$rH=CG$9$k$3$H$,$G$-$^$9!#(B
foozy@708: 
foozy@708: \hook{pretxncommit} $B%U%C%/$O!"(B
foozy@708: $B%3%_%C%HA`:n$,35$M=*N;$7$?8e!"%3%_%C%H$,40N;$9$kA0$NCJ3,$G5/F0$5$l$^$9!#(B
foozy@708: $B8@$$49$($k$J$i!"(B
foozy@708: $B%A%'%s%8%;%C%H$rI=$9%a%?%G!<%?$,%G%#%9%/$K=q$-9~$^$l$F$O$$$k$b$N$N!"(B
foozy@708: $B%H%i%s%6%/%7%g%s$,L$$@40N;$7$F$$$J$$>u67$G5/F0$5$l$^$9!#(B
foozy@708: \hook{pretxncommit} $B%U%C%/$O!"(B
foozy@708: $B%H%i%s%6%/%7%g%s$r40N;$5$;$k$N$+!"(B
foozy@708: $B$"$k$$$O4,$-La$9$Y$-$+$r7hDj$9$k$3$H$,$G$-$^$9!#(B
foozy@708: 
foozy@708: \hook{pretxncommit} $B%U%C%/$,=*N;>uBVCM$H$7$F#0$rJV5Q$7$?>l9g!"(B
foozy@708: $B%H%i%s%6%/%7%g%s$O40N;$7!"%3%_%C%HA`:n$O=*N;$7$^$9$N$G!"(B
foozy@708: \hook{commit} $B%U%C%/$,<B9T$5$l$^$9!#(B
foozy@708: \hook{pretxncommit} $B%U%C%/$,=*N;>uBV$H$7$FHs#0$rJV5Q$7$?>l9g!"(B
foozy@708: $B%H%i%s%6%/%7%g%s$O4,$-La$5$l!"(B
foozy@708: $B%A%'%s%8%;%C%H$rI=$9%a%?%G!<%?$O:o=|$5$l!"(B
foozy@708: \hook{commit} $B%U%C%/$O<B9T$5$l$^$;$s!#(B
foozy@708: 
foozy@708: \begin{figure}[ht]
foozy@708:   \interaction{hook.simple.pretxncommit}
foozy@708:   \label{ex:hook:pretxncommit}
foozy@708:   \caption{Using the \hook{pretxncommit} hook to control commits}
foozy@708: \end{figure}
foozy@708: 
foozy@708: $BNc(B~\ref{ex:hook:pretxncommit} $BCf$N%U%C%/$O!"(B
foozy@708: $B%3%_%C%H;~$N%3%a%s%H$,%P%0(BID$B$r4^$s$G$$$k$3$H$r3NG'$7$F$$$^$9!#(B
foozy@708: $B%3%a%s%H$,%P%0(BID$B$r4^$s$G$$$k>l9g!"%3%_%C%H$O40N;$7$^$9!#(B
foozy@708: $B$=$&$G$J$1$l$P!"%3%_%C%HA`:n$O4,$-La$5$l$^$9!#(B
foozy@708: 
foozy@708: \section{Writing your own hooks}
foozy@708: 
foozy@708: \hggopt{-v} $B%*%W%7%g%sIU$-!"(B
foozy@708: $B$"$k$$$O(B\rcitem{ui}{verbose} $B@_Dj9`L\$r(B``true''$B$K$7$F(B
foozy@708: Mercurial $B$r<B9T$9$k$N$,!"(B
foozy@708: $B%U%C%/<BAu$N:]$K$OM-MQ$G$"$k$3$H$K5$IU$/$+$b$7$l$^$;$s!#(B
foozy@708: $B$3$N$h$&$K$7$F(B Mercurial $B$r<B9T$9$k$3$H$G!"(B
foozy@708: $B$=$l$>$l$N%U%C%/$r5/F0$9$k:]$K;vA0$K%a%C%;!<%8$rI=<($7$^$9!#(B
foozy@708: 
foozy@708: \subsection{Choosing how your hook should run}
foozy@708: \label{sec:hook:lang}
foozy@708: 
foozy@708: $B%U%C%/$r<BAu$9$k:]$K$O!"DL>o$N%W%m%0%i%`(B---$BE57?E*$K$O%7%'%k%9%/%j%W%H(B---
foozy@708: $B$H$7$F$b<BAu$G$-$^$9$,!"(B
foozy@708: Python $B4X?t$H$7$F$b<BAu$G$-!"(B
foozy@708: $B$=$N>l9g$O(B Mercurial $B%W%m%;%9Fb$G<B9T$5$l$^$9!#(B
foozy@708: 
foozy@708: $B30It%W%m%0%i%`$H$7$F%U%C%/$r<BAu$9$kMxE@$O!"(B
foozy@708: Mercurial $B$NFbIt;v>p$K4X$7$FCN$kI,MW$,L5$$E@$K$"$j$^$9!#(B
foozy@708: $BIU2CE*$J>pJs$N<hF@$N$?$a$K!"(B
foozy@708: $BDL>o$N(B Mercurial $B%3%^%s%I$r5/F0$9$k$3$H$b$G$-$^$9!#(B
foozy@708: $B$=$NMxE@$H0z$-49$($K!"30It!J%W%m%0%i%`$H$7$F$N!K%U%C%/$O!"(B
foozy@708: $B%W%m%;%9Fb%U%C%/$h$j$bDcB.(B\footnote{$BLuCm(B:
foozy@708: $B8e=R$5$l$^$9$,!"(B
foozy@708: $B30It%W%m%0%i%`$K$h$k%U%C%/$,!VDcB.!W$G$"$k$N$O!"(B
foozy@708: (1)$B30It%W%m%;%9$H$7$F$N%U%C%/5/F0$H!"(B
foozy@708: (2)Mercurial $B%j%]%8%H%j$X$N%"%/%;%9$K4X$9$kItJ,$G!"(B
foozy@708: $B30It%W%m%;%9$N<B9T$=$N$b$N$,DcB.$J$o$1$G$O$"$j$^$;$s!#(B}$B$G$9!#(B
foozy@708: 
foozy@708: Python $B4X?t$K$h$k%W%m%;%9Fb%U%C%/$O!"(B
foozy@708: $BA4$F$N(B Mercurial API $B$K%"%/%;%9$G$-!"(B
foozy@708: $BB>$N%W%m%;%9$r(B``$B@8@.(B''$B$9$kI,MW$O$"$j$^$;$s$N$G!"(B
foozy@708: $B4pK\E*$K30It%U%C%/$h$j$b9bB.$G$9!#(B
foozy@708: $B%U%C%/$,I,MW$H$9$kB?$/$N>pJs$NF~<j$b!"(B
foozy@708: Mercurial $B%3%^%s%I$+$iF@$k$h$j$b!"(B
foozy@708: Mercurial API $B$+$iF@$kJ}$,MF0W$G$9!#(B
foozy@708: 
foozy@708: Python $B$NMxMQ$,6l$K$J$i$J$$$+!"(B
foozy@708: $B9b$$<B9T@-G=$,MW5a$5$l$k>l9g!"(B
foozy@708: Python $B$G$N%U%C%/<BAu$rA*Br$9$Y$-$G$9!#(B
foozy@708: $B$7$+$7$J$,$i!"(B
foozy@708: $B4JC1$J%U%C%/$G!"(B
foozy@708: $B@-G=$r5$$K$9$kI,MW$,L5$$!J$*$=$i$/B?$/$N%U%C%/$,$=$&$G$9!K$N$G$"$l$P!"(B
foozy@708: $B%7%'%k%9%/%j%W%H$G$N<BAu$G==J,$G$9!#(B
foozy@708: 
foozy@708: \subsection{Hook parameters}
foozy@708: \label{sec:hook:param}
foozy@708: 
foozy@708: Mercurial $B$,%U%C%/$r5/F0$9$k:]$K$O!"(B
foozy@708: $BL@3N$KDj5A$5$l$?%Q%i%a!<%?$,%U%C%/$KEO$5$l$^$9!#(B
foozy@708: Python $B$G$N%U%C%/<BAu$N>l9g!"(B
foozy@708: $B%Q%i%a!<%?$O%-!<%o!<%I0z?t$H$7$F%U%C%/4X?t$KEO$5$l$^$9!#(B
foozy@708: $B30It%W%m%0%i%`$G$N%U%C%/<BAu$N>l9g!"(B
foozy@708: $B%Q%i%a!<%?$O4D6-JQ?t$H$7$FEO$5$l$^$9!#(B
foozy@708: 
foozy@708: $B%U%C%/<BAu$,(B Python $B!&%7%'%k%9%/%j%W%H$N$$$:$l$G$"$k$+$G!"(B
foozy@708: $B%U%C%/8GM-$N%Q%i%a!<%?L>$H$=$NCM$,7h$^$j$^$9(B\footnote{$BLuCm(B:
foozy@708: $B86J8$O(B
foozy@708: $B!V(BWhether your hook is written in Python or as a shell script, the
foozy@708: hook-specific parameter names and values will be the ``same''$B!W(B}
foozy@708: $B??56CM%Q%i%a!<%?$O!"(BPython $B%U%C%/$G$O??56CM7?$H$7$FI=8=$5$l$^$9$,!"(B
foozy@708: $B30It%U%C%/$KBP$7$F$O(B ``1''$B!J(B``true'' $BCM$H$7$F!K$J$$$7(B 
foozy@708: ``0''$B!J(B``false'' $BCM$H$7$F!K$r;}$D4D6-JQ?t$GI=8=$5$l$^$9!#(B
foozy@708: $B%U%C%/%Q%i%a!<%?$,(B \texttt{foo} $B$H$$$&L>A0$G$"$k>l9g!"(B
foozy@708: Python $B%U%C%/$N%-!<%o!<%I0z?t$NL>A0$b(B \texttt{foo} $B$G$9$,!"(B
foozy@708: $B30It%U%C%/$N4D6-JQ?tL>$O(B \texttt{HG\_FOO} $B$H$J$j$^$9!#(B
foozy@708: 
foozy@708: \subsection{Hook return values and activity control}
foozy@708: 
foozy@708: $B<B9T$,@.8y$7$?%U%C%/$O!"30It%U%C%/$N>l9g$O=*N;%3!<%I#0$G!"(B
foozy@708: $B%W%m%;%9Fb%U%C%/$N>l9g$O??56CM(B``False''$B$G=*N;$7$J$1$l$P$J$j$^$;$s(B
foozy@708: \footnote{$BLuCm(B:Mercurial $B$NG[I[J*$K4^$^$l$k(B hgext $BG[2<$N%U%C%/$O!"(B
foozy@708: $B7k9=$J3NN($G!"(B
foozy@708: False $BL5$7$N(B return $B$d!"(B
foozy@708: $BL@<(E*$J(B return $BL5$7$N<BAu$G$9$,!"(B
foozy@708: Python $B$N8@8l;EMM>e!"(B
foozy@708: $B$3$l$i$O(B False $B$H(B``$B$[$\Ey2A(B''$B$J(B None $B$H$_$J$5$l$^$9!#(B}$B!#(B
foozy@708: $B%U%C%/$N<B9T<:GT$O!"(B
foozy@708: $B30It%U%C%/$N>l9g$OHs#0$N=*N;%3!<%I$G!"(B
foozy@708: $B%W%m%;%9Fb%U%C%/$N>l9g$O??56CM(B``true''$B$GI=$5$l$^$9!#(B
foozy@708: $B%W%m%;%9Fb$U$C$/$,Nc30$rIbMH$7$?>l9g!"(B
foozy@708: $B%U%C%/<B9T$O<:GT$7$?$H8+Pv$5$l$^$9!#(B
foozy@708: 
foozy@708: $BA`:n$N7QB3@-$r@)8f$G$-$k%U%C%/$N>l9g!"(B
foozy@708: $B#0!?(Bfalse $B$O7QB3$N(B``$B5v2D(B''$B$r!"(B
foozy@708: $BHs#0!?(Btrue$B!?Nc30$O(B``$B5qH](B''$B$r0UL#$7$^$9!#(B
foozy@708: 
foozy@708: \subsection{Writing an external hook}
foozy@708: 
foozy@708: \hgrc\ $B%U%!%$%k$K30It%U%C%/$r5-=R$7$?>l9g!"(B
foozy@708: \hgrc\ $B%U%!%$%k$K5-=R$7$?%U%C%/$NFbMF$O!"(B
foozy@708: $B%7%'%k%W%m%;%9$KEO$5$l!"(B
foozy@708: $B$=$N%7%'%k%W%m%;%9$K$h$C$F2r<a$5$l$^$9!#(B
foozy@708: $B$3$l$O!"%U%C%/5-=R$NK\BN$K!"(B
foozy@708: $BDL>o$N%7%'%k%3%^%s%I%i%$%s$HF1MM$N9=B$$rMQ$$$k$3$H$,$G$-$k!"(B
foozy@708: $B$H$$$&$3$H$r0UL#$7$F$$$^$9!#(B
foozy@708: 
foozy@708: $B<B9T2DG=$J%U%C%/$O!"(B
foozy@708: $B>o$K%j%]%8%H%j$N%k!<%H%G%#%l%/%H%jD>2<$G<B9T$5$l$^$9!#(B
foozy@708: 
foozy@708: $B8D!9$N%U%C%/%Q%i%a!<%?$O4D6-JQ?t7PM3$GEO$5$l$^$9$,!"(B
foozy@708: $B4D6-JQ?tL>$K$O!"(B
foozy@708: $BBgJ8;z2=$5$l!"@\F,<-$H$7$F(B``\texttt{HG\_}''$B$,IUM?$5$l$?L>A0$,MQ$$$i$l$^$9!#(B
foozy@708: 
foozy@708: $B%U%C%/%Q%i%a!<%?$rNc30$H$9$l$P!"(B
foozy@708: Mercurial $B$O%U%C%/<B9T;~$K4D6-JQ?t$N2~JQ$r9T$$$^$;$s!#(B
foozy@708: $B$=$l$>$l$K0[$J$k4D6-JQ?t@_Dj$r$7$F$$$kB?$/$N%f!<%6$K$h$C$F<B9T$5$l$k!"(B
foozy@708: $BAH?%A4BN$G6&MQ$5$l$k%U%C%/$r<BAu$9$k:]$K$O!"(B
foozy@708: $B$3$NCN<1$,Lr$KN)$D$G$7$g$&!#(B
foozy@708: $BJ#?t%f!<%6$K$h$j<B9T$5$l$k>u672<$G$O!"(B
foozy@708: $B%U%C%/$N;n834D6-$G@_Dj$5$l$F$$$?4D6-JQ?t$,!"(B
foozy@708: $B<B9T;~$K@_Dj$5$l$F$$$k$3$H$r4|BT$7$F$O$$$1$^$;$s!#(B
foozy@708: 
foozy@708: \subsection{Telling Mercurial to use an in-process hook}
foozy@708: 
foozy@708: $B%W%m%;%9Fb%U%C%/$r(B \hgrc\ $B%U%!%$%k$G@_Dj$9$k:]$NJ8K!$O!"(B
foozy@708: $B<B9T2DG=%U%C%/(B\footnote{$BLuCm(B: $B!V30It%U%C%/!W$N0U(B
foozy@708: }$B@_Dj$N:]$N$=$l$H$O>/!90[$J$j$^$9(B
foozy@708: $B%U%C%/@_Dj$O!"(B
foozy@708: $B@\F,<-(B``\texttt{python:}''$B$KB3$-!"(B
foozy@708: $B%U%C%/$H$7$F;HMQ$9$k8F$S=P$72DG=%*%V%8%'%/%H(B\footnote{$BLuCm(B: 
foozy@708: callable object}$B$N40A4=$>~$5$l$?L>A0$,5-=R$5$l$F$$$J$1$l$P$J$j$^$;$s!#(B
foozy@708: 
foozy@708: $B%U%C%/Dj5A$,B8:_$9$k%b%8%e!<%k$O!"(B
foozy@708: $B%U%C%/<B9T;~$K<+F0E*$K(B import $B$5$l$^$9!#(B
foozy@708: $B%b%8%e!<%kL>$H(B \envar{PYTHONPATH} $B@_Dj$,@5$7$1$l$P!"(B
foozy@708: $B$-$C$HF0:n$9$kH&$G$9(B\footnote{$BLuCm(B: ``just work'' $B$N%K%e%"%s%9$O!)(B}$B!#(B
foozy@708: 
foozy@708: $B0J2<$K<($9(B \hgrc\ $B%U%!%$%k$N0zMQNc$O!"(B
foozy@708: $BA0=R$7$?I=5-$K4X$9$kJ8K!$H0UL#$rNc<($7$F$$$^$9!#(B
foozy@708: 
foozy@708: \begin{codesample2}
foozy@708:   [hooks]
foozy@708:   commit.example = python:mymodule.submodule.myhook
foozy@708: \end{codesample2}
foozy@708: 
foozy@708: Mercurial $B$,(B \texttt{commit.example} $B%U%C%/$r5/F0$9$k:]$K$O!"(B
foozy@708: \texttt{mymodule.submodule} $B$r(B import $B$7!"(B
foozy@708: \texttt{myhook} $B$H$$$&L>A0$N8F$S=P$72DG=%*%V%8%'%/%H$rC5$7=P$7$F5/F0$7$^$9!#(B
foozy@708: 
foozy@708: \subsection{Writing an in-process hook}
foozy@708: 
foozy@708: $B0J2<$K<($9:G$bC1=c$J%W%m%;%9Fb%U%C%/$O!"(B
foozy@708: $B%U%C%/$H$7$F$O2?$b$7$^$;$s$,!"(B
foozy@708: $B%U%C%/(B API $B$N4pK\E*$J35MW$rNc<($G$-$^$9!#(B
foozy@708: 
foozy@708: \begin{codesample2}
foozy@708:   def myhook(ui, repo, **kwargs):
foozy@708:       pass
foozy@708: \end{codesample2}
foozy@708: 
foozy@708: Python $B%U%C%/(B\footnote{$BLuCm!'%W%m%;%9Fb%U%C%/$N0U(B}$B$N:G=i$N0z?t$O!"(B
foozy@708: $B>o$K(B \pymodclass{mercurial.ui}{ui} $B%*%V%8%'%/%H$G$9!#(B
foozy@708: $BBh#20z?t$O%j%]%8%H%j%*%V%8%'%/%H$G$9$,!"(B
foozy@708: $B8=:_$N(B Mercurial $B$N<BAu$G$O!"(B
foozy@708: $B$=$N%$%s%9%?%s%9$O>o$K(B \pymodclass{mercurial.localrepo}{localrepository} $B$G$9!#(B
foozy@708: $B$3$l$i$KB3$/$=$NB>$N0z?t$O%-!<%o!<%I0z?t$H$7$FEO$5$l$^$9!#(B
foozy@708: $BEO$5$l$kFbMF$O5/F0$5$l$k%U%C%/!J$N<oN`!K$K0MB8$7$^$9$,!"(B
foozy@708: $B>e5-Nc$K$*$1$k(B \texttt{**kwargs} $B$N$h$&$K!"(B
foozy@708: $B%-!<%o!<%I0z?t<-=q$KMn$H$79~$`(B\footnote{XXXXX:
foozy@708: Python $B8GM-$NLu8l$r3NG'(B}$B$3$H$G!"(B
foozy@708: $B6=L#$NL5$$0z?t$rL5;k$9$k$3$H$,$G$-$^$9!#(B
foozy@708: 
foozy@708: \section{Some hook examples}
foozy@708: 
foozy@708: \subsection{Writing meaningful commit messages}
foozy@708: 
foozy@708: $BM-MQ$J%3%_%C%H%a%C%;!<%8$,Hs>o$KC;$$!"(B
foozy@708: $B$H$$$&>u67$OA[A|$7Fq$$$b$N$,$"$j$^$9!#(B
foozy@708: $B?^(B~\ref{ex:hook:msglen.go} $B$K<($9C1=c$J(B
foozy@708: \hook{pretxncommit} $B%U%C%/$O!"(B
foozy@708: $B#1#0%P%$%H$h$j$bC;$$%a%C%;!<%8$G$N%A%'%s%8%;%C%H$N%3%_%C%H$rK8$2$^$9!#(B
foozy@708: 
foozy@708: \begin{figure}[ht]
foozy@708:   \interaction{hook.msglen.go}
foozy@708:   \caption{A hook that forbids overly short commit messages}
foozy@708:   \label{ex:hook:msglen.go}
foozy@708: \end{figure}
foozy@708: 
foozy@708: \subsection{Checking for trailing whitespace}
foozy@708: 
foozy@708: $B%3%_%C%H$K4X$9$k6=L#?<$$%U%C%/$NMxMQ$O!"(B
foozy@708: $Be:No$J%3!<%I$G$N<BAu$rJd=u$9$k$H$$$&$b$N$G$9!#(B
foozy@708: $B4JC1$J(B``$Be:No$J%3!<%I(B''$B$NNc$H$7$F$O!"(B
foozy@708: $BJQ99$,DI2C$9$k?7$7$$9T$K$O(B``$BKvHx6uGr(B''$B$,4^$^$l$F$$$F$O$J$i$J$$!"(B
foozy@708: $B$H$$$&3J8@$,$"$j$^$9!#(B
foozy@708: $BKvHx6uGr$H$O!"(B
foozy@708: $B6uGrJ8;z$*$h$S%?%V!J(Btab$B!KJ8;z$NO"B3$,9TKv$K$"$k$3$H$r0UL#$7$^$9!#(B
foozy@708: $BB?$/$N>l9g!"(B
foozy@708: $BKvHx6uGr$OI,MW$NL5$$IT2D;k$N;(2;$_$?$$$J$b$N$G$9$,!"(B
foozy@708: $B;~$K$OLdBj$r4^$`$3$H$+$i!"(B
foozy@708: $B$=$l$i$,<h$j=|$+$l$k$3$H$rK>$_$^$9!#(B
foozy@708: 
foozy@708: \hook{precommit} $B$H(B \hook{pretxncommit} $B$N$$$:$l$N%U%C%/$G$b!"(B
foozy@708: $BKvHx6uGrLdBj$rDLCN$9$k$3$H$,2DG=$G$9!#(B
foozy@708: \hook{precommit} $B%U%C%/$r;HMQ$7$?>l9g!"(B
foozy@708: $B%U%C%/$O%3%_%C%HBP>]%U%!%$%k$rCN$k$3$H$,$G$-$J$$$N$G!"(B
foozy@708: $B%j%]%8%H%jCf$NJQ99$5$l$?%U%!%$%kA4$F$KBP$7$FKvHx6uGr$r3NG'$7$F$7$^$$$^$9!#(B
foozy@708: $B$=$&$9$k$H!"(B
foozy@708: $B%U%!%$%k(B \filename{foo} $B$NJQ99$N$_$r%3%_%C%H$7$?$$>l9g$G$b!"(B
foozy@708: \filename{bar} $B%U%!%$%k$,KvHx6uGr$r4^$s$G$$$?$J$i!"(B
foozy@708: \hook{precommit} $B%U%C%/$G$N%A%'%C%/$O!"(B
foozy@708: \filename{bar} $B$NLdBj$rM}M3$K(B \filename{foo} $B$N%3%_%C%H$rK8$2$F$7$^$$$^$9!#(B
foozy@708: $B$3$l$G$O$$$1$^$;$s!#(B
foozy@708: 
foozy@708: \hook{pretxncommit} $B%U%C%/$G<B8=$9$k>l9g!"(B
foozy@708: $B%3%_%C%H$N%H%i%s%6%/%7%g%s$,40N;$9$kD>A0$^$G%A%'%C%/$,9T$o$l$^$;$s!#(B
foozy@708: $B$3$N$?$a!"KvHx6uGrLdBj$N3NG'$r!"(B
foozy@708: $B87L)$K%3%_%C%HBP>]$N%U%!%$%k$@$1$K9T$&$3$H$,$G$-$^$9!#(B
foozy@708: $B$7$+$7!"(B
foozy@708: $B%3%_%C%H%a%C%;!<%8$rBPOCE*$KF~NO$7$?8e$G$"$C$F$b!"(B
foozy@708: $B%U%C%/$N<B9T$,<:GT(B\footnote{
foozy@708: $BLuCm(B: $BKvHx6uGr$,8!=P$5$l$k$3$H$G$N!V<:GT!W(B}$B$7$?>l9g!"(B
foozy@708: $B%H%i%s%6%/%7%g%s$O4,$-La$5$l$F$7$^$$$^$9$N$G!"(B
foozy@708: $BKvHx6uGr$r<h$j=|$$$?8e$G:F$S(B \hgcmd{commit} $B%3%^%s%I<B9T$7$?:]$K$O!"(B
foozy@708: $B$b$&0lEY%3%_%C%H%a%C%;!<%8$rF~NO$9$kI,MW$,$"$j$^$9!#(B
foozy@708: 
foozy@708: \begin{figure}[ht]
foozy@708:   \interaction{hook.ws.simple}
foozy@708:   \caption{A simple hook that checks for trailing whitespace}
foozy@708:   \label{ex:hook:ws.simple}
foozy@708: \end{figure}
foozy@708: 
foozy@708: $B?^(B~\ref{ex:hook:ws.simple} $B$G$O!"(B
foozy@708: $BKvHx6uGr$r%A%'%C%/$9$k4JC1$J(B
foozy@708: \hook{pretxncommit} $B%U%C%/$r>R2p$7$F$$$^$9!#(B
foozy@708: $B$3$N%U%C%/$OC;$$$G$9$,!"Hs>o$KM-MQ$G$9!#(B
foozy@708: $BJQ99$K$h$j2?$l$+$N%U%!%$%k$KBP$7$FKvHx6uGr$r4^$`9T$,DI2C$5$l$?>l9g!"(B
foozy@708: $B$3$N%U%C%/$O%(%i!<%9%F!<%?%9$G=*N;$7$^$9$,!"(B
foozy@708: $BITL{2w$J%U%!%$%k$d9T$NFCDj$rJd=u$9$k>pJs$r2?$iI=<($7$^$;$s(B\footnote{$BLuCm!'(B
foozy@708: $B%U%C%/<B9T$N%3%^%s%I%i%$%s$+$i$o$+$k$h$&$K!"(B
foozy@708: export $B=PNO!J!a(B patch $B7A<0!K$KBP$7$F(B (e)grep $B$rE,MQ$7$F$$$^$9$+$i!"(B
foozy@708: $B%U%!%$%kL>$d9THV9f$KBP$7$F$O2?$iG'<1$5$l$F$$$^$;$s!#(B}$B!#(B
foozy@708: $B$3$N%U%C%/$O!"(B
foozy@708: $B2~JQ$5$l$F$$$J$$9T$K$OCm0U$rJ'$o$:!"(B
foozy@708: $BKvHx6uGrLdBj$r;}$A9~$`9T$K$N$_Cm0U$rJ'$&!"(B
foozy@708: $B$H$$$&M%$l$?FC<A$b;}$C$F$$$^$9!#(B
foozy@708: 
foozy@708: \begin{figure}[ht]
foozy@708:   \interaction{hook.ws.better}
foozy@708:   \caption{A better trailing whitespace hook}
foozy@708:   \label{ex:hook:ws.better}
foozy@708: \end{figure}
foozy@708: 
foozy@708: $B?^(B~\ref{ex:hook:ws.better} $B$O@h$NNc$h$j$OJ#;($G$9$,!"(B
foozy@708: $B$h$jM-MQ$J%U%C%/$NNc$r<($7$F$$$^$9(B\footnote{$BLuCm(B:
foozy@708: check\_whitespace.py $B$NFbMF$,ITL@!#(B
foozy@708: $B?^Cf$G%=!<%9$r(B cat $B$9$Y$-(B XXXX}$B!#(B
foozy@708: $B$3$N%U%C%/$O(B unified diff $B7A<0$r2r@O$7$F!"(B
foozy@708: $BKvHx6uGr$rDI2C$9$k9T$NM-L5$rH=Dj$7!"(B
foozy@708: $B$=$N$h$&$J%U%!%$%k$NL>A0$H9THV9f$rI=<($7$^$9!#(B
foozy@708: $B$=$l$K2C$($F$3$N%U%C%/$O!"(B
foozy@708: $B%A%'%s%8%;%C%H$,KvHx6uGr$rDI2C$9$k$3$H$r8!CN$7$?>l9g!"(B
foozy@708: $B<B9T$r=*N;$7$F(B Mercurial $B$K%H%i%s%6%/%7%g%s$N4,$-La$7$rEA$($kA0$K!"(B
foozy@708: $B%3%_%C%H%a%C%;!<%8$rJ]B8$7$F$=$N%U%!%$%kL>$rI=<($7$^$9$N$G!"(B
foozy@708: $BLdBjE@$r=$@5$7$?8e$N%3%_%C%H$N:]$K$O!"(B
foozy@708: \hgcmdargs{commit}{\hgopt{commit}{-l}~\emph{filename}}
foozy@708: $B$r;H$C$F%3%_%C%H%a%C%;!<%8$r:FMxMQ$9$k$3$H$,$G$-$^$9!#(B
foozy@708: 
foozy@708: $B?^(B~\ref{ex:hook:ws.better}
foozy@708: $B%U%!%$%k$+$iKvHx6uGr$r<h$j=|$/(B
foozy@708: \command{perl} $B$N0l9T5-=R$NMQK!$r<($7$^$9!#(B
foozy@708: $B$3$NJ}K!$O$3$3$K:F7G$9$k$KB-$k$@$1$N!"(B
foozy@708: $B4J7i$5$HM-MQ@-$r;}$C$F$$$^$9(B\footnote{$BLuCm(B: 
foozy@708: $B%3!<%I$NI=<($,!J(BHTML $B7A<0$@$H!K#29T$KJ,3d$5$l$F$$$k(B XXXX}$B!#(B
foozy@708: 
foozy@708: \begin{codesample2}
foozy@708:   perl -pi -e 's,\\s+\$,,' filename
foozy@708: \end{codesample2}
foozy@708: 
foozy@708: \section{Bundled hooks}
foozy@708: 
foozy@708: Mercurial $B$NG[I[HG$K$O!"4v$D$+$N%U%C%/$,E:IU$5$l$F$$$^$9!#(B
foozy@708: $BE:IU%U%C%/$O(B Mercurial $B%=!<%9%D%j!<$N(B
foozy@708: \dirname{hgext} $B%G%#%l%/%H%j$K3JG<$5$l$F$$$^$9!#(B
foozy@708: Mercurial $B$N%P%$%J%jG[I[HG$r;HMQ$7$F$$$k>l9g$K$O!"(B
foozy@708: $B%Q%C%1!<%8$N%$%s%9%H!<%i!<$,(B
foozy@708: Mercurial $B$r%$%s%9%H!<%k$7$?0LCV$K$"$k(B
foozy@708: \dirname{hgext} $B%G%#%l%/%H%j$K3JG<$5$l$F$$$^$9!#(B
foozy@708: 
foozy@708: \subsection{\hgext{acl}---access control for parts of a repository}
foozy@708: 
foozy@708: \hgext{acl} $B3HD%$K$h$j!"(B
foozy@708: $B%M%C%H%o!<%/>e$N%5!<%P$KBP$7$F%A%'%s%8%;%C%H$r(B
foozy@708: push $B2DG=$J1s3V%f!<%6$r@)8B$9$k$3$H$,$G$-$^$9!#(B
foozy@708: $B%j%]%8%H%j$N0lIt!JL^O@A4BN$b!K$rJ]8n$9$k$3$H$,$G$-$^$9$N$G!"(B
foozy@708: $BFCDj$N%f!<%6$KBP$7$F$O!"(B
foozy@708: $BJ]8n$5$l$?ItJ,$K1F6A$r5Z$\$5$J$$%A%'%s%8%;%C%H$N$_$N(B push $B$,2DG=$G$9!#(B
foozy@708: 
foozy@708: $B$3$N3HD%$O(B
foozy@708: push $BBP>]$N%A%'%s%8%;%C%H$r%3%_%C%H$7$?%f!<%6(B\emph{$B$G$O$J$/(B}$B!"(B
foozy@708: push $B$r<B;\$9$k%f!<%6$N?H85>pJs$r85$K%"%/%;%9@)8f$r9T$$$^$9!#(B
foozy@708: $B1s3V%f!<%6$rG'>Z$9$k4F6X!J(Block-downed$B!K%5!<%P$,B8:_$9$k4D6-$G!"(B
foozy@708: $BFCDj$N%f!<%6$@$1$,4F6X%5!<%P$X$N%A%'%s%8%;%C%H$N(B
foozy@708: push $B$,5v$5$l$k$3$H$r3N<B$K$7$?$$>l9g$G$J$1$l$P!"(B
foozy@708: $B$3$N%U%C%/$N;HMQ$O0UL#$,$"$j$^$;$s!#(B
foozy@708: 
foozy@708: \subsubsection{Configuring the \hook{acl} hook}
foozy@708: 
foozy@708: $B;}$A9~$^$l$k%A%'%s%8%;%C%H$r4IM}$9$k$?$a$K!"(B
foozy@708: \hgext{acl} $B%U%C%/$O(B
foozy@708: \hook{pretxnchangegroup} $B%U%C%/$H$7$FMQ$$$^$9!#(B
foozy@708: \hook{pretxnchangegroup} $B%U%C%/$H$7$FMQ$$$i$l$k$3$H$G!"(B
foozy@708: $B30Mh$N%A%'%s%8%;%C%H$K$h$jJQ99$5$l$k%U%!%$%k$rCN$k$3$H$,$G$-$k$?$a!"(B
foozy@708: ``$B6X;_$5$l$F$$$k(B''$B%U%!%$%k$X$NJQ99$r9T$&%A%'%s%8%;%C%H72$KBP$7$F$O!"(B
foozy@708: $B%H%i%s%6%/%7%g%s$N4,$-La$7$,9T$o$l$^$9!#(B
foozy@708: 
foozy@708: \begin{codesample2}
foozy@708:   [hooks]
foozy@708:   pretxnchangegroup.acl = python:hgext.acl.hook
foozy@708: \end{codesample2}
foozy@708: 
foozy@708: \hgext{acl} $B3HD%$O#3$D$N%;%/%7%g%s$G@_Dj$5$l$^$9!#(B
foozy@708: 
foozy@708: \rcsection{acl} $B%;%/%7%g%s$K$O!"(B
foozy@708: $B%U%C%/$,Cm0U$rJ'$&$Y$-30Mh%A%'%s%8%;%C%H$N=P=j$rNs5s$9$k(B
foozy@708: \rcitem{acl}{sources} $B%(%s%H%j$@$1$,5-=R$5$l$^$9!#(B
foozy@708: $BDL>o$O$3$N%;%/%7%g%s$r@_Dj$9$kI,MW$O$"$j$^$;$s!#(B
foozy@708: 
foozy@708: \begin{description}
foozy@708: \item[\rcitem{acl}{serve}] $B%j%b!<%H%j%]%8%H%j$+$i$N(B http $B$J$$$7(B ssh 
foozy@708:   $B7PM3$N%A%'%s%8%;%C%H$KBP$7$F@)8f$r9T$$$^$9!#(B
foozy@708:   $B$3$l$O(B \rcitem{acl}{sources} $B$N4{DjCM$G!"(B
foozy@708:   $BDL>o$O$3$N@_Dj9`L\$KBP$7$F9T$&M#0l$N@_Dj$G$9!#(B
foozy@708: 
foozy@708: \item[\rcitem{acl}{pull}] $B%m!<%+%k%j%]%8%H%j$+$i$N(B
foozy@708:   pull $B7PM3$N%A%'%s%8%;%C%H$KBP$7$F@)8f$r9T$$$^$9!#(B
foozy@708: 
foozy@708: \item[\rcitem{acl}{push}] $B%m!<%+%k%j%]%8%H%j$+$i$N(B
foozy@708:   push $B7PM3$N%A%'%s%8%;%C%H$KBP$7$F@)8f$r9T$$$^$9!#(B
foozy@708: 
foozy@708: \item[\rcitem{acl}{bundle}] $BB>$N%j%]%8%H%j$+$i$N(B
foozy@708:   bundle $B7PM3$N%A%'%s%8%;%C%H$KBP$7$F@)8f$r9T$$$^$9!#(B
foozy@708: 
foozy@708: \end{description}
foozy@708: 
foozy@708: \rcsection{acl.allow} $B%;%/%7%g%s$O!"(B
foozy@708: $B%j%]%8%H%j$X$N%A%'%s%8%;%C%HDI2C$r5v2D$5$l$F$$$k%f!<%6$r7hDj$7$^$9!#(B
foozy@708: $B$3$N%;%/%7%g%s$,B8:_$7$J$$>l9g!"(B
foozy@708: $BL@<(E*$K6X;_$5$l$F$$$J$$%f!<%6$O!"(B
foozy@708: $BC/$G$b%A%'%s%8%;%C%H$NDI2C$r$G$-$^$9!#(B
foozy@708: $B$3$N%;%/%7%g%s$,B8:_$9$k>l9g!"(B
foozy@708: $BL@<(E*$K5v2D$5$l$F$$$J$$%f!<%6$O!"(B
foozy@708: $BC/$b%A%'%s%8%;%C%H$NDI2C$,$G$-$^$;$s!J(B
foozy@708: $B$G$9$N$G!"$3$N%;%/%7%g%s$r6u$K$7$?>l9g!"(B
foozy@708: $BA4$F$N%f!<%6$,%A%'%s%8%;%C%H$NDI2C$r6X;_$5$l$^$9!K!#(B
foozy@708: 
foozy@708: \rcsection{acl.deny} $B%;%/%7%g%s$O!"(B
foozy@708: $B%j%]%8%H%j$X$N%A%'%s%8%;%C%HDI2C$r6X;_$5$l$F$$$k%f!<%6$r7hDj$7$^$9!#(B
foozy@708: $B$3$N%;%/%7%g%s$,5-=R$5$l$J$$>l9g!"(B
foozy@708: $BA4$F$N%f!<%6$O%A%'%s%8%;%C%H$NDI2C$r5v2D$5$l$^$9(B\footnote{$BLuCm!'(B 
foozy@708: $B86J8$O!V(Bno users are denied$B!W$G$9$,!"(B
foozy@708: acl.py $B$N<BAu>e$O!V6X;_$7$J$$!W$H!V5v2D!W$OEy2A$G$9!#(B}$B!#(B
foozy@708: 
foozy@708: \rcsection{acl.allow} $B$*$h$S(B \rcsection{acl.deny} 
foozy@708: $B%;%/%7%g%s$NJ8K!$OF10l$G$9!#(B
foozy@708: $B3F%(%s%H%j$N:8JU$O!"(B
foozy@708: $B%j%]%8%H%j%k!<%HAjBP$G$N%U%!%$%k$J$$$7%G%#%l%/%H%j$N%^%C%A%s%0%Q%?!<%s$G!"(B
foozy@708: $B1&JU$O%f!<%6L>$H$J$C$F$$$^$9!#(B
foozy@708: 
foozy@708: $B0J2<$NNc$G$O!"(B
foozy@708: $B%f!<%6(B \texttt{docwriter} $B$,%j%]%8%H%j$N(B
foozy@708: \dirname{docs} $BG[2<$KBP$9$kJQ99$N(B 
foozy@708: push $B$N$_$,5v2D$5$l$F$$$k0lJ}$G!"(B
foozy@708: $B%f!<%6(B \texttt{intern} $B$O(B
foozy@708: \dirname{source/sensitive} 
foozy@708: $B0J30$NG$0U$N%G%#%l%/%H%j!&%U%!%$%k$KBP$9$kJQ99$r(B
foozy@708: push $B2DG=$G$9(B
foozy@708: \footnote{$BLuCm!'(B
foozy@708: $B@_Dj$NH=Dj=g=x$O(B (1) $B6X;_(B (2) $B5v2D$N=g=x$G9T$o$l!"(B
foozy@708: (1) $B6X;_@_Dj$,$"$j!"Ev3:%f!<%6$N%"%/%;%9$,L@<(E*$K6X;_$5$l$F$$$k>l9g$H!"(B
foozy@708: (2) $B5v2D@_Dj$,$"$j!"Ev3:%f!<%6$N%"%/%;%9$,L@<(E*$K5v2D$5$l$F!V$$$J$$!W>l9g$K!"(B
foozy@708: $BIT@5%"%/%;%9$H$_$J$5$l!"(B
foozy@708: $B$=$l0J30$N>l9g$O%"%/%;%9$,5v2D$5$l$^$9!#(B}$B!#(B
foozy@708: 
foozy@708: \begin{codesample2}
foozy@708:   [acl.allow]
foozy@708:   docs/** = docwriter
foozy@708: 
foozy@708:   [acl.deny]
foozy@708:   source/sensitive/** = intern
foozy@708: \end{codesample2}
foozy@708: 
foozy@708: \subsubsection{Testing and troubleshooting}
foozy@708: 
foozy@708: \hgext{acl} $B%U%C%/$r;n$7$F$_$?$$>l9g!"(B
foozy@708: Mercurial $B$N%G%P%C%0=PNO$rM-8z$K$7$F<B9T$7$^$7$g$&!#(B
foozy@708: \hggopt{--debug} $B%*%W%7%g%s$r;XDj$7Fq$$!J$"$k$$$OIT2DG=$J!K(B
foozy@708: $B%5!<%P>e$G<B9T$9$k$3$H$b$"$k$G$7$g$&$+$i!"(B
foozy@708: $B%5!<%PB&$N(B \hgrc $B%U%!%$%k$G%G%P%C%0=PNO$rM-8z2=$G$-$k$3$H$r$*K:$l$J$/!#(B
foozy@708: 
foozy@708: \begin{codesample2}
foozy@708:   [ui]
foozy@708:   debug = true
foozy@708: \end{codesample2}
foozy@708: 
foozy@708: $B$3$l$rM-8z$K$9$k$3$H$G!"(B
foozy@708: $BEv3:%f!<%6$K$h$k(B push 
foozy@708: $B$r5v2D!&6X;_$9$kM}M3$rH=CG$9$k$KB-$k>pJs$rI=<($9$k$3$H$G$7$g$&!#(B
foozy@708: 
foozy@708: \subsection{\hgext{bugzilla}---integration with Bugzilla}
foozy@708: 
foozy@708: \hgext{bugzilla} $B3HD%$O!"(B
foozy@708: $B%3%_%C%H%a%C%;!<%8$K%P%0(BID$B$r8!CN$7$?:]$K(B
foozy@708: Bugzilla $B%P%0$X$N%3%a%s%HDI2C$r9T$$$^$9!#(B
foozy@708: $B$3$N%U%C%/$r6&M-%5!<%P$K@_Dj$9$k$3$H$G!"(B
foozy@708: $B$3$N%5!<%P$X$N%j%b!<%H$+$i$NJQ99EAGE$N:]$K$O!"(B
foozy@708: $B>o$K$3$N%U%C%/$,<B9T$5$l$^$9!#(B
foozy@708: 
foozy@708: $B$3$N%U%C%/$O(B Bugzilla $B%P%0$K!"(B
foozy@708: $B0J2<$N$h$&$J%3%a%s%H$rDI2C$7$^$9(B
foozy@708: $B!JJ}K!$O8e=R$7$^$9$,!"%3%a%s%HFbMF$OJQ99$G$-$^$9!K!#(B
foozy@708: 
foozy@708: \begin{codesample2}
foozy@708:   Changeset aad8b264143a, made by Joe User <joe.user@domain.com> in
foozy@708:   the frobnitz repository, refers to this bug.
foozy@708: 
foozy@708:   For complete details, see
foozy@708:   http://hg.domain.com/frobnitz?cmd=changeset;node=aad8b264143a
foozy@708: 
foozy@708:   Changeset description:
foozy@708:         Fix bug 10483 by guarding against some NULL pointers
foozy@708: \end{codesample2}
foozy@708: 
foozy@708: $B$3$N%U%C%/$N2ACM$O!"(B
foozy@708: $B%A%'%s%8%;%C%H!J$N%3%_%C%H%a%C%;!<%8!K$,%P%0$r;2>H$7$F$$$k:]$K!"(B
foozy@708: $B%P%0>pJs$r99?7$9$k<j=g$r<+F02=$9$kE@$K$"$j$^$9!#(B
foozy@708: $B%U%C%/$N@_Dj$rE,@Z$K9T$&$3$H$G!"(B
foozy@708: Bugzilla $B%P%0$+$i;2>H85%A%'%s%8%;%C%H$X$H!"(B
foozy@708: $B0lD>@~$KE~C#$9$k$3$H$,MF0W$K$J$j$^$9!#(B
foozy@708: 
foozy@708: $B$3$N%U%C%/$N<BAu$rB-3]$j$K$7$F!"(B
foozy@708: $B$h$j9bEY$J(B Bugzilla $B$H$NE}9g$r?^$k$3$H$b2DG=$G$9!#(B
foozy@708: $BNc$($P(B:
foozy@708: 
foozy@708: \begin{itemize}
foozy@708: \item $B%5!<%P$K(B push $B$5$l$kA4$F$N%A%'%s%8%;%C%H$K$O!"(B
foozy@708:   $B%3%_%C%H%a%C%;!<%8$KE,@Z$J%P%0(B~ID$B$,4^$^$l$F$$$k$3$H$rMW5a(B:
foozy@708:   $B$3$N>l9g!"(B\hook{pretxncommit} 
foozy@708:   $B%U%C%/$KEv3:>r7o$r8!>Z$9$k%U%C%/$r@_Dj$9$k$N$,NI$$$G$7$g$&!#(B
foozy@708:   $B%3%_%C%H%a%C%;!<%8$,%P%0(B~ID$B$r4^$^$J$$%A%'%s%8%;%C%H$O!"(B
foozy@708:   $B%U%C%/$K$h$C$F5qH]$5$l$k$h$&$K$J$j$^$9!#(B
foozy@708: 
foozy@708: \item $B?75,$N%A%'%s%8%;%C%H$KBP$7$F!"(B
foozy@708:   $B4JC1$J%3%a%s%H$NIUM?$HF1MM$K!"(B
foozy@708:   $B%P%0$N(B\emph{$B>uBV(B}$B$N<+F0E*$JJQ99$r5v2D(B:
foozy@708:   $BNc$($P!"(B``fixed bug 31337'' $B$H$$$&%3%_%C%H%a%C%;!<%8$NJ8;zNs$r!"(B
foozy@708:   $B%P%0(B 31337 $B$N>uBV$N(B ``requires testing'' $B$X$N99?7!"(B
foozy@708:   $B$HG'<1$5$;$k!"$H$$$C$?3HD%$b9M$($i$l$^$9!#(B
foozy@708: 
foozy@708: \end{itemize}
foozy@708: 
foozy@708: \subsubsection{Configuring the \hook{bugzilla} hook}
foozy@708: \label{sec:hook:bugzilla:config}
foozy@708: 
foozy@708: \hook{bugzilla} $B%U%C%/$O!"(B
foozy@708: $B%5!<%PB&$N(B  \hgrc\ $BCf$G(B \hook{incoming} $B%U%C%/$H$7$F@_Dj$7$J$1$l$P$J$j$^$;$s!#(B
foozy@708: 
foozy@708: \begin{codesample2}
foozy@708:   [hooks]
foozy@708:   incoming.bugzilla = python:hgext.bugzilla.hook
foozy@708: \end{codesample2}
foozy@708: 
foozy@708: $B5!G=FC2=$5$l$?%U%C%/$N@-<A$H!"(B
foozy@708: Bugzilla $B$,85!9$3$N<o$NE}9g$rG0F,$KCV$$$F$$$J$$$3$H$+$i!"(B
foozy@708: $B$3$N%U%C%/$N@_Dj$O2?$+$HJ#;($K$J$j$^$9!#(B
foozy@708: 
foozy@708: $B%U%C%/$N@_Dj$K@hN)$C$F!"(B
foozy@708: $B%U%C%/$,<B9T$5$l$k%[%9%H!J72!K$KBP$7$F!"(B
foozy@708: MySQL $B$N(B Python $B%P%$%s%G%#%s%0$r%$%s%9%H!<%k$7$F$/$@$5$$!#(B
foozy@708: $BBP>]%[%9%H$K$*$$$F%P%$%J%j%Q%C%1!<%8$,8+Ev$?$i$J$$>l9g!"(B
foozy@708: \cite{web:mysql-python} $B$+$i%@%&%s%m!<%I$G$-$^$9!#(B
foozy@708: 
foozy@708: $B%U%C%/$N@_Dj$O!"(B
foozy@708:  \hgrc\ $B%U%!%$%k$N(B
foozy@708: \rcsection{bugzilla} $B%;%/%7%g%s$K5-=R$5$l$^$9!#(B
foozy@708: 
foozy@708: \begin{description}
foozy@708: 
foozy@708: \item[\rcitem{bugzilla}{version}] $B%5!<%P$K%$%s%9%H!<%k$5$l$F$$$k(B
foozy@708:   Bugzilla $B$N%P!<%8%g%s!#(B
foozy@708:   Bugzilla $B$N%G!<%?%Y!<%9%9%-!<%^$O;~@^JQ99$5$l$^$9$N$G!"(B
foozy@708:   $B$I$N%9%-!<%^$,;HMQ$5$l$F$$$k$N$+$r87L)$KCN$C$F$$$kI,MW$,$"$j$^$9!#(B
foozy@708:   $B:#$N$H$3$m!"%5%]!<%HBP>]$O(B \texttt{2.16} $B$N$_$G$9!#(B
foozy@708: 
foozy@708: \item[\rcitem{bugzilla}{host}] Bugzilla $B$N%G!<%?$,3JG<$5$l$F$$$k(B
foozy@708:   MySQL $B%5!<%P$,2TF0$7$F$$$k%[%9%HL>!#(B
foozy@708:   MySQL $B%5!<%P$O!"(B\hook{bugzilla} $B%U%C%/$,<B9T$5$l$kA4$F$N%[%9%H$KBP$7$F!"(B
foozy@708:   $B@\B3$r5v2D$7$F$$$kI,MW$,$"$j$^$9!#(B
foozy@708: 
foozy@708: \item[\rcitem{bugzilla}{user}] MySQL $B%5!<%P$X$N@\B3;~$K;HMQ$9$k%f!<%6L>!#(B
foozy@708:   MySQL $B%5!<%P$O!"(B\hook{bugzilla} $B%U%C%/$,<B9T$5$l$kA4$F$N%[%9%H$KBP$7$F!"(B
foozy@708:   $B$3$N%f!<%6L>$G$N@\B3$r5v2D$7$F$$$kI,MW$,$"$j$^$9!#(B
foozy@708:   $B$3$N%f!<%6$O!"(B
foozy@708:   Bugzilla $B$,;HMQ$9$k%F!<%V%k$KBP$7$FFI$_<h$j!&JQ99$NN>J}$N8"8B$,I,MW$G$9!#(B
foozy@708:   $B$3$N9`L\$N4{DjCM$O!"(B
foozy@708:   MySQL $B%5!<%P$K$*$1$k(B Bugzilla $B$NI8=`E*$J%f!<%6L>$G$"$k(B
foozy@708:  \texttt{bugs} $B$G$9!#(B
foozy@708: 
foozy@708: \item[\rcitem{bugzilla}{password}] $B>e5-%f!<%6$N(B 
foozy@708:   MySQL $B%5!<%P$K$*$1$k%Q%9%o!<%I!#(B
foozy@708:   $B$3$NCM$OJ?J8$G3JG<$5$l$k$?$a!"(B
foozy@708:   $B8"8B$r;}$?$J$$%f!<%6$,$3$N>pJs$N=q$+$l$?(B \hgrc 
foozy@708:   $B%U%!%$%k$rGA$/$3$H$,L5$$$h$&$K$7$J$1$l$P$J$j$^$;$s!#(B
foozy@708: 
foozy@708: \item[\rcitem{bugzilla}{db}] MySQL $B%5!<%P$K$*$1$k(B
foozy@708:   Bugzilla $B%G!<%?%Y!<%9$NL>A0!#(B
foozy@708:   $B$3$N9`L\$N4{DjCM$O!"(B
foozy@708:   MySQL $B%5!<%P$K$*$1$k(B Bugzilla $B$NI8=`E*$J%G!<%?%Y!<%9L>$G$"$k(B
foozy@708:  \texttt{bugs} $B$G$9!#(B
foozy@708: 
foozy@708: \item[\rcitem{bugzilla}{notify}] $B%U%C%/$K$h$k%P%0$X$N%3%a%s%HIUM?;~$K!"(B
foozy@708:   Bugzilla $B$K$h$k9XFI<T$X$NEE;R%a!<%kDLCN$r<B;\$7$?$$>l9g!"(B
foozy@708:   $B%G!<%?%Y!<%9$r99?7$9$kKh$K%3%^%s%I$r<B9T$5$;$kI,MW$,$"$j$^$9!#(B
foozy@708:   $B<B9T$9$k%3%^%s%I$O(B Bugzilla $B$N%$%s%9%H!<%k>l=j$K0MB8$7$^$9$,!"(B
foozy@708:   \dirname{/var/www/html/bugzilla} $B$K%$%s%9%H!<%k$7$?$H$9$k$H!"(B
foozy@708:   $BDL>o$O0J2<$N$h$&$K$J$j$^$9!#(B
foozy@708: 
foozy@708:   \begin{codesample4}
foozy@708:     cd /var/www/html/bugzilla && ./processmail %s nobody@nowhere.com
foozy@708:   \end{codesample4}
foozy@708: 
foozy@708:   Bugzilla $B$N(B \texttt{processmail} $B%W%m%0%i%`$O!"(B
foozy@708:   $B%P%0(B~ID$B!J%U%C%/$K$h$j(B ``\texttt{\%s}'' $B$,(B $B%P%0(B~ID $B$KCV49$5$l$^$9!K$H!"(B
foozy@708:   $BEE;R%a!<%k%"%I%l%9$rI,MW$H$7$^$9!#(B
foozy@708:   $B$3$N%W%m%0%i%`$O!"(B
foozy@708:   $B<B9T;~%G%#%l%/%H%j$X$N%U%!%$%k=q$-=P$7$N8"8B$bI,MW$H$7$^$9!#(B
foozy@708:   Bugzilla $B$H%U%C%/$,F1$8%5!<%P>e$K%$%s%9%H!<%k$5$l$F$$$J$$>l9g!"(B
foozy@708:   Bugzilla $B$,%$%s%9%H!<%k$5$l$F$$$k%5!<%P>e$G(B 
foozy@708:   \texttt{processmail} $B$r5/F0$9$kJ}K!$r8+$D$1=P$9I,MW$,$"$j$^$9!#(B
foozy@708: 
foozy@708: \end{description}
foozy@708: 
foozy@708: \subsubsection{Mapping committer names to Bugzilla user names}
foozy@708: 
foozy@708: $B4{Dj>uBV$N(B \hgext{bugzilla} $B%U%C%/$O!"(B
foozy@708: $B%A%'%s%8%;%C%H$r%3%_%C%H$7$?%f!<%6$NEE;R%a!<%k%"%I%l%9$r!"(B
foozy@708: $B%P%0$N99?7$r9T$&(B Bugzilla $B%f!<%6L>$H$7$F;HMQ$9$k$3$H$r;n$_$^$9!#(B
foozy@708: $B$3$N5sF0$,>u67$KB($5$J$$>l9g!"(B
foozy@708: \rcsection{usermap} $B%;%/%7%g%s$r;HMQ$7$F!"(B
foozy@708: $B%A%'%s%8%;%C%H$r%3%_%C%H$7$?%f!<%6$NEE;R%a!<%k%"%I%l%9$r(B
foozy@708: Bugzilla $B$N%f!<%6L>$KJQ49$9$k$3$H$,$G$-$^$9!#(B
foozy@708: 
foozy@708: \rcsection{usermap} $B%;%/%7%g%s$N8D!9$NMWAG$O!"(B
foozy@708: $B:8JU$KEE;R%a!<%k%"%I%l%9!"(B
foozy@708: $B1&JU$K(B Bugzilla $B%f!<%6L>$rJ];}$7$^$9!#(B
foozy@708: 
foozy@708: \begin{codesample2}
foozy@708:   [usermap]
foozy@708:   jane.user@example.com = jane
foozy@708: \end{codesample2}
foozy@708: 
foozy@708: $BDL>o$N(B \hgrc $B%U%!%$%k$K(B
foozy@708: \rcsection{usermap} $B%G!<%?$rD>@\J];}$9$k$3$H$b$G$-$^$9$,!"(B
foozy@708: \hgext{bugzilla} $B%U%C%/$K30It$N(B 
foozy@708: \filename{usermap} $B%U%!%$%k$+$i>pJs$rFI$_9~$`$h$&$K;X<($9$k$3$H$b$G$-$^$9!#(B
foozy@708: $B8e<T$N>l9g!"Nc$($P(B \filename{usermap} $B%G!<%?$=$N$b$N$r!"(B
foozy@708: $BMxMQ<T$,2~JQ2DG=$J%j%]%8%H%j$K3JG<$9$k$3$H$b$G$-$^$9!#(B
foozy@708: $B$=$&$9$k$3$H$G!"(B
foozy@708: $BMxMQ<T<+?H$,(B
foozy@708: \rcitem{bugzilla}{usermap} $BCf$N3F<+$NMWAG$rJ]<i$9$k$3$H$,$G$-$^$9!#(B
foozy@708: $B$3$N>l9g$N(B \hgrc\ $B%U%!%$%k$O0J2<$N$h$&$K5-=R$5$l$^$9!#(B
foozy@708: 
foozy@708: \begin{codesample2}
foozy@708:   # $BDL>o$N(B hgrc $B%U%!%$%k$O(B usermap $B30It%U%!%$%k$r;2>H(B
foozy@708:   [bugzilla]
foozy@708:   usermap = /home/hg/repos/userdata/bugzilla-usermap.conf
foozy@708: \end{codesample2}
foozy@708: 
foozy@708: \filename{usermap} $B$,;2>H$9$k%U%!%$%k$NFbMF$O!"(B
foozy@708: $B0J2<$N$h$&$K$J$j$^$9!#(B
foozy@708: 
foozy@708: \begin{codesample2}
foozy@708:   # bugzilla-usermap.conf $B$O(B hg $B%j%]%8%H%jFb$KG[CV(B
foozy@708:   [usermap]
foozy@708:   stephanie@example.com = steph
foozy@708: \end{codesample2}
foozy@708: 
foozy@708: \subsubsection{Configuring the text that gets added to a bug}
foozy@708: 
foozy@708: Mercurial $B$N%F%s%W%l!<%H7A<0$G5-=R$9$k$3$H$G!"(B
foozy@708: \hgext{bugzilla} $B%U%C%/$,DI2C$9$k%3%a%s%H$NFbMF$r@_Dj$9$k$3$H$,2DG=$G$9!#(B
foozy@708: $B4v$D$+$N!J(B\rcsection{bugzilla} $B%;%/%7%g%s$K$*$1$k!K(B \hgrc\ $BMWAG$K$h$j!"(B
foozy@708: $B!J%F%s%W%l!<%H$N!)!K?6$kIq$$$r@)8f$9$k$3$H$,$G$-$^$9!#(B
foozy@708: 
foozy@708: \begin{description}
foozy@708: \item[\texttt{strip}] URL $B$K$*$1$kItJ,%Q%9L>!J(Ba
foozy@708:   partial path for a URL$B!K$r@8@.$9$k:]$K!"(B
foozy@708:   $B%j%]%8%H%j$K$*$1$k%Q%9L>$+$i<h$j=|$/%Q%9MWAG$N?t$r;XDj$7$^$9!#(B
foozy@708:   $BNc$($P!"%5!<%P$K$*$1$k%j%]%8%H%j72$,(B \dirname{/home/hg/repos} $BG[2<$K$"$j!"(B
foozy@708:   \dirname{/home/hg/repos/app/tests} $B$N%j%]%8%H%j$rBP>]$H$9$k>l9g!"(B
foozy@708:   \texttt{strip} $B$r(B \texttt{4} $B$H$9$k$3$H$G!"(B
foozy@708:   \dirname{app/tests} $B$H$$$&ItJ,%Q%9$rF@$k$3$H$,$G$-$^$9!#(B
foozy@708:   \hgext{bugzilla} $B%U%C%/$O$3$NItJ,%Q%9L>$r!"(B
foozy@708:   $B%F%s%W%l!<%H$NE,MQ$N:]$K(B \texttt{webroot} $B$H$$$&L>A0$GMxMQ2DG=$K$7$^$9!#(B
foozy@708: 
foozy@708: \item[\texttt{template}] $B;HMQ$9$k%F%s%W%l!<%H%F%-%9%H$r;XDj$7$^$9!#(B
foozy@708:   $BDL>o$N%A%'%s%8%;%C%H4XO"$NCV49$K2C$($F!"(B
foozy@708:   $B$3$N%F%s%W%l!<%H$G$O(B \texttt{hgweb}$B!J8e=RNc$K$"$k$h$&$K(B
foozy@708:   \texttt{hgweb} $B9`L\$G@_Dj$7$^$9!K(B
foozy@708:   $B$*$h$S(B \texttt{webroot}$B!JA0=R$N$h$&$K(B
foozy@708:   \texttt{strip} $B$K$h$C$F@8@.$5$l$k%Q%9$G$9!K$,;HMQ$G$-$^$9!#(B
foozy@708: 
foozy@708: \end{description}
foozy@708: 
foozy@708: $B$3$l$i$K2C$($F!"(B
foozy@708:  \hgrc\ $B%U%!%$%k$N(B \rcsection{web} $B%;%/%7%g%s$K(B
foozy@708: \rcitem{web}{baseurl} $B9`L\$rDI2C$9$k$3$H$,$G$-$^$9!#(B
foozy@708: Bugzilla $B%3%a%s%H$+$i$N%A%'%s%8%;%C%H;2>H$K;HMQ$9$k%j%s%/$N(B
foozy@708: URL $B$r9=C[$9$k:]$N4pDlJ8;zNs$H$7$F(B
foozy@708: \hgext{bugzilla} $B%U%C%/$O%F%s%W%l!<%HE83+$N:]$K$3$NCM$r;HMQ$7$^$9!#(B
foozy@708: $BNc$($P!'(B
foozy@708: 
foozy@708: \begin{codesample2}
foozy@708:   [web]
foozy@708:   baseurl = http://hg.domain.com/
foozy@708: \end{codesample2}
foozy@708: 
foozy@708: \hgext{bugzilla} $B%U%C%/$N@_DjNc$r0J2<$K<($7$^$9(B\footnote{$BLuCm(B:
foozy@708: $B86J8$N(B ``\\n'' $B$,@5$7$/5!G=$7$F$$$J$$$?$a!"(B
foozy@708: $BNc<($N%l%$%"%&%H$,Mp$l$F$$$k(B}$B!#(B
foozy@708: 
foozy@708: \begin{codesample2}
foozy@708:   [bugzilla]
foozy@708:   host = bugzilla.example.com
foozy@708:   password = mypassword
foozy@708:   version = 2.16
foozy@708:   # $B%5!<%PB&%j%]%8%H%j$O(B /home/hg/repos $B$K$"$k$?$a!"(B
foozy@708:   # $BKAF,$N(B 4 $B$D$N%;%Q%l!<%?(B\footnote{$BLuCm(B: $B%Q%96h@Z$j(B ``/''}$B$r=|30(B
foozy@708:   strip = 4
foozy@708:   hgweb = http://hg.example.com/
foozy@708:   usermap = /home/hg/repos/notify/bugzilla.conf
foozy@708:   template = Changeset \{node|short\}, made by \{author\} in the \{webroot\}
foozy@708:     repo, refers to this bug.\\nFor complete details, see 
foozy@708:     \{hgweb\}\{webroot\}?cmd=changeset;node=\{node|short\}\\nChangeset
foozy@708:     description:\\n\\t\{desc|tabindent\}
foozy@708: \end{codesample2}
foozy@708: 
foozy@708: \subsubsection{Testing and troubleshooting}
foozy@708: 
foozy@708: \hgext{bugzilla} $B%U%C%/@_Dj$K$*$$$F:G$bNI$/$"$kLdBj$O!"(B
foozy@708: Bugzilla $B$N(B \filename{processmail} $B%9%/%j%W%H<B9T$K4X$9$k$b$N$H!"(B
foozy@708: $B%3%_%C%H%f!<%6L>$+$i(B Bugzilla $B%f!<%6L>$X$NJQ49$K4X$9$k$b$N$G$9!#(B
foozy@708: 
foozy@708: $B@h$N(B \ref{sec:hook:bugzilla:config}~$B@a$+$i$N@bL@$G=R$Y$?$h$&$K!"(B
foozy@708: Mercurial $B%W%m%;%9$r%5!<%P$G<B9T$9$k%f!<%6$,!"(B
foozy@708: \filename{processmail} $B%9%/%j%W%H$r<B9T$9$k%f!<%6$G$b$"$j$^$9!#(B
foozy@708: \filename{processmail} $B%9%/%j%W%H$O(B
foozy@708: Bugzilla $B$,@_Dj%G%#%l%/%H%jCf$N%U%!%$%k$K2?$i$+$N>pJs$r=q$-=P$97@5!$H$J$k$?$a!"(B
foozy@708: $BDL>o(B Bugzilla $B$N@_Dj%U%!%$%k$O(B
foozy@708: Bugzilla $B$,F0:n$9$k%&%'%V%5!<%P$N<B9T<T$N8"8B2<$K$"$j$^$9!#(B
foozy@708: 
foozy@708: \filename{processmail} $B<B9T$N:]$K$O!"(B
foozy@708: \command{sudo} $B%3%^%s%I$rMxMQ$9$k$J$I$7$FE,@Z$J%f!<%68"8B$G<B9T$7$^$7$g$&!#(B
foozy@708: \filename{sudoers} $B%U%#%k$N@_DjNc$r0J2<$K<($7$^$9!#(B
foozy@708: 
foozy@708: \begin{codesample2}
foozy@708:   hg_user = (httpd_user) NOPASSWD: /var/www/html/bugzilla/processmail-wrapper %s
foozy@708: \end{codesample2}
foozy@708: 
foozy@708: $B$3$NNc$G$O!"(B\texttt{hg\_user} $B%f!<%6$O!"(B
foozy@708: \filename{processmail-wrapper} $B%W%m%0%i%`$r(B
foozy@708: \texttt{httpd\_user} $B%f!<%6$N8"8B2<$G<B9T$9$k$3$H$,$G$-$^$9!#(B
foozy@708: 
foozy@708: \filename{processmail} $B%W%m%0%i%`$O(B
foozy@708: Bugzilla $B$r%$%s%9%H!<%k$7$?%G%#%l%/%H%jD>2<$G$N<B9T$,I,MW$G$9$,!"(B
foozy@708: \filename{sudoers} $B%U%!%$%k$K$O$=$N$h$&$J@)Ls$r5-=R$9$k$3$H$,$G$-$J$$$N$G!"(B
foozy@708: $B$3$N$h$&$J4V@\<B9T$N$?$a$N%i%C%Q!<%9%/%j%W%H$,I,MW$H$J$j$^$9!#(B
foozy@708: $B%i%C%Q!<%9%/%j%W%H$NFbMF$O0J2<$N$h$&$K4JC1$J$b$N$G$9!#(B
foozy@708: 
foozy@708: \begin{codesample2}
foozy@708:   #!/bin/sh
foozy@708:   cd `dirname $0` && ./processmail "$1" nobody@example.com
foozy@708: \end{codesample2}
foozy@708: 
foozy@708: \filename{processmail} 
foozy@708: $B$K;XDj$9$kEE;R%a!<%k%"%I%l%9$O!"(B
foozy@708: $B$I$N$h$&$J$b$N$G$b9=$$$^$;$s!#(B
foozy@708: 
foozy@708: \rcsection{usermap} $B$,@5$7$/@_Dj$5$l$F$$$J$$>l9g!"(B
foozy@708: $B%A%'%s%8%;%C%H$r%5!<%P$K(B push $B$7$?:]$K(B
foozy@708: \hgext{bugzilla} $B%U%C%/$K$h$j%(%i!<%a%C%;!<%8$,I=<($5$l$^$9!#(B
foozy@708: $B%(%i!<%a%C%;!<%8$O0J2<$N$h$&$J$b$N$G$9!#(B
foozy@708: 
foozy@708: \begin{codesample2}
foozy@708:   cannot find bugzilla user id for john.q.public@example.com
foozy@708: \end{codesample2}
foozy@708: 
foozy@708: $B$3$N%a%C%;!<%8$O!"(B
foozy@708: $B%3%_%C%H$7$?%f!<%6$NEE;R%a!<%k%"%I%l%9(B
foozy@708: \texttt{john.q.public@example.com} 
foozy@708: $B$,M-8z$J(B Bugzilla $B%f!<%6L>$G$O$J$$$+!"(B
foozy@708: \texttt{john.q.public@example.com} 
foozy@708: $B$rM-8z$J(B Bugzilla $B%f!<%6L>$KJQ49$9$k%(%s%H%j$,(B
foozy@708: rcsection{usermap} $B$K5-=R$5$l$F$$$J$$$3$H$r0UL#$7$^$9!#(B
foozy@708: 
foozy@708: \subsection{\hgext{notify}---send email notifications}
foozy@708: 
foozy@708: Mercurial $B$NAH$_9~$_%&%'%V%5!<%P$K$h$j!"(B
foozy@708: $BA4$F$N%j%]%8%H%j$KBP$7$F%A%'%s%8%;%C%H>pJs$N(B RSS $BG[?.5!G=$,Ds6!$5$l$^$9$,!"(B
foozy@708: $BEE;R%a!<%k$K$h$kJQ99DLCN$,A*Br$5$l$k>l9g$,B?$$$G$9!#(B
foozy@708: \hgext{notify} $B%U%C%/$O!"(B
foozy@708: $B9XFI<T$,6=L#$r;}$D?7$?$J%A%'%s%8%;%C%H$4$H$K!"(B
foozy@708: $BEE;R%a!<%k%"%I%l%9!J72!K$K08$F$FDLCN$r9T$$$^$9!#(B
foozy@708: 
foozy@708: \hgext{notify} $B$O%F%s%W%l!<%H6nF07?$N%U%C%/$G$9$N$G!"(B
foozy@708: \hgext{bugzilla} $B%U%C%/$HF1MM$K!"(B
foozy@708: $BAw?.$5$l$kDLCN$NFbMF$r%+%9%?%^%$%:$9$k$3$H$,$G$-$^$9!#(B
foozy@708: 
foozy@708: $B4{Dj>uBV$G$O(B
foozy@708: \hgext{notify} $B%U%C%/$O%A%'%s%8%;%C%H$4$H$N:9J,>pJs$r<h$j9~$_$^$9$,!"(B
foozy@708: $B:9J,>pJs$NNL$r@)8B$7$?$j!"(B
foozy@708: $B$3$N5!G=$r40A4$KDd;_$9$k$3$H$b$G$-$^$9!#(B
foozy@708: $B9XFI<T$K$h$kJQ99$NB(;~%l%S%e!<$rA[Dj$9$k>l9g!"(B
foozy@708: $B;XDj$5$l$?(B URL $B$r%/%j%C%/$9$k$h$j$b!"(B
foozy@708: $B:9J,>pJs$r<h$j9~$`$[$&$,M-MQ$G$9!#(B
foozy@708: 
foozy@708: \subsubsection{Configuring the \hgext{notify} hook}
foozy@708: 
foozy@708: \hgext{notify} $B%U%C%/$O!"(B
foozy@708: $B?7$?$J%A%'%s%8%;%C%H$4$H$K#1DL$NEE;R%a!<%k$rAw?.$9$k$3$H$b$G$-$l$P!"(B
foozy@708: $B!JC1FH$N(B \hgcmd{pull} $B$J$$$7(B \hgcmd{push} $B$K$h$j%j%]%8%H%j$KDI2C$5$l$k(B
foozy@708: $B!K?7$?$J%A%'%s%8%;%C%H72$4$H$KAw?.$9$k$3$H$b$G$-$^$9!#(B
foozy@708: 
foozy@708: \begin{codesample2}
foozy@708:   [hooks]
foozy@708:   # $B%A%'%s%8%;%C%H72$4$H$K#1DL$N%a!<%k$rAw?.(B
foozy@708:   changegroup.notify = python:hgext.notify.hook
foozy@708:   # $B%A%'%s%8%;%C%H$4$H$K#1DL$N%a!<%k$rAw?.(B
foozy@708:   incoming.notify = python:hgext.notify.hook
foozy@708: \end{codesample2}
foozy@708: 
foozy@708: $B$3$N%U%C%/$N@_Dj>pJs$O!"(B
foozy@708:  \hgrc\ $B%U%!%$%k$N(B
foozy@708: \rcsection{notify} $B%;%/%7%g%s$K5-=R$5$l$^$9!#(B
foozy@708: 
foozy@708: \begin{description}
foozy@708: \item[\rcitem{notify}{test}] $B4{Dj>uBV$G$O!"(B
foozy@708:   $B$3$N%U%C%/$OA4$/%a!<%k$rAw?.$7$^$;$s!#(B
foozy@708:   $B$=$NBX$o$j!"Aw?.$9$k(B\emph{$B$G$"$m$&(B}$B%a%C%;!<%8$rI=<($7$^$9!#(B
foozy@708:   $B$3$N9`L\$r(B \texttt{false} $B$K$9$k$3$H$GEE;R%a!<%k$,Aw?.$5$l$k$h$&$K$J$j$^$9!#(B
foozy@708:   $B4pDl>uBV$GEE;R%a!<%k$NAw?.$,Dd;_$5$l$F$$$k$N$O!"(B
foozy@708:   $B$3$N3HD%!J!?%U%C%/!K$r$-$A$s$H@_Dj$9$k$N$K$O4vJ,$+$N;n9T:x8m$,I,MW$J$N$G!"(B
foozy@708:   $B@_Dj;n9TCf$K(B``$B2u$l$?(B''$BDLCN$r9XFI<T$KAw?.$7$F$7$^$&$?$a$G$9!#(B
foozy@708: 
foozy@708: \item[\rcitem{notify}{config}] $B9XFI>pJs$rJ];}$7$F$$$k@_Dj%U%!%$%k$X$N%Q%9!#(B
foozy@708:   $B$3$N>pJs$O(B \hgrc\ $B$H$OJ,N%$5$l$F$$$k$N$G!"(B
foozy@708:   $B$3$N%U%!%$%k$=$N$b$N$rBP>]%j%]%8%H%j$G4IM}$9$k$3$H$b2DG=$G$9!#(B
foozy@708:   $B$3$&$9$k$3$H$G!"(B
foozy@708:   $BBP>]%j%]%8%H%j$rJ#@=$7!"9XFI@_Dj$r99?7$7$?>e$G!"(B
foozy@708:   $BJQ99$r%5!<%P$K(B \hgcmd{push} $B$GLa$9$3$H$,$G$-$^$9!#(B
foozy@708: 
foozy@708: \item[\rcitem{notify}{strip}] $B%j%]%8%H%j$KBP$9$k9XFI<T$NM-L5$rH=Dj$9$k:]$K!"(B
foozy@708:   $B%j%]%8%H%j$N%Q%9KAF,$+$i<h$j=|$/%Q%96h@Z$j$N?t(B\footnote{$BLuCm(B:
foozy@708:   $B$3$3$G$O(B strip $BBP>]$r(B
foozy@708:   ``leading path separator characters'' $B$HI=8=$7$F$$$k$,!"(B
foozy@708:   \rcsection{bugzilla} $B$N@bL@$G$O(B
foozy@708:   ``leading path elements'' $B$HI=8=$7$F$$$k!#(B
foozy@708:   $BE}0lE*$JI=8=$,I,MW$H;W$o$l$k!#(B}$B!#(B
foozy@708:   $BNc$($P!"(B
foozy@708:   $B%5!<%P>e$N%j%]%8%H%j$,(B \dirname{/home/hg/repos} $BG[2<$K$"$j!"(B
foozy@708:   \hgext{notify} $B$,(B
foozy@708:   \dirname{/home/hg/repos/shared/test} $B$H$$$&%j%]%8%H%j$rG'<1$7$F$$$k>l9g!"(B
foozy@708:   \rcitem{notify}{strip} $B$r(B \texttt{4} $B$K@_Dj$9$k$3$H$G(B
foozy@708:   \hgext{notify} $B$K$h$k9XFI<T$H$N%Q%?!<%s%^%C%A%s%0$O!"(B
foozy@708:   $B%Q%9$r(B \dirname{shared/test} $B$HG'<1$7$?>e$G9T$o$l$^$9!#(B
foozy@708: 
foozy@708: \item[\rcitem{notify}{template}] 
foozy@708:   $B%a%C%;!<%8Aw?.$N:]$K;HMQ$5$l$k%F%s%W%l!<%H%F%-%9%H!#(B
foozy@708:   $B$3$N%F%s%W%l!<%H$O!"%a%C%;!<%8$N%X%C%@$H%\%G%#$NN>J}$NFbMF$r;XDj$7$^$9!#(B
foozy@708: 
foozy@708: \item[\rcitem{notify}{maxdiff}] 
foozy@708:   $B%a%C%;!<%8KvHx$KIUM?$5$l$k:9J,%G!<%?$N:GBg9T?t!#(B
foozy@708:   $B$3$N9T?t$h$j$bBg$-$$>l9g!":9J,%G!<%?$O@Z$j5M$a$i$l$^$9!#(B
foozy@708:   $B$3$NCM$N4{DjCM$O(B 300 $B$K@_Dj$5$l$F$$$^$9!#(B
foozy@708:   $B$3$NCM$r(B \texttt{0} $B$K$7$?>l9g!"(B
foozy@708:   $BDLCN$NEE;R%a!<%k$K:9J,%G!<%?$OIUM?$5$l$^$;$s!#(B
foozy@708: 
foozy@708: \item[\rcitem{notify}{sources}] $BG[N8$9$Y$-%A%'%s%8%;%C%H$NM3Mh85$N0lMw!#(B
foozy@708:   $B$3$N@_Dj$K$h$jNc$($P!"(B
foozy@708:   $B1s3V%f!<%6$,%5!<%P$r7PM3$7$FEv3:%j%]%8%H%j$X(B
foozy@708:   \hgcmd{push} $B$7$?%A%'%s%8%;%C%H$KBP$7$F$N$_(B
foozy@708:   \hgext{notify} $B$,EE;R%a!<%k$GDLCN$9$k!"(B
foozy@708:   $B$H$$$C$?@_Dj$r$9$k$3$H$,$G$-$^$9!#(B
foozy@708:   $B$3$3$G5-=R2DG=$JM3Mh85$N0lMw$O!"(B\ref{sec:hook:sources}~$B@a$r;2>H$7$F$/$@$5$$!#(B
foozy@708: 
foozy@708: \end{description}
foozy@708: 
foozy@708: \rcsection{web} $B%;%/%7%g%s$G(B
foozy@708: \rcitem{web}{baseurl} $B9`L\$r@_Dj$7$F$$$k>l9g!"(B
foozy@708: $B%F%s%W%l!<%HCf$G(B \texttt{webroot} $B$H$7$F;HMQ$9$k$3$H$,$G$-$^$9!#(B
foozy@708: 
foozy@708: \hgext{notify} $B@_Dj>pJs$N0l<0$r0J2<$K<($7$^$9!#(B
foozy@708: 
foozy@708: \begin{codesample2}
foozy@708:   [notify]
foozy@708:   # $B<B:]$KEE;R%a!<%k$rAw$k$+H]$+(B
foozy@708:   test = false
foozy@708:   # $BDLCN$r9T$&%j%]%8%H%j<+?H$NCf$KCV$+$l$F$$$k9XFI<T>pJs(B
foozy@708:   config = /home/hg/repos/notify/notify.conf
foozy@708:   # $B%j%]%8%H%j$,(B /home/hg/repos $BG[2<$K$"$k$N$G(B "/" $BJ8;z$r(B4$B$D=|5n(B
foozy@708:   strip = 4
foozy@708:   template = X-Hg-Repo: \{webroot\}\\n\\\\
foozy@708:     Subject: \{webroot\}: \{desc|firstline|strip\}\\n\\\\
foozy@708:     From: \{author\}\\n\\\\
foozy@708:     \\n\\\\
foozy@708:     changeset \{node|short\} in \{root\}\\n\\\\
foozy@708:     details: \{baseurl\}\{webroot\}?cmd=changeset;node=\{node|short\}\\n\\\\
foozy@708:     description:\\n\\\\
foozy@708:     \\t\{desc|tabindent|strip\}
foozy@708: 
foozy@708:   [web]
foozy@708:   baseurl = http://hg.example.com/
foozy@708: \end{codesample2}
foozy@708: 
foozy@708: $B$3$N@_Dj$K$h$j!"(B
foozy@708: $B0J2<$N$h$&$J%a%C%;!<%8$,@8@.$5$l$^$9!#(B
foozy@708: 
foozy@708: \begin{codesample2}
foozy@708:   X-Hg-Repo: tests/slave
foozy@708:   Subject: tests/slave: Handle error case when slave has no buffers
foozy@708:   Date: Wed,  2 Aug 2006 15:25:46 -0700 (PDT)
foozy@708: 
foozy@708:   changeset 3cba9bfe74b5 in /home/hg/repos/tests/slave
foozy@708:   details: http://hg.example.com/tests/slave?cmd=changeset;node=3cba9bfe74b5
foozy@708:   description:
foozy@708:           Handle error case when slave has no buffers
foozy@708:   diffs (54 lines):
foozy@708: 
foozy@708:   diff -r 9d95df7cf2ad -r 3cba9bfe74b5 include/tests.h
foozy@708:   --- a/include/tests.h      Wed Aug 02 15:19:52 2006 -0700
foozy@708:   +++ b/include/tests.h      Wed Aug 02 15:25:26 2006 -0700
foozy@708:   @@ -212,6 +212,15 @@ static __inline__ void test_headers(void *h)
foozy@708:   [...snip...]
foozy@708: \end{codesample2}
foozy@708: 
foozy@708: \subsubsection{Testing and troubleshooting}
foozy@708: 
foozy@708: $B4{DjCM$N$^$^$G$O(B \hgext{notify} $B3HD%$O(B
foozy@708: \emph{$B0l@Z$N%a!<%k$rAw?.$7$^$;$s(B}$B$N$G!"(B
foozy@708: \rcitem{notify}{test} $B9`L\$rL@<(E*$K(B
foozy@708: \texttt{false} $B$G@_Dj$9$k$3$H$rK:$l$J$$$G$/$@$5$$!#(B
foozy@708: $B$3$N@_Dj$r9T$&$^$G$O!"(B
foozy@708: \hgext{notify} $B3HD%$OAw?.$9$k(B\emph{$B$G$"$m$&(B}$B%a%C%;!<%8$rI=<($7$^$9!#(B
foozy@708: 
foozy@708: \section{Information for writers of hooks}
foozy@708: \label{sec:hook:ref}
foozy@708: 
foozy@708: \subsection{In-process hook execution}
foozy@708: 
foozy@708: $B%W%m%;%9Fb%U%C%/$O!"0J2<$N0z?t7A<0$G5/F0$5$l$^$9!#(B
foozy@708: 
foozy@708: \begin{codesample2}
foozy@708:   def myhook(ui, repo, **kwargs):
foozy@708:       pass
foozy@708: \end{codesample2}
foozy@708: 
foozy@708: \texttt{ui} $B0z?t$O(B
foozy@708: \pymodclass{mercurial.ui}{ui} $B%*%V%8%'%/%H!"(B
foozy@708: \texttt{repo} $B0z?t$O(B
foozy@708: \pymodclass{mercurial.localrepo}{localrepository} $B%*%V%8%'%/%H$G$9!#(B
foozy@708: \texttt{**kwargs} $B%Q%i%a!<%?$N;}$DL>A0$HCM$O!"(B
foozy@708: $B5/F0$5$l$k%U%C%/$N<oN`$K0MB8$7!"(B
foozy@708: $B0J2<$N6&DL$NFCD'$r;}$C$F$$$^$9!#(B
foozy@708: 
foozy@708: \begin{itemize}
foozy@708: \item \texttt{node} $B$J$$$7(B \texttt{parent\emph{N}} $B$H$$$&L>A0$N0z?t$O!"(B
foozy@708:   16$B?J?t$N%A%'%s%8%;%C%H(BID$B$rJ];}$7$F$$$^$9!#(B
foozy@708:   $B6u$NJ8;zNs$O!"(B
foozy@708:   0 $BB3$-$NJ8;zNs$NBe$o$j$K(B ``null $B%A%'%s%8%;%C%H(BID'' $B$r0UL#$7$^$9!#(B
foozy@708: 
foozy@708: \item \texttt{url} $B$H$$$&L>A0$N0z?t$O!"(B
foozy@708:   $B$=$l$,FCDj2DG=$G$"$l$P!"1s3V%j%]%8%H%j$N(B URL $B$rI=$7$^$9!#(B
foozy@708: 
foozy@708: \item $B??56CM0z?t$O!"(BPython $B$N(B \texttt{bool} $B%*%V%8%'%/%H$GI=$5$l$^$9!#(B
foozy@708: 
foozy@708: \end{itemize}
foozy@708: 
foozy@708: $B%W%m%;%9Fb%U%C%/$O!"(B
foozy@708: $B!J30It%U%C%/$,%j%]%8%H%jD>2<$G<B9T$5$l$k$N$H0c$$!K(B
foozy@708: $B%W%m%;%9$N:n6H%G%#%l%/%H%j$rJQ99$;$:$K5/F0$5$l$^$9!#(B
foozy@708: $B%W%m%;%9$N:n6H%G%#%l%/%H%j$r0\F0$5$;$k$H!"(B
foozy@708: Mercurial API $B$N8F$S=P$7$,<:GT$9$kMW0x$H@.$j$($^$9$N$G!"(B
foozy@708: $B%W%m%;%9Fb%U%C%/$O:n6H%G%#%l%/%H%j$rJQ99$7$F$O$$$1$^$;$s!#(B
foozy@708: 
foozy@708: $B!J%W%m%;%9Fb!K%U%C%/$,??56CM(B ``false'' $B$rJV5Q$7$?>l9g!"(B
foozy@708: $B%U%C%/8F$S=P$7$O@.8y$7$?$b$N$H$_$J$5$l$^$9!#(B
foozy@708: $B??56CM(B ``true'' $B$,JV5Q$5$l$k$+!"(B
foozy@708: $BNc30$,IbMH$5$l$?>l9g!"(B
foozy@708: $B%U%C%/8F$S=P$7$O<:GT$7$?$b$N$H$_$J$5$l$^$9!#(B
foozy@708: $B5/F0$N47=,$rM}2r$9$k$K$O!"(B
foozy@708: ``$B<:GT$7$?$+H]$+$rDLCN$9$k(B''$B$H3P$($k$N$,NI$$$G$7$g$&!#(B
foozy@708: 
foozy@708: $B%A%'%s%8%;%C%H(BID$B$O!"(B
foozy@708: Mercurial API $B$,>oMQ$7$F$$$k%P%$%J%j%O%C%7%e7A<0$G$O$J$/!"(B
foozy@708: Python $B%U%C%/$K(B16$B?JJ8;zNs$N7A<0$GEO$5$l$kE@$KCm0U$7$F$/$@$5$$!#(B
foozy@708: 16$B?J%O%C%7%eCM$r%P%$%J%j%O%C%7%eCM7A<0$KJQ49$9$k$K$O!"(B
foozy@708: \pymodfunc{mercurial.node}{bin} $B4X?t$r;HMQ$7$F$/$@$5$$!#(B
foozy@708: 
foozy@708: \subsection{External hook execution}
foozy@708: 
foozy@708: $B%W%m%;%930%U%C%/!J$N5/F0J8;zNs!K$O!"(B
foozy@708: Mercurial $B$r<B9T$7$F$$$k%7%'%k$KEO$5$l$^$9!#(B
foozy@708: $B$=$N$?$a!"(B
foozy@708: $BJQ?tCV49$d%3%^%s%I=PNO$N%j%@%$%l%/%H$H$$$C$?!"(B
foozy@708: $B%7%'%k$N5!G=$,MxMQ2DG=$G$9!#(B
foozy@708: $B%W%m%;%930%U%C%/$O!"(B
foozy@708: $B!J%W%m%;%9Fb%U%C%/$,(B Mercurial $B$,5/F0$5$l$?%G%#%l%/%H%j$G<B9T$5$l$k$N$H0c$$!K(B
foozy@708: $B%j%]%8%H%j%k!<%HD>2<$G<B9T$5$l$^$9!#(B
foozy@708: 
foozy@708: $B%U%C%/0z?t$O!"4D6-JQ?t$r7PM3$7$FEO$5$l$^$9!#(B
foozy@708: $B8D!9$N4D6-JQ?t$NL>A0$O!"(B
foozy@708: $BBgJ8;z$G3n$D(B ``\texttt{HG\_}'' $B@\F,<-$,IUM?$5$l$?7A<0$KJQ49$5$l$^$9!#(B
foozy@708: $BNc$($P!"(B
foozy@708: $B0z?tL>$,(B ``\texttt{node}'' $B$N>l9g!"(B
foozy@708: $BEv3:0z?t$rI=$94D6-JQ?t$NL>A0$O(B ``\texttt{HG\_NODE}'' $B$H$J$j$^$9!#(B
foozy@708: 
foozy@708: $B??56CM0z?t$O!"(B
foozy@708: ``true'' $B$,J8;zNs(B ``\texttt{1}'' $B$G!"(B
foozy@708: ``false'' $B$,J8;zNs(B ``\texttt{0}'' $B$GI=$5$l$^$9!#(B
foozy@708: $B4D6-JQ?t(B
foozy@708: \envar{HG\_NODE}$B!"(B\envar{HG\_PARENT1} $B$J$$$7(B \envar{HG\_PARENT2} $B$O!"(B
foozy@708: $B%A%'%s%8%;%C%H(BID$B$r(B16$B?JJ8;zNs$GJ];}$7$^$9!#(B
foozy@708: ``$B6u$N%A%'%s%8%;%C%H(BID''$B$O!"(B
foozy@708: ``0'' $B$NO"B3$G$O$J$/6u$NJ8;zNs$H$7$FI=8=$5$l$^$9!#(B
foozy@708: $B4D6-JQ?t(B \envar{HG\_URL} $B$O!"(B
foozy@708: $B$=$l$,FCDj2DG=$J>l9g$K8B$j!"1s3V%j%]%8%H%j$N(B URL $B$rJ];}$7$^$9!#(B
foozy@708: 
foozy@708: $B%W%m%;%930%U%C%/$,=*N;%3!<%I(B0$B$G=*N;$7$?>l9g!"(B
foozy@708: $B%U%C%/$N<B9T$O@.8y$7$?$b$N$H$_$J$5$l$^$9!#(B
foozy@708: $B=*N;%3!<%I$,(B0$B0J30$N>l9g!"(B
foozy@708: $B%U%C%/$N<B9T$O<:GT$7$?$b$N$H$_$J$5$l$^$9!#(B
foozy@708: 
foozy@708: \subsection{Finding out where changesets come from}
foozy@708: 
foozy@708: $B%m!<%+%k%j%]%8%H%j$HB>$N%j%]%8%H%j$N4V$N%A%'%s%8%;%C%H$NE>Aw$K4X$o$k%U%C%/$O!"(B
foozy@708: ``$B8~$3$&B&(B''$B$N>pJs$rCN$k$3$H$,$G$-$k>l9g$,$"$j$^$9!#(B
foozy@708: Mercurial $B$O!"(B
foozy@708: $B%A%'%s%8%;%C%H$,(B\emph{$B$I$N$h$&$K$7$F(B}$BE>Aw$5$l$?$N$+$H!"(B
foozy@708: $BB?$/$N>l9g!"(B
foozy@708: \emph{$B$I$N%j%]%8%H%j(B}$B$H$N4V$G%A%'%s%8%;%C%H$,E>Aw$5$l$k$N$+$bCN$C$F$$$^$9!#(B
foozy@708: 
foozy@708: \subsubsection{Sources of changesets}
foozy@708: \label{sec:hook:sources}
foozy@708: 
foozy@708: Mercurial $B$O%j%]%8%H%j4V$G%A%'%s%8%;%C%H$rE>Aw$9$k0U?^$r!"(B
foozy@708: $B%U%C%/$KBP$7$F;vA0!J$J$$$7;v8e$K!KDLCN$7$^$9!#(B
foozy@708: $B$3$N>pJs$O!"(B
foozy@708: Python $B$K$h$k%W%m%;%9Fb%U%C%/$N>l9g$O(B \texttt{source} $B$H$$$&L>A0$N0z?t$G!"(B
foozy@708: $B30It%U%C%/$N>l9g$O(B \envar{HG\_SOURCE} $B$H$$$&L>A0$N4D6-JQ?t$G!"(B
foozy@708: Mercurial $B$+$i%U%C%/$KEO$5$l$^$9!#(B
foozy@708: 
foozy@708: \begin{description}
foozy@708: \item[\texttt{serve}] $B1s3V%j%]%8%H%j$H$N4V$r!"(B
foozy@708:   http $B$J$$$7(B ssh $B7PM3$G%A%'%s%8%;%C%H$,E>Aw$5$l$^$9!#(B
foozy@708: 
foozy@708: \item[\texttt{pull}] $B$"$k%j%]%8%H%j$+$iB>$N%j%]%8%H%j$X!"(B
foozy@708:   \hgcmd{pull} $B$K$h$j%A%'%s%8%;%C%H$,E>Aw$5$l$^$9!#(B
foozy@708: 
foozy@708: \item[\texttt{push}] $B$"$k%j%]%8%H%j$+$iB>$N%j%]%8%H%j$X!"(B
foozy@708:   \hgcmd{push} $B$K$h$j%A%'%s%8%;%C%H$,E>Aw$5$l$^$9!#(B
foozy@708: 
foozy@708: \item[\texttt{bundle}] $B$"$k%j%]%8%H%j$+$iB>$N%j%]%8%H%j$X!"(B
foozy@708:   \hgcmd{bundle} $B$K$h$j%A%'%s%8%;%C%H$,E>Aw$5$l$^$9!#(B
foozy@708: 
foozy@708: \end{description}
foozy@708: 
foozy@708: \subsubsection{Where changes are going---remote repository URLs}
foozy@708: \label{sec:hook:url}
foozy@708: 
foozy@708: Mercurial $B$O!"(B
foozy@708: $B%j%]%8%H%j4V$G$N%A%'%s%8%;%C%HE>Aw=hM}$K$*$1$k(B``$B8~$3$&B&(B''$B$N0LCV$r!"(B
foozy@708: $B2DG=$G$"$l$P%U%C%/$KCN$i$;$^$9!#(B
foozy@708: $B$3$N>pJs$O!"(B
foozy@708: Python $B$K$h$k%W%m%;%9Fb%U%C%/$N>l9g$O(B \texttt{url} $B$H$$$&L>A0$N0z?t$G!"(B
foozy@708: $B30It%U%C%/$N>l9g$O(B \envar{HG\_URL} $B$H$$$&L>A0$N4D6-JQ?t$G!"(B
foozy@708: Mercurial $B$+$i%U%C%/$KEO$5$l$^$9!#(B
foozy@708: 
foozy@708: $B$3$N>pJs$O>o$K$o$+$k$H$$$&$o$1$G$O$"$j$^$;$s!#(B
foozy@708: http $B$J$$$7(B ssh 
foozy@708: $B7PM3$G%5!<%S%9$rDs6!$7$F$$$k%j%]%8%H%j$K$*$$$F%U%C%/$,5/F0$5$l$?>l9g!"(B
foozy@708: Mercurial $B$O1s3V%j%]%8%H%j$rFCDj$9$k$3$H$O$G$-$^$;$s$,!"(B
foozy@708: $B%/%i%$%"%s%H$,$I$N%"%I%l%9$+$i@\B3$7$F$$$k$N$+$OFCDj$9$k$3$H$,$G$-$^$9!#(B
foozy@708: $B$3$N$h$&$J>l9g!"(BURL $B$O0J2<$N$$$:$l$+$N7A<0$K$J$j$^$9!#(B
foozy@708: 
foozy@708: \begin{itemize}
foozy@708: \item \texttt{remote:ssh:\emph{ip-address}}---$BM?$($i$l$?(B IP $B%"%I%l%9$+$i$N(B
foozy@708:   ssh $B1s3V@\B3!#(B
foozy@708: 
foozy@708: \item \texttt{remote:http:\emph{ip-address}}---$BM?$($i$l$?(B IP $B%"%I%l%9$+$i$N(B
foozy@708:   http $B1s3V@\B3!#(B
foozy@708:   $B%/%i%$%"%s%H$,(B SSL $B$r;HMQ$7$?>l9g!"(B
foozy@708:   \texttt{remote:https:\emph{ip-address}} $B7A<0$K$J$j$^$9!#(B
foozy@708: 
foozy@708: \item Empty---$B1s3V@\B3$K4X$9$k>pJs$r<hF@$G$-$J$+$C$?>l9g!#(B
foozy@708: 
foozy@708: \end{itemize}
foozy@708: 
foozy@708: \section{Hook reference}
foozy@708: 
foozy@708: \subsection{\hook{changegroup}---after remote changesets added}
foozy@708: \label{sec:hook:changegroup}
foozy@708: 
foozy@708: $B$3$N%U%C%/$O!"(B
foozy@708: $BNc$($P(B \hgcmd{pull} $B$J$$$7(B \hgcmd{unbundle} $B$K$h$C$F!"(B
foozy@708: $B$"$i$+$8$aB8:_$7$F$$$k%A%'%s%8%;%C%H$N0l72$,!"(B
foozy@708: $B%j%]%8%H%j$KDI2C$5$l$?8e$K<B9T$5$l$^$9!#(B
foozy@708: $B$3$l$i$NA`:n$OG$0U8D$N%A%'%s%8%;%C%H$rDI2C$G$-$^$9$,!"(B
foozy@708: $B$3$N%U%C%/$O3FA`:nKh$K#12s$E$D<B9T$5$l$^$9!#(B
foozy@708: $B$3$N$3$H$O!"(B
foozy@708: $B%A%'%s%8%;%C%H$,$^$H$^$C$FDI2C$5$l$k$+H]$+$K4X$o$i$:!"(B
foozy@708: \hook{incoming} $B%U%C%/$N<B9T$,%A%'%s%8%;%C%HKh$K<B9T$5$l$k$N$HBP>HE*$G$9!#(B
foozy@708: 
foozy@708: $BDI2C$5$l$?%A%'%s%8%;%C%H$KBP$9$k<+F02=$5$l$?%S%k%I!&%F%9%H$N3+;O7@5!$H$7$?$j!"(B
foozy@708: $B%P%0%G!<%?%Y!<%9$N99?7!"(B
foozy@708: $B%j%]%8%H%j$,?7$?$J%A%'%s%8%;%C%H$r<h$j9~$s$@$3$H$N9XFI<T$X$NDLCN!"(B
foozy@708: $B$H$$$C$?$b$N$,!"(B
foozy@708: $B$3$N%U%C%/$KA[Dj$5$l$kMQES$N0lIt$G$9!#(B
foozy@708: 
foozy@708: $B$3$N%U%C%/$KEO$5$l$k%Q%i%a!<%?$O(B:
foozy@708: 
foozy@708: \begin{description}
foozy@708: \item[\texttt{node}] $B%A%'%s%8%;%C%H(BID$B!#(B
foozy@708:   $BDI2C$5$l$k0l72$NCf$N:G=i$N%A%'%s%8%;%C%H$N(BID$B!#(B
foozy@708:   $B$3$N%A%'%s%8%;%C%H$+$i(B
foozy@708:   \index{tags!\texttt{tip}}\texttt{tip} 
foozy@708:   $B$^$G!J(B\texttt{tip} $B<+?H$b4^$`!K$NA4$F$N%A%'%s%8%;%C%H$,!"(B
foozy@708:   $BC1FH$N(B \hgcmd{pull}$B!"(B\hgcmd{push} $B$J$$$7(B \hgcmd{unbundle}
foozy@708:   $BA`:n$K$h$jDI2C$5$l$?$3$H$K$J$j$^$9!#(B
foozy@708: 
foozy@708: \item[\texttt{source}] $BJ8;zNs!#(B
foozy@708:   $B%A%'%s%8%;%C%H$NM3Mh85$rI=$7$^$9!#(B
foozy@708:   $B>\:Y$O(B\ref{sec:hook:sources}~$B@a$r;2>H$7$F$/$@$5$$!#(B
foozy@708: 
foozy@708: \item[\texttt{url}] URL$B!#(B
foozy@708:   $BFCDj$G$-$k>l9g$K8B$j!"1s3V%j%]%8%H%j$N>l=j$rI=$7$^$9!#(B
foozy@708:   $B>\:Y$O(B\ref{sec:hook:url}~$B@a$r;2>H$7$F$/$@$5$$!#(B
foozy@708: 
foozy@708: \end{description}
foozy@708: 
foozy@708: $BMWJLES;2>H(B:
foozy@708: \hook{incoming} $B!J(B\ref{sec:hook:incoming}~$B@a!K!"(B
foozy@708: \hook{prechangegroup} $B!J(B\ref{sec:hook:prechangegroup}~$B@a!K!"(B
foozy@708: \hook{pretxnchangegroup} $B!J(B\ref{sec:hook:pretxnchangegroup}~$B@a!K(B
foozy@708: 
foozy@708: \subsection{\hook{commit}---after a new changeset is created}
foozy@708: \label{sec:hook:commit}
foozy@708: 
foozy@708: $B$3$N%U%C%/$O!"?7$7$$%A%'%s%8%;%C%H$,:n@.$5$l$?8e$G<B9T$5$l$^$9!#(B
foozy@708: 
foozy@708: $B$3$N%U%C%/$KEO$5$l$k%Q%i%a!<%?$O(B:
foozy@708: 
foozy@708: \begin{description}
foozy@708: \item[\texttt{node}] $B%A%'%s%8%;%C%H(BID$B!#(B
foozy@708:   $B?7$7$/%3%_%C%H$5$l$?%A%'%s%8%;%C%H$N(BID$B!#(B
foozy@708: 
foozy@708: \item[\texttt{parent1}] $B%A%'%s%8%;%C%H(BID$B!#(B
foozy@708:   $B?7$7$/%3%_%C%H$5$l$?%A%'%s%8%;%C%H$K$H$C$F!"(B
foozy@708:   $BBh#1?F$H$J$k%A%'%s%8%;%C%H$N(BID$B!#(B
foozy@708: 
foozy@708: \item[\texttt{parent2}] $B%A%'%s%8%;%C%H(BID$B!#(B
foozy@708:   $B?7$7$/%3%_%C%H$5$l$?%A%'%s%8%;%C%H$K$H$C$F!"(B
foozy@708:   $BBh#2?F$H$J$k%A%'%s%8%;%C%H$N(BID$B!#(B
foozy@708: 
foozy@708: \end{description}
foozy@708: 
foozy@708: $BMWJLES;2>H(B: \hook{precommit} $B!J(B\ref{sec:hook:precommit}~$B@a!K!"(B
foozy@708: \hook{pretxncommit} $B!J(B\ref{sec:hook:pretxncommit}~$B@a!K(B
foozy@708: 
foozy@708: \subsection{\hook{incoming}---after one remote changeset is added}
foozy@708: \label{sec:hook:incoming}
foozy@708: 
foozy@708: $B$3$N%U%C%/$O!"(B
foozy@708: $BNc$($P(B \hgcmd{push} $B$K$h$C$F!"(B
foozy@708: $B$"$i$+$8$aB8:_$7$F$$$k%A%'%s%8%;%C%H$,!"(B
foozy@708: $B%j%]%8%H%j$KDI2C$5$l$?8e$K<B9T$5$l$^$9!#(B
foozy@708: $BJ#?t$N%A%'%s%8%;%C%H$,C10l$NA`:n$GDI2C$5$l$?>l9g$G$b!"(B
foozy@708: $B$3$N%U%C%/$ODI2C$5$l$?8D!9$N%A%'%s%8%;%C%HKh$K<B9T$5$l$^$9!#(B
foozy@708: 
foozy@708: $B$3$N%U%C%/$r(B \hook{changegroup} $B%U%C%/!J(B\ref{sec:hook:changegroup}~$B@a;2>H!K(B
foozy@708: $B$HF1MM$NL\E*$K;HMQ$9$k$3$H$,$G$-$^$9!#(B
foozy@708: $B0l72$N%A%'%s%8%;%C%HKh$N%U%C%/5/F0$NJ}$,JXMx$J>l9g$b$"$j$^$9$,!"(B
foozy@708: $B;~$K$O%A%'%s%8%;%C%H$4$H$N%U%C%/5/F0$bJXMx$G$9!#(B
foozy@708: 
foozy@708: $B$3$N%U%C%/$KEO$5$l$k%Q%i%a!<%?$O(B:
foozy@708: 
foozy@708: \begin{description}
foozy@708: \item[\texttt{node}] $B%A%'%s%8%;%C%H(BID$B!#(B
foozy@708:   $B?7$7$/DI2C$5$l$?%A%'%s%8%;%C%H$N(BID$B!#(B
foozy@708: 
foozy@708: \item[\texttt{source}] $BJ8;zNs!#(B
foozy@708:   $B%A%'%s%8%;%C%H$NM3Mh85$rI=$7$^$9!#(B
foozy@708:   $B>\:Y$O(B\ref{sec:hook:sources}~$B@a$r;2>H$7$F$/$@$5$$!#(B
foozy@708: 
foozy@708: \item[\texttt{url}] URL$B!#(B
foozy@708:   $BFCDj$G$-$k>l9g$K8B$j!"1s3V%j%]%8%H%j$N>l=j$rI=$7$^$9!#(B
foozy@708:   $B>\:Y$O(B\ref{sec:hook:url}~$B@a$r;2>H$7$F$/$@$5$$!#(B
foozy@708: 
foozy@708: \end{description}
foozy@708: 
foozy@708: $BMWJLES;2>H(B: 
foozy@708: \hook{changegroup} $B!J(B\ref{sec:hook:changegroup}~$B@a!K!"(B
foozy@708: \hook{prechangegroup} $B!J(B\ref{sec:hook:prechangegroup}~$B@a!K!"(B
foozy@708: \hook{pretxnchangegroup} $B!J(B\ref{sec:hook:pretxnchangegroup}~$B@a!K(B
foozy@708: 
foozy@708: \subsection{\hook{outgoing}---after changesets are propagated}
foozy@708: \label{sec:hook:outgoing}
foozy@708: 
foozy@708: $B$3$N%U%C%/$O!"(B
foozy@708: $BNc$($P(B \hgcmd{push} $B$J$$$7(B \hgcmd{bundle} $B$K$h$C$F!"(B
foozy@708: $BB>$N%j%]%8%H%j$X$H%A%'%s%8%;%C%H$N0l72$,EAGE$7$?8e$K<B9T$5$l$^$9!#(B
foozy@708: 
foozy@708: $B%A%'%s%8%;%C%H$,30It$KEAGE$7$?$3$H$N4IM}<T$X$NDLCN$J$I$O!"(B
foozy@708: $B$3$N%U%C%/$KA[Dj$5$l$kMQES$N#1$D$G$9!#(B
foozy@708: 
foozy@708: $B$3$N%U%C%/$KEO$5$l$k%Q%i%a!<%?$O(B:
foozy@708: 
foozy@708: \begin{description}
foozy@708: \item[\texttt{node}] $B%A%'%s%8%;%C%H(BID$B!#(B
foozy@708:   $BB>$N%j%]%8%H%j$X$HEAGE$9$k0l72$NCf$N:G=i$N%A%'%s%8%;%C%H$N(BID$B!#(B
foozy@708: 
foozy@708: \item[\texttt{source}] $BJ8;zNs!#(B
foozy@708:   $BEAGEA`:n$NH/9TM3Mh$rI=$7$^$9!J(B\ref{sec:hook:sources}~$B@a$r;2>H$7$F$/$@$5$$!K!#(B
foozy@708:   $B1s3V%/%i%$%"%s%H$+$i$N(B \hgcmd{pull} $BMW5a$N>l9g!"(B
foozy@708:   \texttt{source} $B$O(B \texttt{serve} $B$H$J$j$^$9!#(B
foozy@708:   $B%A%'%s%8%;%C%H72$r<hF@$7$h$&$H$9$k%/%i%$%"%s%H$,%m!<%+%k%[%9%H>e$K5o$k>l9g!"(B
foozy@708:   $B%/%i%$%"%s%H$NA`:n<oJL$K1~$8$F!"(B
foozy@708:   \texttt{source} $B$NCM$O(B
foozy@708:   \texttt{bundle}$B!"(B\texttt{pull} $B$J$$$7(B \texttt{push} $B$N$$$:$l$+$K$J$j$^$9!#(B
foozy@708: 
foozy@708: \item[\texttt{url}] URL$B!#(B
foozy@708:   $BFCDj$G$-$k>l9g$K8B$j!"1s3V%j%]%8%H%j$N>l=j$rI=$7$^$9!#(B
foozy@708:   $B>\:Y$O(B\ref{sec:hook:url}~$B@a$r;2>H$7$F$/$@$5$$!#(B
foozy@708: 
foozy@708: \end{description}
foozy@708: 
foozy@708: $BMWJLES;2>H!'(B
foozy@708: \hook{preoutgoing} $B!J(B\ref{sec:hook:preoutgoing}~$B@a!K(B
foozy@708: 
foozy@708: \subsection{\hook{prechangegroup}---before starting to add remote changesets}
foozy@708: \label{sec:hook:prechangegroup}
foozy@708: 
foozy@708: $B$3$N@)8fMQ%U%C%/$O!"(B
foozy@708: $BB>$N%j%]%8%H%j$+$i$N%A%'%s%8%;%C%H72$NDI2C$,(B
foozy@708: Mercurial $B$K$h$j3+;O$5$l$kD>A0$K<B9T$5$l$^$9!#(B
foozy@708: 
foozy@708: $B$3$N%U%C%/$O%A%'%s%8%;%C%H72$NE>Aw3+;O$,5v2D$5$l$kA0$K<B9T$5$l$k$?$a!"(B
foozy@708: $B%U%C%/<+BN$ODI2C$5$l$k%A%'%s%8%;%C%H$K4X$9$k>pJs$rF@$k$3$H$,$G$-$^$;$s!#(B
foozy@708: $B$3$N%U%C%/$N<B9T$,<:GT$7$?>l9g!"%A%'%s%8%;%C%H72$OE>Aw$5$l$^$;$s!#(B
foozy@708: 
foozy@708: $B$3$N%U%C%/$NMQES$N0l$D$K!"(B
foozy@708: $B%j%]%8%H%j$KBP$9$k30It$+$i$N%A%'%s%8%;%C%HDI2C$N6X;_$,$"$j$^$9!#(B
foozy@708: $BNc$($P!"(B
foozy@708: $B%m!<%+%k%[%9%H>e$N4IM}<T$,%j%]%8%H%j$rJQ99$G$-$k0lJ}$G!"(B
foozy@708: $BMxMQ<T$,%5!<%P7PM3$GJQ99$r(B \hgcmd{push} $B$G$-$J$$$h$&$K!"(B
foozy@708: $B0l;~E*$J$$$71J5W$K(B``$BE`7k(B''$B$9$k$3$H$b$G$-$^$9!#(B
foozy@708: 
foozy@708: $B$3$N%U%C%/$KEO$5$l$k%Q%i%a!<%?$O(B:
foozy@708: 
foozy@708: \begin{description}
foozy@708: 
foozy@708: \item[\texttt{source}] $BJ8;zNs!#(B
foozy@708:   $B%A%'%s%8%;%C%H$NM3Mh85$rI=$7$^$9!#(B
foozy@708:   $B>\:Y$O(B\ref{sec:hook:sources}~$B@a$r;2>H$7$F$/$@$5$$!#(B
foozy@708: 
foozy@708: \item[\texttt{url}] URL$B!#(B
foozy@708:   $BFCDj$G$-$k>l9g$K8B$j!"1s3V%j%]%8%H%j$N>l=j$rI=$7$^$9!#(B
foozy@708:   $B>\:Y$O(B\ref{sec:hook:url}~$B@a$r;2>H$7$F$/$@$5$$!#(B
foozy@708: 
foozy@708: \end{description}
foozy@708: 
foozy@708: $BMWJLES;2>H!'(B
foozy@708: \hook{changegroup} $B!J(B\ref{sec:hook:changegroup}~$B@a!K!"(B
foozy@708: \hook{incoming} $B!J(B\ref{sec:hook:incoming}~$B@a!K!"(B
foozy@708: \hook{pretxnchangegroup} $B!J(B\ref{sec:hook:pretxnchangegroup}~$B@a!K(B
foozy@708: 
foozy@708: \subsection{\hook{precommit}---before starting to commit a changeset}
foozy@708: \label{sec:hook:precommit}
foozy@708: 
foozy@708: $B$3$N%U%C%/$O!"(B
foozy@708: Mercurial $B$,?7$?$J%A%'%s%8%;%C%H$r%3%_%C%H$9$kA0$K<B9T$5$l$^$9!#(B
foozy@708: $B%3%_%C%H$5$l$k%U%!%$%k!"%3%_%C%H%a%C%;!<%8$J$$$7F|IU$H$$$C$?!"(B
foozy@708: $B%3%_%C%H$K4X$9$k%a%?%G!<%?$r(B
foozy@708: Mercurial $B$,B7$($kA0$K<B9T$5$l$^$9!#(B
foozy@708: 
foozy@708: $B$3$N%U%C%/$NMQES$N0l$D$K!"(B
foozy@708: $B%A%'%s%8%;%C%H$N<u$1F~$l$r5v$90lJ}$G$N!"(B
foozy@708: $B?7$?$J%A%'%s%8%;%C%H$N%3%_%C%H$N6X;_$,$"$j$^$9!#(B
foozy@708: $BB>$NMQES$H$H$7$F$O!"(B
foozy@708: $B%S%k%I$d%F%9%H$r<B;\$7!"(B
foozy@708: $B$=$l$i$,@.8y$7$?>l9g$K$N$_%3%_%C%H$r5v2D$9$k!"(B
foozy@708: $B$H$$$&$b$N$b$"$j$^$9!#(B
foozy@708: 
foozy@708: $B$3$N%U%C%/$KEO$5$l$k%Q%i%a!<%?$O(B:
foozy@708: 
foozy@708: \begin{description}
foozy@708: \item[\texttt{parent1}] $B%A%'%s%8%;%C%H(BID$B!#(B
foozy@708:   $B:n6HNN0h%G%#%l%/%H%j$K$H$C$F!"(B
foozy@708:   $BBh#1?F$H$J$k%A%'%s%8%;%C%H$N(BID$B!#(B
foozy@708: 
foozy@708: \item[\texttt{parent2}] $B%A%'%s%8%;%C%H(BID$B!#(B
foozy@708:   $B:n6HNN0h%G%#%l%/%H%j$K$H$C$F!"(B
foozy@708:   $BBh#2?F$H$J$k%A%'%s%8%;%C%H$N(BID$B!#(B
foozy@708: 
foozy@708: \end{description}
foozy@708: 
foozy@708: $B%3%_%C%H$,?J9T$7$?>l9g!"(B
foozy@708: $B:n6HNN0h%G%#%l%/%H%j$N!JN>!K?F$,!"(B
foozy@708: $B?7$?$J%A%'%s%8%;%C%H$N?F$H$J$j$^$9!#(B
foozy@708: 
foozy@708: $BMWJLES;2>H!'(B
foozy@708: \hook{commit} $B!J(B\ref{sec:hook:commit}~$B@a!K!"(B
foozy@708: \hook{pretxncommit} $B!J(B\ref{sec:hook:pretxncommit}~$B@a!K(B
foozy@708: 
foozy@708: \subsection{\hook{preoutgoing}---before starting to propagate changesets}
foozy@708: \label{sec:hook:preoutgoing}
foozy@708: 
foozy@708: $B$3$N%U%C%/$O!"(B
foozy@708: Mercurial $B$,30It$KE>Aw$5$l$k%A%'%s%8%;%C%H$rFCDj$9$kD>A0$K<B9T$5$l$^$9!#(B
foozy@708: 
foozy@708: $B%A%'%s%8%;%C%H$,B>$N%j%]%8%H%j$XE>Aw$5$l$k$N$rKI$0$3$H$O!"(B
foozy@708: $B$3$N%U%C%/$KA[Dj$5$l$kMQES$N#1$&$G$9!#(B
foozy@708: 
foozy@708: $B$3$N%U%C%/$KEO$5$l$k%Q%i%a!<%?$O(B:
foozy@708: 
foozy@708: \begin{description}
foozy@708: \item[\texttt{source}] $BJ8;zNs!#(B
foozy@708:   $BEv3:%j%]%8%H%j$KBP$9$k%A%'%s%8%;%C%H$N<hF@MW5a$NH/9TM3Mh$rI=$7$^$9(B
foozy@708:   $B!J(B\ref{sec:hook:sources}~$B@a$r;2>H$7$F$/$@$5$$!K!#(B
foozy@708:   $B$3$N%Q%i%a!<%?$,<h$jF@$kCM$K4X$7$F$O!"(B
foozy@708:   \hook{outgoing} $B$N(B \texttt{source} $B%Q%i%a!<%?$K4X$9$k(B
foozy@708:   \ref{sec:hook:outgoing}~$B@a$N5-=R$r;2>H$7$F$/$@$5$$!#(B
foozy@708: 
foozy@708: \item[\texttt{url}] URL$B!#(B
foozy@708:   $BFCDj$G$-$k>l9g$K8B$j!"1s3V%j%]%8%H%j$N>l=j$rI=$7$^$9!#(B
foozy@708:   $B>\:Y$O(B\ref{sec:hook:url}~$B@a$r;2>H$7$F$/$@$5$$!#(B
foozy@708: 
foozy@708: \end{description}
foozy@708: 
foozy@708: $BMWJLES;2>H(B:
foozy@708: \hook{outgoing} $B!J(B\ref{sec:hook:outgoing}~$B@a!K(B
foozy@708: 
foozy@708: \subsection{\hook{pretag}---before tagging a changeset}
foozy@708: \label{sec:hook:pretag}
foozy@708: 
foozy@708: $B$3$N@)8f%U%C%/$O!"(B
foozy@708: $B%?%0$,@8@.$5$l$kA0$K<B9T$5$l$^$9!#(B
foozy@708: $B%U%C%/$N<B9T$,@.8y$7$?>l9g!"%?%0$N@8@.$O7QB3$5$l!"(B
foozy@708: $B%U%C%/$N<B9T$,<:GT$7$?>l9g!"%?%0$O@8@.$5$l$^$;$s!#(B
foozy@708: 
foozy@708: $B$3$N%U%C%/$KEO$5$l$k%Q%i%a!<%?$O(B:
foozy@708: 
foozy@708: \begin{description}
foozy@708: \item[\texttt{local}] $B??56CM!#(B
foozy@708:   $B%?%0$,%j%]%8%H%j$KBP$7$F%m!<%+%k$J$b$N(B
foozy@708:   $B!J(B\sfilename{.hg/localtags} $B$K>pJs$,3JG<$5$l$k!K$J$N$+!"(B
foozy@708:   Mercurial $B$K4IM}$5$l$k$b$N!J(B\sfilename{.hgtags} $B$K>pJs$,3JG<!K(B
foozy@708:   $B$J$N$+$rI=$7$^$9!#(B
foozy@708: 
foozy@708: \item[\texttt{node}] $B%A%'%s%8%;%C%H(BID$B!#(B
foozy@708:   $B%?%0IU$1$5$l$k%A%'%s%8%;%C%H$N(BID$B!#(B
foozy@708: 
foozy@708: \item[\texttt{tag}] $BJ8;zNs!#(B
foozy@708:   $B:n@.$5$l$k%?%0$NL>A0!#(B
foozy@708: 
foozy@708: \end{description}
foozy@708: 
foozy@708: $B@8@.$5$l$k%?%0$,9=@.4IM}BP>]$H$J$k>l9g!"(B
foozy@708: \hook{precommit} $B!J(B\ref{sec:hook:commit}~$B@a!K$*$h$S(B
foozy@708: \hook{pretxncommit} $B!J(B\ref{sec:hook:pretxncommit}~$B@a!K(B
foozy@708: $B%U%C%/$b<B9T$5$l$^$9!#(B
foozy@708: 
foozy@708: $BMWJLES;2>H!'(B
foozy@708: \hook{tag} $B!J(B\ref{sec:hook:tag}~$B@a!K(B
foozy@708: 
foozy@708: \subsection{\hook{pretxnchangegroup}---before completing addition of
foozy@708:   remote changesets}
foozy@708: \label{sec:hook:pretxnchangegroup}
foozy@708: 
foozy@708: $B$3$N@)8f%U%C%/$O!"(B
foozy@708: $B%H%i%s%6%/%7%g%s(B---
foozy@708: $B$3$N%H%i%s%6%/%7%g%s$O!"(B
foozy@708: $BB>$N%j%]%8%H%j$+$i$N0l72$N%A%'%s%8%;%C%H$NDI2C$r4IM}$7$^$9(B
foozy@708: ---$B$,40N;$9$kA0$K<B9T$5$l$^$9!#(B
foozy@708: $B%U%C%/$N<B9T$,@.8y$7$?>l9g!"%H%i%s%6%/%7%g%s$O40N;$7!"(B
foozy@708: $BA4$F$N%A%'%s%8%;%C%H$,%j%]%8%H%j$K$*$$$F1JB32=$5$l$^$9!#(B
foozy@708: $B%U%C%/$N<B9T$,<:GT$7$?>l9g!"(B
foozy@708: $B%H%i%s%6%/%7%g%s$O4,$-La$5$l!"(B
foozy@708: $B%A%'%s%8%;%C%H$K4X$9$k%G!<%?$OGK4~$5$l$^$9!#(B
foozy@708: 
foozy@708: $B$3$N%U%C%/$O!"(B
foozy@708: $B!V$[$\DI2C$5$l$?!W%A%'%s%8%;%C%H$K4X$9$k%a%?%G!<%?$K%"%/%;%9$G$-$^$9$,!"(B
foozy@708: $B1JB32=$5$l$k$h$&$JA`:n(B\footnote{$BLuCm(B:
foozy@708: $BNc$($P!"30It$N(B DBMS $B$X$N%G!<%?3JG<$d!"(B
foozy@708: $B8x3+MQ%U%!%$%k$X$N=q$-=P$7Ey!#(B}
foozy@708: $B$r$3$l$i$N%G!<%?$K4p$E$$$F9T$&$Y$-$G$O$"$j$^$;$s(B
foozy@708: $B:n6H%G%#%l%/%H%j$bJQ99$9$Y$-$G$O$"$j$^$;$s!#(B
foozy@708: 
foozy@708: $B$3$N%U%C%/$N<B9TCf$K!"(B
foozy@708: $BB>$N(B Mercurial $B%W%m%;%9$,F1$8%j%]%8%H%j$K%"%/%;%9$7$F$-$?>l9g!"(B
foozy@708: $B$3$N%W%m%;%9$+$i$O!"(B
foozy@708: $B!V$[$\DI2C$5$l$?!W%A%'%s%8%;%C%H$,1JB32=$5$l$?$b$N$N$h$&$K8+$($^$9!#(B
foozy@708: $B$3$N>u67$r2sHr$9$k<j=g$rF'$^$J$$$H!"(B
foozy@708: $B6%9g>uBV$K$J$j$+$M$^$;$s!#(B
foozy@708: 
foozy@708: $B$3$N%U%C%/$O!"%A%'%s%8%;%C%H72$KBP$9$k?GCG$KMxMQ2DG=$G$9!#(B
foozy@708: $B%U%C%/$N<B9T$,<:GT$7$?>l9g!"(B
foozy@708: $B%H%i%s%6%/%7%g%s$,4,$-La$5$l!"(B
foozy@708: $BA4$F$N%A%'%s%8%;%C%H$,(B``$B5qH](B''$B$5$l$^$9!#(B
foozy@708: 
foozy@708: $B$3$N%U%C%/$KEO$5$l$k%Q%i%a!<%?$O(B:
foozy@708: 
foozy@708: \begin{description}
foozy@708: \item[\texttt{node}] $B%A%'%s%8%;%C%H(BID$B!#(B
foozy@708:   $BDI2C$5$l$k0l72$NCf$N:G=i$N%A%'%s%8%;%C%H$N(BID$B!#(B
foozy@708:   $B$3$N%A%'%s%8%;%C%H$+$i(B
foozy@708:   \index{tags!\texttt{tip}}\texttt{tip} 
foozy@708:   $B$^$G!J(B\texttt{tip} $B<+?H$b4^$`!K$NA4$F$N%A%'%s%8%;%C%H$,!"(B
foozy@708:   $BC1FH$N(B \hgcmd{pull}$B!"(B\hgcmd{push} $B$J$$$7(B \hgcmd{unbundle}
foozy@708:   $BA`:n$K$h$jDI2C$5$l$?$3$H$K$J$j$^$9!#(B
foozy@708: 
foozy@708: \item[\texttt{source}] $BJ8;zNs!#(B
foozy@708:   $B%A%'%s%8%;%C%H$NM3Mh85$rI=$7$^$9!#(B
foozy@708:   $B>\:Y$O(B\ref{sec:hook:sources}~$B@a$r;2>H$7$F$/$@$5$$!#(B
foozy@708: 
foozy@708: \item[\texttt{url}] URL$B!#(B
foozy@708:   $BFCDj$G$-$k>l9g$K8B$j!"1s3V%j%]%8%H%j$N>l=j$rI=$7$^$9!#(B
foozy@708:   $B>\:Y$O(B\ref{sec:hook:url}~$B@a$r;2>H$7$F$/$@$5$$!#(B
foozy@708: 
foozy@708: \end{description}
foozy@708: 
foozy@708: $BMWJLES;2>H!'(B
foozy@708: \hook{changegroup} $B!J(B\ref{sec:hook:changegroup}$B!K!"(B
foozy@708: \hook{incoming} $B!J(B\ref{sec:hook:incoming}$B!K!"(B
foozy@708: \hook{prechangegroup} $B!J(B\ref{sec:hook:prechangegroup}$B!K(B
foozy@708: 
foozy@708: \subsection{\hook{pretxncommit}---before completing commit of new changeset}
foozy@708: \label{sec:hook:pretxncommit}
foozy@708: 
foozy@708: $B$3$N@)8f%U%C%/$O!"(B
foozy@708: $B%H%i%s%6%/%7%g%s(B---
foozy@708: $B$3$N%H%i%s%6%/%7%g%s$O!"(B
foozy@708: $B?7$?$J%A%'%s%8%;%C%H$N%3%_%C%H$r4IM}$7$^$9(B
foozy@708: ---$B$,40N;$9$kA0$K<B9T$5$l$^$9!#(B
foozy@708: $B%U%C%/$N<B9T$,@.8y$7$?>l9g!"%H%i%s%6%/%7%g%s$O40N;$7!"(B
foozy@708: $B%A%'%s%8%;%C%H$,%j%]%8%H%j$K$*$$$F1JB32=$5$l$^$9!#(B
foozy@708: $B%U%C%/$N<B9T$,<:GT$7$?>l9g!"(B
foozy@708: $B%H%i%s%6%/%7%g%s$O4,$-La$5$l!"(B
foozy@708: $B%3%_%C%H$K4X$9$k%G!<%?$OGK4~$5$l$^$9!#(B
foozy@708: 
foozy@708: $B$3$N%U%C%/$O!"(B
foozy@708: $B!V$[$\?75,:n@.$5$l$?!W%A%'%s%8%;%C%H$K4X$9$k%a%?%G!<%?$K%"%/%;%9$G$-$^$9$,!"(B
foozy@708: $B1JB32=$5$l$k$h$&$JA`:n$r$3$l$i$N%G!<%?$K4p$E$$$F9T$&$Y$-$G$O$"$j$^$;$s(B
foozy@708: $B:n6H%G%#%l%/%H%j$bJQ99$9$Y$-$G$O$"$j$^$;$s!#(B
foozy@708: 
foozy@708: $B$3$N%U%C%/$N<B9TCf$K!"(B
foozy@708: $BB>$N(B Mercurial $B%W%m%;%9$,F1$8%j%]%8%H%j$K%"%/%;%9$7$F$-$?>l9g!"(B
foozy@708: $B$3$N%W%m%;%9$+$i$O!"(B
foozy@708: $B!V$[$\?75,:n@.$5$l$?!W%A%'%s%8%;%C%H$,1JB32=$5$l$?$b$N$N$h$&$K8+$($^$9!#(B
foozy@708: $B$3$N>u67$r2sHr$9$k<j=g$rF'$^$J$$$H!"(B
foozy@708: $B6%9g>uBV$K$J$j$+$M$^$;$s!#(B
foozy@708: 
foozy@708: $B$3$N%U%C%/$KEO$5$l$k%Q%i%a!<%?$O(B:
foozy@708: 
foozy@708: \begin{description}
foozy@708: 
foozy@708: \item[\texttt{node}] $B%A%'%s%8%;%C%H(BID$B!#(B
foozy@708:   $B?7$7$/%3%_%C%H$5$l$?%A%'%s%8%;%C%H$N(BID$B!#(B
foozy@708: 
foozy@708: \item[\texttt{parent1}] $B%A%'%s%8%;%C%H(BID$B!#(B
foozy@708:   $B?7$7$/%3%_%C%H$5$l$?%A%'%s%8%;%C%H$K$H$C$F!"(B
foozy@708:   $BBh#1?F$H$J$k%A%'%s%8%;%C%H$N(BID$B!#(B
foozy@708: 
foozy@708: \item[\texttt{parent2}] $B%A%'%s%8%;%C%H(BID$B!#(B
foozy@708:   $B?7$7$/%3%_%C%H$5$l$?%A%'%s%8%;%C%H$K$H$C$F!"(B
foozy@708:   $BBh#2?F$H$J$k%A%'%s%8%;%C%H$N(BID$B!#(B
foozy@708: 
foozy@708: \end{description}
foozy@708: 
foozy@708: $BMWJLES;2>H!'(B
foozy@708: \hook{precommit} $B!J(B\ref{sec:hook:precommit}~$B@a!K(B
foozy@708: 
foozy@708: \subsection{\hook{preupdate}---before updating or merging working directory}
foozy@708: \label{sec:hook:preupdate}
foozy@708: 
foozy@708: $B$3$N@)8f%U%C%/$O!"(B
foozy@708: $B:n6HNN0h%G%#%l%/%H%j$K$*$1$k(B \hgcmd{update} $B$J$$$7(B \hgcmd{merge}
foozy@708: $B$N<B;\A0$K<B9T$5$l$^$9!#(B
foozy@708: $B$3$N%U%C%/$O!"(B
foozy@708: Mercurial $B$N(B \hgcmd{update} 
foozy@708: $B<B;\A03NG'$,(B \hgcmd{update} $B$J$$$7(B \hgcmd{merge} 
foozy@708: $B$r<B9T2DG=$HH=CG$7$?>l9g$K$7$+<B9T$5$l$^$;$s!#(B
foozy@708: $B%U%C%/$N<B9T$,@.8y$7$?>l9g!"(B
foozy@708: \hgcmd{update} $B$J$$$7(B \hgcmd{merge} $B$N<B9T$O7QB3$5$l$^$9$,!"(B
foozy@708: $B%U%C%/$N<B9T$,<:GT$7$?>l9g!"(B
foozy@708: \hgcmd{update} $B$J$$$7(B \hgcmd{merge} $B$O<B9T$5$l$^$;$s!#(B
foozy@708: 
foozy@708: $B$3$N%U%C%/$KEO$5$l$k%Q%i%a!<%?$O(B:
foozy@708: 
foozy@708: \begin{description}
foozy@708: \item[\texttt{parent1}] $B%A%'%s%8%;%C%H(BID$B!#(B
foozy@708:   $B:n6HNN0h%G%#%l%/%H%j$,(B \hgcmd{update} $B$5$l$k?F%A%'%s%8%;%C%H$N(BID$B!#(B
foozy@708:   $B:n6HNN0h%G%#%l%/%H%j$,(B \hgcmd{merge} $B$5$l$k>l9g$O!"(B
foozy@708:   $B8=:_$N?F%A%'%s%8%;%C%H$HF1$8$K$J$j$^$9!#(B
foozy@708: 
foozy@708: \item[\texttt{parent2}] $B%A%'%s%8%;%C%H(BID$B!#(B
foozy@708:   $B:n6HNN0h%G%#%l%/%H%j$,(B \hgcmd{merge} $B$5$l$k>l9g$K$N$_@_Dj$5$l$^$9!#(B
foozy@708:   $B:n6HNN0h%G%#%l%/%H%j$N(B \hgcmd{merge} $BBP>]$H$J$k%A%'%s%8%;%C%H$N(BID$B!#(B
foozy@708: 
foozy@708: \end{description}
foozy@708: 
foozy@708: $BMWJLES;2>H!'(B
foozy@708: \hook{update} $B!J(B\ref{sec:hook:update}~$B@a!K(B
foozy@708: 
foozy@708: \subsection{\hook{tag}---after tagging a changeset}
foozy@708: \label{sec:hook:tag}
foozy@708: 
foozy@708: $B$3$N%U%C%/$O!"%?%0$,@8@.$5$l$?8e$G<B9T$5$l$^$9!#(B
foozy@708: 
foozy@708: $B$3$N%U%C%/$KEO$5$l$k%Q%i%a!<%?$O(B:
foozy@708: 
foozy@708: \begin{description}
foozy@708: \item[\texttt{local}] $B??56CM!#(B
foozy@708:   $B%?%0$,%j%]%8%H%j$KBP$7$F%m!<%+%k$J$b$N(B
foozy@708:   $B!J(B\sfilename{.hg/localtags} $B$K>pJs$,3JG<$5$l$k!K$J$N$+!"(B
foozy@708:   Mercurial $B$K4IM}$5$l$k$b$N!J(B\sfilename{.hgtags} $B$K>pJs$,3JG<!K(B
foozy@708:   $B$J$N$+$rI=$7$^$9!#(B
foozy@708: 
foozy@708: \item[\texttt{node}] $B%A%'%s%8%;%C%H(BID$B!#(B
foozy@708:   $B%?%0IU$1$5$l$k%A%'%s%8%;%C%H$N(BID$B!#(B
foozy@708: 
foozy@708: \item[\texttt{tag}] $BJ8;zNs!#(B
foozy@708:   $B:n@.$5$l$k%?%0$NL>A0!#(B
foozy@708: 
foozy@708: \end{description}
foozy@708: 
foozy@708: $B@8@.$5$l$k%?%0$,9=@.4IM}BP>]$H$J$k>l9g!"(B
foozy@708: $B$3$N%U%C%/$N<B9T$K@hN)$C$F(B
foozy@708: \hook{commit} $B%U%C%/!J(B\ref{sec:hook:commit}~$B@a!K$,<B9T$5$l$^$9!#(B
foozy@708: 
foozy@708: $BMWJLES;2>H!'(B
foozy@708: \hook{pretag} $B!J(B\ref{sec:hook:pretag}~$B@a!K(B
foozy@708: 
foozy@708: \subsection{\hook{update}---after updating or merging working directory}
foozy@708: \label{sec:hook:update}
foozy@708: 
foozy@708: $B$3$N%U%C%/$O!"(B
foozy@708: $B:n6HNN0h%G%#%l%/%H%j$K$*$1$k(B \hgcmd{update} $B$J$$$7(B \hgcmd{merge}
foozy@708: $B$,40N;$7$?:]$K<B9T$5$l$^$9!#(B
foozy@708: \hgcmd{merge} $B$O<:GT$7F@$k(B
foozy@708: $B!J30It%3%^%s%I$N(B \command{hgmerge} 
foozy@708: $B$,3F%U%!%$%k$K$*$1$k>WFM$N2r>C$K<:GT$7$?>l9g!K$N$G!"(B
foozy@708: $B$3$N%U%C%/$K$O(B \hgcmd{update} $B$J$$$7(B \hgcmd{merge} 
foozy@708: $B$N@.H]$,EA$($i$l$^$9!#(B
foozy@708: 
foozy@708: \begin{description}
foozy@708: \item[\texttt{error}] $B??56CM!#(B
foozy@708:    \hgcmd{update} $B$J$$$7(B \hgcmd{merge} $B<B9T$,@.8y$7$?$+H]$+$rI=$7$^$9!#(B
foozy@708: 
foozy@708: \item[\texttt{parent1}] $B%A%'%s%8%;%C%H(BID$B!#(B
foozy@708:   $B?7$7$/%3%_%C%H$5$l$?%A%'%s%8%;%C%H$K$H$C$F!"(B
foozy@708:   $BBh#1?F$H$J$k%A%'%s%8%;%C%H$N(BID$B!#(B
foozy@708: 
foozy@708: \item[\texttt{parent2}] $B%A%'%s%8%;%C%H(BID$B!#(B
foozy@708:   $B?7$7$/%3%_%C%H$5$l$?%A%'%s%8%;%C%H$K$H$C$F!"(B
foozy@708:   $BBh#2?F$H$J$k%A%'%s%8%;%C%H$N(BID$B!#(B
foozy@708: 
foozy@708: \end{description}
foozy@708: 
foozy@708: $BMWJLES;2>H!'(B
foozy@708: \hook{preupdate} $B!J(B\ref{sec:hook:preupdate}$B@a!K(B
foozy@708: 
foozy@708: %%% Local Variables: 
foozy@708: %%% mode: latex
foozy@708: %%% TeX-master: "00book"
foozy@708: %%% End: 




