Mercurial > hgbook
changeset 780:2a93b1d35990
finished hook.tex
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Sun, 03 May 2009 17:10:09 +0900 |
parents | 69923723e7f9 |
children | 93d19b27859c |
files | ja/hook.tex |
diffstat | 1 files changed, 336 insertions(+), 157 deletions(-) [+] |
line wrap: on
line diff
--- a/ja/hook.tex Mon Apr 27 17:31:54 2009 +0900 +++ b/ja/hook.tex Sun May 03 17:10:09 2009 +0900 @@ -1720,7 +1720,6 @@ \subsubsection{$B%F%9%H$HLdBj2r7h(B} %Do not forget that by default, the \hgext{notify} extension \emph{will - % not send any mail} until you explicitly configure it to do so, by %setting \rcitem{notify}{test} to \texttt{false}. Until you do that, %it simply prints the message it \emph{would} send. @@ -1804,82 +1803,160 @@ %\subsection{External hook execution} \subsection{$B%U%C%/$N30It<B9T(B} -An external hook is passed to the shell of the user running Mercurial. -Features of that shell, such as variable substitution and command -redirection, are available. The hook is run in the root directory of -the repository (unlike in-process hooks, which are run in the same -directory that Mercurial was run in). - -Hook parameters are passed to the hook as environment variables. Each -environment variable's name is converted in upper case and prefixed -with the string ``\texttt{HG\_}''. For example, if the name of a -parameter is ``\texttt{node}'', the name of the environment variable -representing that parameter will be ``\texttt{HG\_NODE}''. - -A boolean parameter is represented as the string ``\texttt{1}'' for -``true'', ``\texttt{0}'' for ``false''. If an environment variable is -named \envar{HG\_NODE}, \envar{HG\_PARENT1} or \envar{HG\_PARENT2}, it -contains a changeset ID represented as a hexadecimal string. The -empty string is used to represent ``null changeset ID'' instead of a -string of zeroes. If an environment variable is named -\envar{HG\_URL}, it will contain the URL of a remote repository, if -that can be determined. - -If a hook exits with a status of zero, it is considered to have -succeeded. If it exits with a non-zero status, it is considered to -have failed. +%An external hook is passed to the shell of the user running Mercurial. +%Features of that shell, such as variable substitution and command +%redirection, are available. The hook is run in the root directory of +%the repository (unlike in-process hooks, which are run in the same +%directory that Mercurial was run in). + +$B30It%U%C%/$O(BMercurial$B$r<B9T$7$F$$$k%7%'%k$G<B9T$5$l$k!%JQ?t$NCV49$d%3%^%s(B +$B%I$N%j%@%$%l%/%H$J$I$N%7%'%k$N5!G=$,MxMQ$G$-$k!%30It%U%C%/$O!$(BMercurial$B$N(B +$B<B9T$HF1$8%G%#%l%/%H%jFb$G<B9T$5$l$k%W%m%;%9Fb%U%C%/$H$O0[$J$j!$%j%]%8%H(B +$B%j$N%k!<%H%G%#%l%/%H%j$G<B9T$5$l$k!%(B + +%Hook parameters are passed to the hook as environment variables. Each +%environment variable's name is converted in upper case and prefixed +%with the string ``\texttt{HG\_}''. For example, if the name of a +%parameter is ``\texttt{node}'', the name of the environment variable +%representing that parameter will be ``\texttt{HG\_NODE}''. + +$B%U%C%/%Q%i%a!<%?$O%U%C%/$K4D6-JS%9%H$7$FEO$5$l$k!%3F!9$N4D6-JQ?tL>$OBgJ8(B +$B;z$KJQ49$5$l!$@\F,<-(B``\texttt{HG\_}''$B$,IU$1$i$l$k!%Nc$($P(B +``\texttt{node}''$B$H$$$&%Q%i%a!<%?$,;H$o$l$?$H$9$k$H!$$3$N%Q%i%a!<%?$rI=(B +$B$94D6-JQ?tL>$O(B``\texttt{HG\_NODE}''$B$H$J$k!%(B + +%A boolean parameter is represented as the string ``\texttt{1}'' for +%``true'', ``\texttt{0}'' for ``false''. If an environment variable is +%named \envar{HG\_NODE}, \envar{HG\_PARENT1} or \envar{HG\_PARENT2}, it +%contains a changeset ID represented as a hexadecimal string. The +%empty string is used to represent ``null changeset ID'' instead of a +%string of zeroes. If an environment variable is named +%\envar{HG\_URL}, it will contain the URL of a remote repository, if +%that can be determined. + +$B%V!<%kCM%Q%i%a!<%?$K$D$$$F$O!$??$,(B``\texttt{1}''$B!$56$,(B``\texttt{0}''$B$HI=(B +$B8=$5$l$k!%(B\envar{HG\_NODE}$B!$(B\envar{HG\_PARENT1}$B!$(B\envar{HG\_PARENT2}$B$H$$(B +$B$&4D6-JQ?t$,Dj5A$5$l$F$$$k$H$-!$$3$l$i$O(B16$B?J?t$NJ8;zNs$GI=$5$l$?%A%'%s%8(B +$B%;%C%H(BID$B$r4^$`!%(B``$B%L%k%A%'%s%8%;%C%H(BID''$B$rI=8=$9$k$?$a$K%<%m$G$J$/6u$NJ8(B +$B;zNs$,MQ$$$i$l$k!%4D6-JQ?t$,(B\envar{HG\_URL}$B$G$"$k$H$-!$%j%b!<%H%j%]%8%H%j(B +$B$,FCDj$G$-$l$P!$$=$N(BURL$B$,F~$k!%(B + +%If a hook exits with a status of zero, it is considered to have +%succeeded. If it exits with a non-zero status, it is considered to +%have failed. + +$B%U%C%/$,%9%F!<%?%9(B0$B$G=*N;$7$?>l9g$O@.8y$H8+$J$5$l$k!%(B0$B0J30$N%9%F!<%?%9$G(B +$B=*N;$7$?>l9g$O<B9T$,<:GT$7$?$H8+$J$5$l$k!%(B %\subsection{Finding out where changesets come from} -\subsection{$B%A%'%s%8%;%C%H$N=P=h$rD4$Y$k(B} - -A hook that involves the transfer of changesets between a local -repository and another may be able to find out information about the -``far side''. Mercurial knows \emph{how} changes are being -transferred, and in many cases \emph{where} they are being transferred -to or from. +\subsection{$B%A%'%s%8%;%C%H$N%=!<%9$rD4$Y$k(B} + +%A hook that involves the transfer of changesets between a local +%repository and another may be able to find out information about the +%``far side''. Mercurial knows \emph{how} changes are being +%transferred, and in many cases \emph{where} they are being transferred +%to or from. + +$B%m!<%+%k$J%j%]%8%H%j!&B>$N%j%]%8%H%j4V$N%A%'%s%8%;%C%H$NE>Aw$K4XO"$7$?%U%C(B +$B%/$O!$1s3VCO$N>pJs$rF@$k$3$H$,$G$-$k!%(BMercurial$B$O(B\emph{$B$I$N$h$&$K(B}$BJQ99$,(B +$BE>Aw$5$l$k$+!$$^$?B?$/$N>l9g(B\emph{$B$I$3$X(B}$B!$$"$k$$$O(B\emph{$B$I$3$+$i(B}$BE>Aw$5(B +$B$l$k$N$+$bCN$k$3$H$,$G$-$k!%(B %\subsubsection{Sources of changesets} -\subsubsection{$B%A%'%s%8%;%C%H$N=P=h(B} +\subsubsection{$B%A%'%s%8%;%C%H$N%=!<%9(B} \label{sec:hook:sources} -Mercurial will tell a hook what means are, or were, used to transfer -changesets between repositories. This is provided by Mercurial in a -Python parameter named \texttt{source}, or an environment variable named -\envar{HG\_SOURCE}. +%Mercurial will tell a hook what means are, or were, used to transfer +%changesets between repositories. This is provided by Mercurial in a +%Python parameter named \texttt{source}, or an environment variable named +%\envar{HG\_SOURCE}. + +Mercurial$B$O%U%C%/$K%A%'%s%8%;%C%H$NFbMF!$%j%]%8%H%j4V$NE>AwJ}K!$J$I$rDLCN(B +$B$9$k!%(B Mercurial$B$ODLCN$N$?$a$K(B\texttt{source}$B$H$$$&(BPython$B%Q%i%a!<%?$^$?$O(B +\envar{HG\_SOURCE}$B$H$$$&4D6-JQ?t$rMQ$$$k!%(B + +%\begin{itemize} +%\item[\texttt{serve}] Changesets are transferred to or from a remote +% repository over http or ssh. +%\item[\texttt{pull}] Changesets are being transferred via a pull from +% one repository into another. +%\item[\texttt{push}] Changesets are being transferred via a push from +% one repository into another. +%\item[\texttt{bundle}] Changesets are being transferred to or from a +% bundle. +%\end{itemize} \begin{itemize} -\item[\texttt{serve}] Changesets are transferred to or from a remote - repository over http or ssh. -\item[\texttt{pull}] Changesets are being transferred via a pull from - one repository into another. -\item[\texttt{push}] Changesets are being transferred via a push from - one repository into another. -\item[\texttt{bundle}] Changesets are being transferred to or from a - bundle. +\item[\texttt{serve}] $B%A%'%s%8%;%C%H$O%j%b!<%H%j%]%8%H%j$+$i(Bhttp$B$^$?$O(B + ssh$B$GE>Aw$5$l$?!%(B +\item[\texttt{pull}] $B%A%'%s%8%;%C%H$O(B2$B$D$N%j%]%8%H%j4V$r(Bpull$B$K$h$C$FE>Aw(B + $B$5$l$?!%(B +\item[\texttt{push}] $B%A%'%s%8%;%C%H$O(B2$B$D$N%j%]%8%H%j4V$r(Bpush$B$K$h$C$FE>Aw(B + $B$5$l$?!%(B +\item[\texttt{bundle}] $B%A%'%s%8%;%C%H$O%P%s%I%k$K$h$C$FE>Aw$5$l$?!%(B \end{itemize} %\subsubsection{Where changes are going---remote repository URLs} \subsubsection{$BJQ99$N9T$-@h(B---$B%j%b!<%H%j%]%8%H%j$N(BURL} \label{sec:hook:url} -When possible, Mercurial will tell a hook the location of the ``far -side'' of an activity that transfers changeset data between -repositories. This is provided by Mercurial in a Python parameter -named \texttt{url}, or an environment variable named \envar{HG\_URL}. - -This information is not always known. If a hook is invoked in a -repository that is being served via http or ssh, Mercurial cannot tell -where the remote repository is, but it may know where the client is -connecting from. In such cases, the URL will take one of the -following forms: +%When possible, Mercurial will tell a hook the location of the ``far +%side'' of an activity that transfers changeset data between +%repositories. This is provided by Mercurial in a Python parameter +%named \texttt{url}, or an environment variable named \envar{HG\_URL}. + +Mercurial$B$O!$2DG=$G$"$k$J$i$P%j%]%8%H%j4V$N%A%'%s%8%;%C%H%G!<%?$NE>Aw$NAj(B +$B<j$N>pJs$r%U%C%/$KDLCN$9$k!%(B Mercurial$B$O(B\texttt{url}$B$H$$$&(BPython$B%Q%i%a!<(B +$B%?$^$?$O(B\envar{HG\_URL}$B$H$$$&4D6-JQ?t$r;H$C$FDLCN$r9T$&!%(B + +%This information is not always known. If a hook is invoked in a +%repository that is being served via http or ssh, Mercurial cannot tell +%where the remote repository is, but it may know where the client is + +%connecting from. In such cases, the URL will take one of the +%following forms: +%\begin{itemize} +%\item \texttt{remote:ssh:\emph{ip-address}}---remote ssh client, at +% the given IP address. +%\item \texttt{remote:http:\emph{ip-address}}---remote http client, at +% the given IP address. If the client is using SSL, this will be of +% the form \texttt{remote:https:\emph{ip-address}}. +%\item Empty---no information could be discovered about the remote +% client. +%\end{itemize} + +$B$3$N>pJs$O$$$D$b4{CN$G$"$k!%(Bhttp$B$^$?$O(Bssh$B$G%5!<%S%9$5$l$F$$$k%j%]%8%H%j$+(B +$B$i%U%C%/$,5/F0$5$l$?>l9g!$(BMercurial$B$O%j%b!<%H%j%]%8%H%j$,$I$3$K$"$k$N$+$r(B +$BDLCN$9$k$3$H$O$G$-$J$$$,!$%/%i%$%"%s%H$,$I$3$+$i@\B3$7$F$$$k$N$+$OCN$k$3(B +$B$H$,$G$-$k!%(B + +$B$=$N>l9g!$(BURL$B$O<!$N$$$:$l$+$N7A<0$r<h$k!'(B \begin{itemize} -\item \texttt{remote:ssh:\emph{ip-address}}---remote ssh client, at - the given IP address. -\item \texttt{remote:http:\emph{ip-address}}---remote http client, at - the given IP address. If the client is using SSL, this will be of - the form \texttt{remote:https:\emph{ip-address}}. -\item Empty---no information could be discovered about the remote - client. +\item \texttt{remote:ssh:\emph{ip-address}}---$B$"$k(BIP$B%"%I%l%9>e$N%j%b!<%H(B + ssh$B%/%i%$%"%s%H(B +\item \texttt{remote:http:\emph{ip-address}}---$B$"$k(BIP$B%"%I%l%9>e$N(Bhttp$B%/(B + $B%i%$%"%s%H!%$b$7%/%i%$%"%s%H$,(BSSL$B$r;HMQ$7$F$$$k>l(B + $B9g!$(B\texttt{remote:https:\emph{ip-address}}$B$N$h$&$J7A<0$K$J$k!%(B +\item Empty---$B%j%b!<%H%/%i%$%"%s%H$K4X$9$k>pJs$,$J$$!%(B +\end{itemize} + +%\begin{itemize} +%\item \texttt{remote:ssh:\emph{ip-address}}---remote ssh client, at +% the given IP address. +%\item \texttt{remote:http:\emph{ip-address}}---remote http client, at +% the given IP address. If the client is using SSL, this will be of +% the form \texttt{remote:https:\emph{ip-address}}. +%\item Empty---no information could be discovered about the remote +% client. +%\end{itemize} + +\begin{itemize} +\item \texttt{remote:ssh:\emph{ip-address}}---$BM?$($i$l$?(BIP$B%"%I%l%9$N%j%b!<(B + $B%H(Bssh$B%/%i%$%"%s%H!%(B +\item \texttt{remote:http:\emph{ip-address}}---$BM?$($i$l$?(BIP$B%"%I%l%9$N%j%b!<(B + $B%H(Bhttp$B%/%i%$%"%s%H!%%/%i%$%"%s%H$,(BSSL$B$r;H$C$F$$$k>l9g$O(B + \texttt{remote:https:\emph{ip-address}}$B$N7A<0$K$J$k!%(B +\item $B6uGr(B---$B%j%b!<%H%/%i%$%"%s%H$K$D$$$F$N>pJs$OF@$i$l$J$+$C$?!%(B \end{itemize} %\section{Hook reference} @@ -1889,105 +1966,190 @@ \subsection{\hook{changegroup}---$B%j%b!<%H%A%'%s%8%;%C%H$,DI2C$5$l$?8e(B} \label{sec:hook:changegroup} -This hook is run after a group of pre-existing changesets has been -added to the repository, for example via a \hgcmd{pull} or -\hgcmd{unbundle}. This hook is run once per operation that added one -or more changesets. This is in contrast to the \hook{incoming} hook, -which is run once per changeset, regardless of whether the changesets -arrive in a group. - -Some possible uses for this hook include kicking off an automated -build or test of the added changesets, updating a bug database, or -notifying subscribers that a repository contains new changes. - -Parameters to this hook: +%This hook is run after a group of pre-existing changesets has been +%added to the repository, for example via a \hgcmd{pull} or +%\hgcmd{unbundle}. This hook is run once per operation that added one +%or more changesets. This is in contrast to the \hook{incoming} hook, +%which is run once per changeset, regardless of whether the changesets +%arrive in a group. + +$B$3$N%U%C%/$O!$(B\hgcmd{pull}$B$^$?$O(B\hgcmd{unbundle}$B$J$I$G4{B8$N%A%'%s%8%;%C(B +$B%H%0%k!<%W$,%j%]%8%H%j$KDI2C$5$l$?8e$K<B9T$5$l$k!%$3$N%U%C%/$O!$(B1$B$D0J>e$N(B +$B%A%'%s%8%;%C%H$rDI2C$9$k%*%Z%l!<%7%g%s$K$D$-0lEY<B9T$5$l$k!%%0%k!<%W$K4X(B +$B78$J$/%A%'%s%8%;%C%H(B1$B$DKh$K<B9T$5$l$k(B\hook{incoming}$B%U%C%/$H$OBP>HE*$G$"(B +$B$k!%(B + +%Some possible uses for this hook include kicking off an automated +%build or test of the added changesets, updating a bug database, or +%notifying subscribers that a repository contains new changes. + +$B$3$N%U%C%/$r;H$C$FDI2C$5$l$?%A%'%s%8%;%C%H$KBP$9$k<+F0%S%k%I$d%F%9%H$r5/(B +$BF0$9$k$3$H$d!$?7$?$JJQ99$r;}$D%j%]%8%H%j$N9VFI<T$KDLCN$9$k$3$H$,$G$-$k!%(B + +%Parameters to this hook: +%\begin{itemize} +%\item[\texttt{node}] A changeset ID. The changeset ID of the first +% changeset in the group that was added. All changesets between this +% and \index{tags!\texttt{tip}}\texttt{tip}, inclusive, were added by +% a single \hgcmd{pull}, \hgcmd{push} or \hgcmd{unbundle}. +%\item[\texttt{source}] A string. The source of these changes. See +% section~\ref{sec:hook:sources} for details. +%\item[\texttt{url}] A URL. The location of the remote repository, if +% known. See section~\ref{sec:hook:url} for more information. +%\end{itemize} + +$B$3$N%U%C%/$X$N%Q%i%a!<%?!'(B \begin{itemize} -\item[\texttt{node}] A changeset ID. The changeset ID of the first - changeset in the group that was added. All changesets between this - and \index{tags!\texttt{tip}}\texttt{tip}, inclusive, were added by - a single \hgcmd{pull}, \hgcmd{push} or \hgcmd{unbundle}. -\item[\texttt{source}] A string. The source of these changes. See - section~\ref{sec:hook:sources} for details. -\item[\texttt{url}] A URL. The location of the remote repository, if - known. See section~\ref{sec:hook:url} for more information. +\item[\texttt{node}] $B%A%'%s%8%;%C%H(BID$B!%DI2C$5$l$?%0%k!<%W$N:G=i$N%A%'%s%8(B + $B%;%C%H$N(BID$B!%$3$N(BID$B$r4^$_(B + \index{tags!\texttt{tip}}\texttt{tip}$B$^$G$N4V$N%A%'%s%8%;%C(B + $B%HA4$F$O0l2s$N(B\hgcmd{pull}$B!$(B\hgcmd{push}$B$^$?$O(B + \hgcmd{unbundle}$B$GDI2C$5$l$?!%(B +\item[\texttt{source}] $BJ8;zNs!%$3$l$i$NJQ99$N%=!<%9!%>\:Y$K$D$$$F$O(B + \ref{sec:hook:sources}$B$r;2>H$N$3$H!%(B +\item[\texttt{url}] URL$B!%%j%b!<%H%j%]%8%H%j$,FCDj$G$-$k>l9g$O$=$N%"%I%l(B + $B%9!%>\:Y$K$D$$$F$O(B\ref{sec:hook:url}$B$r;2>H$N$3$H!%(B \end{itemize} -See also: \hook{incoming} (section~\ref{sec:hook:incoming}), -\hook{prechangegroup} (section~\ref{sec:hook:prechangegroup}), -\hook{pretxnchangegroup} (section~\ref{sec:hook:pretxnchangegroup}) +%See also: \hook{incoming} (section~\ref{sec:hook:incoming}), +%\hook{prechangegroup} (section~\ref{sec:hook:prechangegroup}), +%\hook{pretxnchangegroup} (section~\ref{sec:hook:pretxnchangegroup}) + +$B;29M!'(B\hook{incoming} (\ref{sec:hook:incoming}$B@a(B), \hook{prechangegroup} +(\ref{sec:hook:prechangegroup}$B@a(B), \hook{pretxnchangegroup} +(\ref{sec:hook:pretxnchangegroup}$B@a(B) %\subsection{\hook{commit}---after a new changeset is created} \subsection{\hook{commit}---$B?7$7$$%A%'%s%8%;%C%H$,:n@.$5$l$?8e(B} \label{sec:hook:commit} -This hook is run after a new changeset has been created. - -Parameters to this hook: +%This hook is run after a new changeset has been created. + +$B$3$N%U%C%/$O?7$?$J%A%'%s%8%;%C%H$,:n$i$l$?8e$K8F$P$l$k!%(B + +%Parameters to this hook: +%\begin{itemize} +%\item[\texttt{node}] A changeset ID. The changeset ID of the newly +% committed changeset. +%\item[\texttt{parent1}] A changeset ID. The changeset ID of the first +% parent of the newly committed changeset. +%\item[\texttt{parent2}] A changeset ID. The changeset ID of the second +% parent of the newly committed changeset. +%\end{itemize} + +$B$3$N%U%C%/$X$N%Q%i%a!<%?!'(B \begin{itemize} -\item[\texttt{node}] A changeset ID. The changeset ID of the newly - committed changeset. -\item[\texttt{parent1}] A changeset ID. The changeset ID of the first - parent of the newly committed changeset. -\item[\texttt{parent2}] A changeset ID. The changeset ID of the second - parent of the newly committed changeset. +\item[\texttt{node}] $B%A%'%s%8%;%C%H(BID$B!%?7$?$K%3%_%C%H$5$l$?%A%'%s%8%;%C(B + $B%H$N(BID$B!%(B +\item[\texttt{parent1}] $B%A%'%s%8%;%C%H(BID$B!%?7$?$K%3%_%C%H$5$l$?%A%'%s%8%;%C(B + $B%H$N(B1$B$DL\$N?F$N%A%'%s%8%;%C%H(BID. +\item[\texttt{parent2}] $B%A%'%s%8%;%C%H(BID$B!%?7$?$K%3%_%C%H$5$l$?%A%'%s%8%;%C(B + $B%H$N(B2$B$DL\$N?F$N%A%'%s%8%;%C%H(BID. \end{itemize} -See also: \hook{precommit} (section~\ref{sec:hook:precommit}), -\hook{pretxncommit} (section~\ref{sec:hook:pretxncommit}) +%See also: \hook{precommit} (section~\ref{sec:hook:precommit}), +%\hook{pretxncommit} (section~\ref{sec:hook:pretxncommit}) + +$B;29M!'(B\hook{precommit} (\ref{sec:hook:precommit}$B@a(B), \hook{pretxncommit} +(\ref{sec:hook:pretxncommit}$B@a(B) + %\subsection{\hook{incoming}---after one remote changeset is added} \subsection{\hook{incoming}---$B%j%b!<%H%A%'%s%8%;%C%H$,DI2C$5$l$?8e(B} \label{sec:hook:incoming} -This hook is run after a pre-existing changeset has been added to the -repository, for example via a \hgcmd{push}. If a group of changesets -was added in a single operation, this hook is called once for each -added changeset. - -You can use this hook for the same purposes as the \hook{changegroup} -hook (section~\ref{sec:hook:changegroup}); it's simply more convenient -sometimes to run a hook once per group of changesets, while other -times it's handier once per changeset. - -Parameters to this hook: +%This hook is run after a pre-existing changeset has been added to the +%repository, for example via a \hgcmd{push}. If a group of changesets +%was added in a single operation, this hook is called once for each +%added changeset. + +$B$3$N%U%C%/$O(B\hgcmd{push}$B%3%^%s%I$J$I$G4{B8$N%A%'%s%8%;%C%H$,%j%]%8%H%j$K(B +$BDI2C$5$l$?8e$G<B9T$5$l$k!%%A%'%s%8%;%C%H$N%0%k!<%W$,0lEY$KDI2C$5$l$?>l(B +$B9g!$3F!9$N%A%'%s%8%;%C%H$K$D$$$F0lEY$:$D$3$N%U%C%/$,8F$S=P$5$l$k!%(B + +%You can use this hook for the same purposes as the \hook{changegroup} +%hook (section~\ref{sec:hook:changegroup}); it's simply more convenient +%sometimes to run a hook once per group of changesets, while other +%times it's handier once per changeset. + +$B$3$N%U%C%/$O(B\hook{changegroup}(\ref{sec:hook:changegroup}$B@a(B)$B$HF1$8L\E*$G(B +$B;H$&$3$H$,$G$-$k!%0c$$$O(B\hook{changegroup}$B$,%A%'%s%8%;%C%H%0%k!<%WA4BN$K(B +$BBP$7$F0lEY8F$P$l$kE@$G$"$k!%(B + +%Parameters to this hook: +%\begin{itemize} +%\item[\texttt{node}] A changeset ID. The ID of the newly added +% changeset. +%\item[\texttt{source}] A string. The source of these changes. See +% section~\ref{sec:hook:sources} for details. +%\item[\texttt{url}] A URL. The location of the remote repository, if +% known. See section~\ref{sec:hook:url} for more information. +%\end{itemize} + +$B$3$N%U%C%/$X$N%Q%i%a!<%?!'(B \begin{itemize} -\item[\texttt{node}] A changeset ID. The ID of the newly added - changeset. -\item[\texttt{source}] A string. The source of these changes. See - section~\ref{sec:hook:sources} for details. -\item[\texttt{url}] A URL. The location of the remote repository, if - known. See section~\ref{sec:hook:url} for more information. +\item[\texttt{node}] $B%A%'%s%8%;%C%H(BID$B!%?7$?$KDI2C$5$l$k%A%'%s%8%;%C%H$N(B + ID$B!%(B +\item[\texttt{source}] $BJ8;zNs!%$3$l$i$NJQ99$N%=!<%9!%>\:Y$K$D$$$F$O(B + \ref{sec:hook:sources}$B$r;2>H$N$3$H!%(B +\item[\texttt{url}] URL$B!%%j%b!<%H%j%]%8%H%j$,FCDj$G$-$k>l9g$K$O$=$N%"%I(B + $B%l%9!%>\:Y$K$D$$$F$O(B\ref{sec:hook:url}$B$r;2>H$N$3$H!%(B \end{itemize} -See also: \hook{changegroup} (section~\ref{sec:hook:changegroup}) \hook{prechangegroup} (section~\ref{sec:hook:prechangegroup}), \hook{pretxnchangegroup} (section~\ref{sec:hook:pretxnchangegroup}) +%See also: \hook{changegroup} (section~\ref{sec:hook:changegroup}) \hook{prechangegroup} (section~\ref{sec:hook:prechangegroup}), \hook{pretxnchangegroup} (section~\ref{sec:hook:pretxnchangegroup}) +$B;29M!'(B\hook{changegroup} (\ref{sec:hook:changegroup}$B@a(B) +\hook{prechangegroup} (\ref{sec:hook:prechangegroup}$B@a(B), +\hook{pretxnchangegroup} (\ref{sec:hook:pretxnchangegroup}$B@a(B) %\subsection{\hook{outgoing}---after changesets are propagated} \subsection{\hook{outgoing}---$B%A%'%s%8%;%C%H$,GH5Z$7$?8e(B} \label{sec:hook:outgoing} -This hook is run after a group of changesets has been propagated out -of this repository, for example by a \hgcmd{push} or \hgcmd{bundle} -command. - -One possible use for this hook is to notify administrators that -changes have been pulled. - -Parameters to this hook: +%This hook is run after a group of changesets has been propagated out +%of this repository, for example by a \hgcmd{push} or \hgcmd{bundle} +%command. + +$B$3$N%U%C%/$O%A%'%s%8%;%C%H$N%0%k!<%W$,(B\hgcmd{push}$B$d(B\hgcmd{bundle}$B%3%^%s(B +$B%I$J$I$K$h$C$F30It$KGH5Z$7$?8e$G<B9T$5$l$k!%(B + +%One possible use for this hook is to notify administrators that +%changes have been pulled. + +$B$3$N%U%C%/$r;H$C$F4IM}<T$O(Bpull$B$5$l$?JQ99$rCN$k$3$H$,$G$-$k!%(B + +%Parameters to this hook: +%\begin{itemize} +%\item[\texttt{node}] A changeset ID. The changeset ID of the first +% changeset of the group that was sent. +%\item[\texttt{source}] A string. The source of the of the operation +% (see section~\ref{sec:hook:sources}). If a remote client pulled +% changes from this repository, \texttt{source} will be +% \texttt{serve}. If the client that obtained changes from this +% repository was local, \texttt{source} will be \texttt{bundle}, +% \texttt{pull}, or \texttt{push}, depending on the operation the +% client performed. +%\item[\texttt{url}] A URL. The location of the remote repository, if +% known. See section~\ref{sec:hook:url} for more information. +%\end{itemize} + +$B$3$N%U%C%/$X$N%Q%i%a!<%?!'(B \begin{itemize} -\item[\texttt{node}] A changeset ID. The changeset ID of the first - changeset of the group that was sent. -\item[\texttt{source}] A string. The source of the of the operation - (see section~\ref{sec:hook:sources}). If a remote client pulled - changes from this repository, \texttt{source} will be - \texttt{serve}. If the client that obtained changes from this - repository was local, \texttt{source} will be \texttt{bundle}, - \texttt{pull}, or \texttt{push}, depending on the operation the - client performed. -\item[\texttt{url}] A URL. The location of the remote repository, if - known. See section~\ref{sec:hook:url} for more information. +\item[\texttt{node}] $B%A%'%s%8%;%C%H(BID$B!%Aw?.$5$l$?%A%'%s%8%;%C%H%0%k!<%W(B + $B$N:G=i$N%A%'%s%8%;%C%H(BID. +\item[\texttt{source}] $BJ8;zNs!%A`:n85(B(~\ref{sec:hook:sources}$B@a$r;2>H(B)$B!%(B + $B%j%b!<%H%/%i%$%"%s%H$,JQ99$r%j%]%8%H%j$+$i(Bpull$B$9$k$H(B + \texttt{source}$B$,(B\texttt{serve}$B$H$J$k!%%j%]%8%H%j$+$iJQ99$r(B + $BF~<j$7$?%/%i%$%"%s%H$,%m!<%+%k$G$"$l$P!$(B\texttt{source}$B$O%/(B + $B%i%$%"%s%H$N9T$C$?F0:n$K1~$8$F(B + \texttt{bundle}$B!$(B\texttt{pull}$B!$(B\texttt{push}$B$N$$$:$l$+$H$J(B + $B$k!%(B +\item[\texttt{url}] URL$B!%%j%b!<%H%j%]%8%H%j$,FCDj$G$-$k>l9g$O$=$N%"%I%l%9!%(B + $B>\:Y$K$D$$$F$O(B\ref{sec:hook:url}$B@a$r;2>H$N$3$H!%(B \end{itemize} -See also: \hook{preoutgoing} (section~\ref{sec:hook:preoutgoing}) + +%See also: \hook{preoutgoing} (section~\ref{sec:hook:preoutgoing}) +$B;29M!'(B \hook{preoutgoing} (\ref{sec:hook:preoutgoing}$B@a(B) %\subsection{\hook{prechangegroup}---before starting to add remote %changesets} @@ -1995,31 +2157,48 @@ $BA0(B} \label{sec:hook:prechangegroup} -This controlling hook is run before Mercurial begins to add a group of -changesets from another repository. - -This hook does not have any information about the changesets to be -added, because it is run before transmission of those changesets is -allowed to begin. If this hook fails, the changesets will not be -transmitted. - -One use for this hook is to prevent external changes from being added -to a repository. For example, you could use this to ``freeze'' a -server-hosted branch temporarily or permanently so that users cannot -push to it, while still allowing a local administrator to modify the -repository. - -Parameters to this hook: +%This controlling hook is run before Mercurial begins to add a group of +%changesets from another repository. + +$B$3$N@)8f%U%C%/$O(BMercurial$B$,0lO"$N%A%'%s%8%;%C%H$rJL$N%j%]%8%H%j$KDI2C$9(B +$B$kA0$K<B9T$5$l$k!%(B + +%This hook does not have any information about the changesets to be +%added, because it is run before transmission of those changesets is +%allowed to begin. If this hook fails, the changesets will not be +%transmitted. + +$B$3$N%U%C%/$ODI2C$5$l$k%A%'%s%8%;%C%H$N>pJs$O2?$b;}$?$J$$!%$J$<$J$i$3$N%U%C(B +$B%/$O%A%'%s%8%;%C%H$NAw?.$,;O$^$kA0$K<B9T$5$l$k$+$i$@!%%U%C%/$N<B9T$,<:GT(B +$B$7$?>l9g$O%A%'%s%8%;%C%H$OAw?.$5$l$J$$!%(B + +%One use for this hook is to prevent external changes from being added +%to a repository. For example, you could use this to ``freeze'' a +%server-hosted branch temporarily or permanently so that users cannot +%push to it, while still allowing a local administrator to modify the +%repository. + +$B$3$N%U%C%/$r;H$C$F!$30It$NJQ99$,%j%]%8%H%j$K$D$$$+$5$l$J$$$h$&$K$9$k$3$H(B +$B$b$G$-$k!%Nc$($P!$$3$N%U%C%/$r%5!<%P$GDs6!$5$l$k%V%i%s%A$r0l;~E*$^$?$O1J(B +$BB3E*$K(B``$BE`7k(B''$B$7!$%m!<%+%k$J4IM}<T$O%j%]%8%H%j$rJQ99$G$-$k$,!$%j%b!<%H(B +$B%f!<%6$O$=$N%j%]%8%H%j$K(Bpush$B$G$-$J$$$h$&$K$G$-$k!%(B + +%Parameters to this hook: +$B$3$N%U%C%/$X$N%Q%i%a!<%?!'(B \begin{itemize} -\item[\texttt{source}] A string. The source of these changes. See - section~\ref{sec:hook:sources} for details. -\item[\texttt{url}] A URL. The location of the remote repository, if - known. See section~\ref{sec:hook:url} for more information. +\item[\texttt{source}] $BJ8;zNs!%JQ99$N%=!<%9!%>\:Y$K$D$$$F$O(B + \ref{sec:hook:sources}$B$r;2>H!%(B +\item[\texttt{url}] URL$B!%%j%b!<%H%j%]%8%H%j$,FCDj$5$l$k>l9g$O$=$N%"%I%l(B + $B%9!%>\:Y$K$D$$$F$O(B\ref{sec:hook:url}$B$r;2>H!%(B \end{itemize} -See also: \hook{changegroup} (section~\ref{sec:hook:changegroup}), -\hook{incoming} (section~\ref{sec:hook:incoming}), , -\hook{pretxnchangegroup} (section~\ref{sec:hook:pretxnchangegroup}) +%See also: \hook{changegroup} (section~\ref{sec:hook:changegroup}), +%\hook{incoming} (section~\ref{sec:hook:incoming}), , +%\hook{pretxnchangegroup} (section~\ref{sec:hook:pretxnchangegroup}) + +$B;29M!'(B \hook{changegroup} (\ref{sec:hook:changegroup}$B@a(B)$B!$(B +\hook{incoming} (\ref{sec:hook:incoming}$B@a(B)$B!$(B +\hook{pretxnchangegroup} (\ref{sec:hook:pretxnchangegroup}$B@a(B) %\subsection{\hook{precommit}---before starting to commit a changeset} \subsection{\hook{precommit}---$B%A%'%s%8%;%C%H$r%3%_%C%H$9$kA0(B} @@ -2123,7 +2302,7 @@ $B9g$O%?%0$,:n@.$5$l$k!%%U%C%/$N<B9T$,<:GT$7$?>l9g$O%?%0$O:n@.$5$l$J$$!%(B %Parameters to this hook: -$B$3$N%U%C%/$X$N%Q%i%a!<%?(B +$B$3$N%U%C%/$X$N%Q%i%a!<%?!'(B %\begin{itemize} %\item[\texttt{local}] A boolean. Whether the tag is local to this % repository instance (i.e.~stored in \sfilename{.hg/localtags}) or