hgbook

changeset 64:d12a199ed472

Update hook reference.
author Bryan O'Sullivan <bos@serpentine.com>
date Fri Aug 04 13:43:26 2006 -0700 (2006-08-04)
parents a00b562b4598
children e3894bb9d1f5
files en/hook.tex
line diff
     1.1 --- a/en/hook.tex	Fri Aug 04 13:32:23 2006 -0700
     1.2 +++ b/en/hook.tex	Fri Aug 04 13:43:26 2006 -0700
     1.3 @@ -535,16 +535,16 @@
     1.4  which lists the sources of incoming changesets that the hook should
     1.5  pay attention to.  You don't normally need to configure this section.
     1.6  \begin{itemize}
     1.7 -\item[\texttt{serve}] Control incoming changesets that are arriving
     1.8 +\item[\rcitem{acl}{serve}] Control incoming changesets that are arriving
     1.9    from a remote repository over http or ssh.  This is the default
    1.10    value of \rcitem{acl}{sources}, and usually the only setting you'll
    1.11    need for this configuration item.
    1.12 -\item[\texttt{pull}] Control incoming changesets that are arriving via
    1.13 -  a pull from a local repository.
    1.14 -\item[\texttt{push}] Control incoming changesets that are arriving via
    1.15 -  a push from a local repository.
    1.16 -\item[\texttt{bundle}] Control incoming changesets that are arriving
    1.17 -  from another repository via a bundle.
    1.18 +\item[\rcitem{acl}{pull}] Control incoming changesets that are
    1.19 +  arriving via a pull from a local repository.
    1.20 +\item[\rcitem{acl}{push}] Control incoming changesets that are
    1.21 +  arriving via a push from a local repository.
    1.22 +\item[\rcitem{acl}{bundle}] Control incoming changesets that are
    1.23 +  arriving from another repository via a bundle.
    1.24  \end{itemize}
    1.25  
    1.26  The \rcsection{acl.allow} section controls the users that are allowed to
    1.27 @@ -649,33 +649,36 @@
    1.28  Configuration information for this hook lives in the
    1.29  \rcsection{bugzilla} section of your \hgrc.
    1.30  \begin{itemize}
    1.31 -\item[\texttt{version}] The version of Bugzilla installed on the
    1.32 -  server.  The database schema that Bugzilla uses changes
    1.33 +\item[\rcitem{bugzilla}{version}] The version of Bugzilla installed on
    1.34 +  the server.  The database schema that Bugzilla uses changes
    1.35    occasionally, so this hook has to know exactly which schema to use.
    1.36    At the moment, the only version supported is \texttt{2.16}.
    1.37 -\item[\texttt{host}] The hostname of the MySQL server that stores your
    1.38 -  Bugzilla data.  The database must be configured to allow connections
    1.39 -  from whatever host you are running the \hook{bugzilla} hook on.
    1.40 -\item[\texttt{user}] The username with which to connect to the MySQL
    1.41 -  server.  The database must be configured to allow this user to
    1.42 -  connect from whatever host you are running the \hook{bugzilla} hook
    1.43 -  on.  This user must be able to access and modify Bugzilla tables.
    1.44 -  The default value of this item is \texttt{bugs}, which is the
    1.45 -  standard name of the Bugzilla user in a MySQL database.
    1.46 -\item[\texttt{password}] The MySQL password for the user you
    1.47 +\item[\rcitem{bugzilla}{host}] The hostname of the MySQL server that
    1.48 +  stores your Bugzilla data.  The database must be configured to allow
    1.49 +  connections from whatever host you are running the \hook{bugzilla}
    1.50 +  hook on.
    1.51 +\item[\rcitem{bugzilla}{user}] The username with which to connect to
    1.52 +  the MySQL server.  The database must be configured to allow this
    1.53 +  user to connect from whatever host you are running the
    1.54 +  \hook{bugzilla} hook on.  This user must be able to access and
    1.55 +  modify Bugzilla tables.  The default value of this item is
    1.56 +  \texttt{bugs}, which is the standard name of the Bugzilla user in a
    1.57 +  MySQL database.
    1.58 +\item[\rcitem{bugzilla}{password}] The MySQL password for the user you
    1.59    configured above.  This is stored as plain text, so you should make
    1.60    sure that unauthorised users cannot read the \hgrc\ file where you
    1.61    store this information.
    1.62 -\item[\texttt{db}] The name of the Bugzilla database on the MySQL
    1.63 -  server.  The default value of this item is \texttt{bugs}, which is
    1.64 -  the standard name of the MySQL database where Bugzilla stores its
    1.65 -  data.
    1.66 -\item[\texttt{notify}] If you want Bugzilla to send out a notification
    1.67 -  email to subscribers after this hook has added a comment to a bug,
    1.68 -  you will need this hook to run a command whenever it updates the
    1.69 -  database.  The command to run depends on where you have installed
    1.70 -  Bugzilla, but it will typically look something like this, if you
    1.71 -  have Bugzilla installed in \dirname{/var/www/html/bugzilla}:
    1.72 +\item[\rcitem{bugzilla}{db}] The name of the Bugzilla database on the
    1.73 +  MySQL server.  The default value of this item is \texttt{bugs},
    1.74 +  which is the standard name of the MySQL database where Bugzilla
    1.75 +  stores its data.
    1.76 +\item[\rcitem{bugzilla}{notify}] If you want Bugzilla to send out a
    1.77 +  notification email to subscribers after this hook has added a
    1.78 +  comment to a bug, you will need this hook to run a command whenever
    1.79 +  it updates the database.  The command to run depends on where you
    1.80 +  have installed Bugzilla, but it will typically look something like
    1.81 +  this, if you have Bugzilla installed in
    1.82 +  \dirname{/var/www/html/bugzilla}:
    1.83    \begin{codesample4}
    1.84      cd /var/www/html/bugzilla && ./processmail %s nobody@nowhere.com
    1.85    \end{codesample4}
    1.86 @@ -706,8 +709,8 @@
    1.87  external \filename{usermap} file.  In the latter case, you can store
    1.88  \filename{usermap} data by itself in (for example) a user-modifiable
    1.89  repository.  This makes it possible to let your users maintain their
    1.90 -own \texttt{usermap} entries.  The main \hgrc\ file might look like
    1.91 -this:
    1.92 +own \rcitem{bugzilla}{usermap} entries.  The main \hgrc\ file might
    1.93 +look like this:
    1.94  \begin{codesample2}
    1.95    # regular hgrc file refers to external usermap file
    1.96    [bugzilla]
    1.97 @@ -728,12 +731,6 @@
    1.98  entries (still in the \rcsection{bugzilla} section) control this
    1.99  behaviour.
   1.100  \begin{itemize}
   1.101 -\item[\texttt{hgweb}] The base string to use when constructing a URL
   1.102 -  that will let users browse from a Bugzilla comment to view a
   1.103 -  changeset.  Example:
   1.104 -  \begin{codesample4}
   1.105 -    hgweb = http://hg.domain.com/
   1.106 -  \end{codesample4}
   1.107  \item[\texttt{strip}] The number of leading path elements to strip
   1.108    from a repository's path name to construct a partial path for a URL.
   1.109    For example, if the repositories on your server live under
   1.110 @@ -749,6 +746,16 @@
   1.111    \texttt{strip} above).
   1.112  \end{itemize}
   1.113  
   1.114 +In addition, you can add a \rcitem{web}{baseurl} item to the
   1.115 +\rcsection{web} section of your \hgrc.  The \hgext{bugzilla} hook will
   1.116 +make this available when expanding a template, as the base string to
   1.117 +use when constructing a URL that will let users browse from a Bugzilla
   1.118 +comment to view a changeset.  Example:
   1.119 +\begin{codesample2}
   1.120 +  [web]
   1.121 +  baseurl = http://hg.domain.com/
   1.122 +\end{codesample2}
   1.123 +
   1.124  Here is an example set of \hgext{bugzilla} hook config information.
   1.125  \begin{codesample2}
   1.126    [bugzilla]
   1.127 @@ -931,7 +938,7 @@
   1.128  setting \rcitem{notify}{test} to \texttt{false}.  Until you do that,
   1.129  it simply prints the message it \emph{would} send.
   1.130  
   1.131 -\section{Hook reference}
   1.132 +\section{Information for writers of hooks}
   1.133  \label{sec:hook:ref}
   1.134  
   1.135  \subsection{In-process hook execution}
   1.136 @@ -1049,7 +1056,9 @@
   1.137    client.
   1.138  \end{itemize}
   1.139  
   1.140 -\subsection{The \hook{changegroup} hook}
   1.141 +\section{Hook reference}
   1.142 +
   1.143 +\subsection{\hook{changegroup}---after remote changesets added}
   1.144  \label{sec:hook:changegroup}
   1.145  
   1.146  This hook is run after a group of pre-existing changesets has been
   1.147 @@ -1079,7 +1088,7 @@
   1.148  \hook{prechangegroup} (section~\ref{sec:hook:prechangegroup}),
   1.149  \hook{pretxnchangegroup} (section~\ref{sec:hook:pretxnchangegroup})
   1.150  
   1.151 -\subsection{The \hook{commit} hook}
   1.152 +\subsection{\hook{commit}---after a new changeset is created}
   1.153  \label{sec:hook:commit}
   1.154  
   1.155  This hook is run after a new changeset has been created.
   1.156 @@ -1097,7 +1106,7 @@
   1.157  See also: \hook{precommit} (section~\ref{sec:hook:precommit}),
   1.158  \hook{pretxncommit} (section~\ref{sec:hook:pretxncommit})
   1.159  
   1.160 -\subsection{The \hook{incoming} hook}
   1.161 +\subsection{\hook{incoming}---after one remote changeset is added}
   1.162  \label{sec:hook:incoming}
   1.163  
   1.164  This hook is run after a pre-existing changeset has been added to the
   1.165 @@ -1122,7 +1131,7 @@
   1.166  
   1.167  See also: \hook{changegroup} (section~\ref{sec:hook:changegroup}) \hook{prechangegroup} (section~\ref{sec:hook:prechangegroup}), \hook{pretxnchangegroup} (section~\ref{sec:hook:pretxnchangegroup})
   1.168  
   1.169 -\subsection{The \hook{outgoing} hook}
   1.170 +\subsection{\hook{outgoing}---after changesets are propagated}
   1.171  \label{sec:hook:outgoing}
   1.172  
   1.173  This hook is run after a group of changesets has been propagated out
   1.174 @@ -1149,7 +1158,7 @@
   1.175  
   1.176  See also: \hook{preoutgoing} (section~\ref{sec:hook:preoutgoing})
   1.177  
   1.178 -\subsection{The \hook{prechangegroup} hook}
   1.179 +\subsection{\hook{prechangegroup}---before starting to add remote changesets}
   1.180  \label{sec:hook:prechangegroup}
   1.181  
   1.182  This controlling hook is run before Mercurial begins to add a group of
   1.183 @@ -1178,7 +1187,7 @@
   1.184  \hook{incoming} (section~\ref{sec:hook:incoming}), ,
   1.185  \hook{pretxnchangegroup} (section~\ref{sec:hook:pretxnchangegroup})
   1.186  
   1.187 -\subsection{The \hook{precommit} hook}
   1.188 +\subsection{\hook{precommit}---before starting to commit a changeset}
   1.189  \label{sec:hook:precommit}
   1.190  
   1.191  This hook is run before Mercurial begins to commit a new changeset.
   1.192 @@ -1204,7 +1213,7 @@
   1.193  See also: \hook{commit} (section~\ref{sec:hook:commit}),
   1.194  \hook{pretxncommit} (section~\ref{sec:hook:pretxncommit})
   1.195  
   1.196 -\subsection{The \hook{preoutgoing} hook}
   1.197 +\subsection{\hook{preoutgoing}---before starting to propagate changesets}
   1.198  \label{sec:hook:preoutgoing}
   1.199  
   1.200  This hook is invoked before Mercurial knows the identities of the
   1.201 @@ -1227,7 +1236,7 @@
   1.202  
   1.203  See also: \hook{outgoing} (section~\ref{sec:hook:outgoing})
   1.204  
   1.205 -\subsection{The \hook{pretag} hook}
   1.206 +\subsection{\hook{pretag}---before tagging a changeset}
   1.207  \label{sec:hook:pretag}
   1.208  
   1.209  This controlling hook is run before a tag is created.  If the hook
   1.210 @@ -1249,7 +1258,8 @@
   1.211  
   1.212  See also: \hook{tag} (section~\ref{sec:hook:tag})
   1.213  
   1.214 -\subsection{The \hook{pretxnchangegroup} hook}
   1.215 +\subsection{\hook{pretxnchangegroup}---before completing addition of
   1.216 +  remote changesets}
   1.217  \label{sec:hook:pretxnchangegroup}
   1.218  
   1.219  This controlling hook is run before a transaction---that manages the
   1.220 @@ -1288,7 +1298,7 @@
   1.221  \hook{incoming} (section~\ref{sec:hook:incoming}),
   1.222  \hook{prechangegroup} (section~\ref{sec:hook:prechangegroup})
   1.223  
   1.224 -\subsection{The \hook{pretxncommit} hook}
   1.225 +\subsection{\hook{pretxncommit}---before completing commit of new changeset}
   1.226  \label{sec:hook:pretxncommit}
   1.227  
   1.228  This controlling hook is run before a transaction---that manages a new
   1.229 @@ -1318,7 +1328,7 @@
   1.230  
   1.231  See also: \hook{precommit} (section~\ref{sec:hook:precommit})
   1.232  
   1.233 -\subsection{The \hook{preupdate} hook}
   1.234 +\subsection{\hook{preupdate}---before updating or merging working directory}
   1.235  \label{sec:hook:preupdate}
   1.236  
   1.237  This controlling hook is run before an update or merge of the working
   1.238 @@ -1339,7 +1349,7 @@
   1.239  
   1.240  See also: \hook{update} (section~\ref{sec:hook:update})
   1.241  
   1.242 -\subsection{The \hook{tag} hook}
   1.243 +\subsection{\hook{tag}---after tagging a changeset}
   1.244  \label{sec:hook:tag}
   1.245  
   1.246  This hook is run after a tag has been created.
   1.247 @@ -1359,7 +1369,7 @@
   1.248  
   1.249  See also: \hook{pretag} (section~\ref{sec:hook:pretag})
   1.250  
   1.251 -\subsection{The \hook{update} hook}
   1.252 +\subsection{\hook{update}---after updating or merging working directory}
   1.253  \label{sec:hook:update}
   1.254  
   1.255  This hook is run after an update or merge of the working directory