hgbook

changeset 474:9438521abfc4

finished the "bundled hooks" sections
author Javier Rojas <jerojasro@devnull.li>
date Wed Dec 31 10:18:25 2008 -0500 (2008-12-31)
parents 339720510480
children 22184eb4c965
files es/hook.tex
line diff
     1.1 --- a/es/hook.tex	Sat Dec 27 19:51:53 2008 -0500
     1.2 +++ b/es/hook.tex	Wed Dec 31 10:18:25 2008 -0500
     1.3 @@ -606,7 +606,7 @@
     1.4  sólo se le permita a ciertos usuarios empujar cambios a dicho
     1.5  servidor.
     1.6  
     1.7 -\subsubsection{Configurar el gancho \hook{acl}}
     1.8 +\subsubsection{Configuración del gancho \hook{acl}}
     1.9  
    1.10  Para administrar los conjuntos de cambios entrantes, se debe usar el
    1.11  gancho \hgext{acl} como un gancho de tipo \hook{pretxnchangegroup}.
    1.12 @@ -893,126 +893,138 @@
    1.13  de Bugzilla \filename{processmail} y la asociación de nombres de
    1.14  consignadores a nombres de usuario.
    1.15  
    1.16 -Recuerde que en la sección~\ref{sec:hook:bugzilla:config} arriba que
    1.17 -el usuario que ejecuta el proceso Mercurial en el servidor es también 
    1.18 -that runs the Mercurial process on the server is also the one that
    1.19 -will run the \filename{processmail} script.  The
    1.20 -\filename{processmail} script sometimes causes Bugzilla to write to
    1.21 -files in its configuration directory, and Bugzilla's configuration
    1.22 -files are usually owned by the user that your web server runs under.
    1.23 -
    1.24 -You can cause \filename{processmail} to be run with the suitable
    1.25 -user's identity using the \command{sudo} command.  Here is an example
    1.26 -entry for a \filename{sudoers} file.
    1.27 +Recuerde que en la sección~\ref{sec:hook:bugzilla:config} arriba el
    1.28 +usuario que ejecuta el proceso Mercurial en el servidor es también 
    1.29 +el usuario que ejecutará el guión \filename{processmail}. El guión
    1.30 +\filename{processmail} algunas veces hace que Bugzilla escriba en
    1.31 +ficheros en su directorio de configuración, y los ficheros de
    1.32 +configuración de Bugzilla usualmente son propiedad del usuario bajo el
    1.33 +cual se ejecuta el servidor web.
    1.34 +
    1.35 +Usted puede hacer que \filename{processmail} sea ejecutado con la
    1.36 +identidad del usuario adecuado usando el comando \command{sudo}. A
    1.37 +continuación se presenta una entrada de ejemplo para un fichero
    1.38 +\filename{sudoers}.
    1.39  \begin{codesample2}
    1.40    hg_user = (httpd_user) NOPASSWD: /var/www/html/bugzilla/processmail-wrapper %s
    1.41  \end{codesample2}
    1.42 -This allows the \texttt{hg\_user} user to run a
    1.43 -\filename{processmail-wrapper} program under the identity of
    1.44 +Esto permite que el usuario \texttt{hg\_user} ejecute el programa
    1.45 +\filename{processmail-wrapper} con la identidad del usuario
    1.46  \texttt{httpd\_user}.
    1.47  
    1.48 -This indirection through a wrapper script is necessary, because
    1.49 -\filename{processmail} expects to be run with its current directory
    1.50 -set to wherever you installed Bugzilla; you can't specify that kind of
    1.51 -constraint in a \filename{sudoers} file.  The contents of the wrapper
    1.52 -script are simple:
    1.53 +Esta indirección a través de un guión envoltorio es necesaria, porque
    1.54 +\filename{processmail} espera que al ser ejecutado su directorio
    1.55 +actual sea aquel en el cual se instaló Bugzilla; usted no puede
    1.56 +especificar ese tipo de condición en un fichero \filename{sudoers}.
    1.57 +Los contenidos del giuón envoltorio son simples:
    1.58  \begin{codesample2}
    1.59    #!/bin/sh
    1.60    cd `dirname $0` && ./processmail "$1" nobody@example.com
    1.61  \end{codesample2}
    1.62 -It doesn't seem to matter what email address you pass to
    1.63 +No parece importar qué dirección de correo se le pase a
    1.64  \filename{processmail}.
    1.65  
    1.66 -If your \rcsection{usermap} is not set up correctly, users will see an
    1.67 -error message from the \hgext{bugzilla} hook when they push changes
    1.68 -to the server.  The error message will look like this:
    1.69 +Si su \rcsection{usermap} no es configurada correctamente, los
    1.70 +usuarios verán un mensaje de error del gancho \hgext{bugzilla} cuando
    1.71 +empujen cambios al servidor. El mensaje de error se verá así:
    1.72  \begin{codesample2}
    1.73    cannot find bugzilla user id for john.q.public@example.com
    1.74  \end{codesample2}
    1.75 -What this means is that the committer's address,
    1.76 -\texttt{john.q.public@example.com}, is not a valid Bugzilla user name,
    1.77 -nor does it have an entry in your \rcsection{usermap} that maps it to
    1.78 -a valid Bugzilla user name.
    1.79 -
    1.80 -\subsection{\hgext{notify}---send email notifications}
    1.81 -
    1.82 -Although Mercurial's built-in web server provides RSS feeds of changes
    1.83 -in every repository, many people prefer to receive change
    1.84 -notifications via email.  The \hgext{notify} hook lets you send out
    1.85 -notifications to a set of email addresses whenever changesets arrive
    1.86 -that those subscribers are interested in.
    1.87 -
    1.88 -As with the \hgext{bugzilla} hook, the \hgext{notify} hook is
    1.89 -template-driven, so you can customise the contents of the notification
    1.90 -messages that it sends.
    1.91 -
    1.92 -By default, the \hgext{notify} hook includes a diff of every changeset
    1.93 -that it sends out; you can limit the size of the diff, or turn this
    1.94 -feature off entirely.  It is useful for letting subscribers review
    1.95 -changes immediately, rather than clicking to follow a URL.
    1.96 -
    1.97 -\subsubsection{Configuring the \hgext{notify} hook}
    1.98 -
    1.99 -You can set up the \hgext{notify} hook to send one email message per
   1.100 -incoming changeset, or one per incoming group of changesets (all those
   1.101 -that arrived in a single pull or push).
   1.102 +Lo que esto quiere decir es que la dirección del consignador,
   1.103 +\texttt{john.q.public@example.com}, no es un nombre de usuario
   1.104 +Bugzilla válido, ni tiene una entrada en su \rcsection{usermap} que lo
   1.105 +asocie con un nombre de usuario válido Bugzilla.
   1.106 +
   1.107 +\subsection{\hgext{notify}---enviar notificaciones de correo
   1.108 +electrónico}
   1.109 +
   1.110 +%TODO feeds => notificaciones: lo más fácil es mirar en wikipedia
   1.111 +Aunque el servidor web embebido de Mercurial provee notificaciones de
   1.112 +cambios en cada repositorio, muchas personas prefieren recibir las
   1.113 +notificaciones de cambios vía correo electrónico. El gancho
   1.114 +\hgext{notify}\footnote{Notificación.} le permite a usted enviar
   1.115 +notificaciones a un conjunto de direcciones de correo cuando lleguen
   1.116 +conjuntos de cambios en los que los subscriptores estén interesados.
   1.117 +
   1.118 +De la misma forma que con el gancho \hgext{bugzilla}, el gancho
   1.119 +\hgext{notify} está orientado a plantillas, así que usted puede
   1.120 +personalizar los contenidos del mensaje de notificación que se envía.
   1.121 +
   1.122 +Por defecto, el gancho \hgext{notify} incluye un diff de cada conjunto
   1.123 +%TODO que se envía? revisar, pienso que es ``que se recibe''
   1.124 +de cambios que se envía; usted puede limitar el tamaño del diff, o
   1.125 +desactivar completamente esta característica. Es útil para permitir a
   1.126 +los subscriptores revisar los cambios inmediatamente, en vez de tener
   1.127 +que hacer clic para visitar una URL.
   1.128 +
   1.129 +\subsubsection{Configuración del gancho \hgext{notify}}
   1.130 +
   1.131 +Usted puede configurar el gancho \hgext{notify} para enviar un mensaje
   1.132 +de correo por conjunto de cambios entrante, o uno por grupo entrante
   1.133 +de conjuntos de cambios (todos los que llegaron en un único empuje o
   1.134 +jalado).
   1.135  \begin{codesample2}
   1.136    [hooks]
   1.137 -  # send one email per group of changes
   1.138 +  # enviar un correo por grupo de cambios
   1.139    changegroup.notify = python:hgext.notify.hook
   1.140 -  # send one email per change
   1.141 +  # enviar un correo por cambio
   1.142    incoming.notify = python:hgext.notify.hook
   1.143  \end{codesample2}
   1.144  
   1.145 -Configuration information for this hook lives in the
   1.146 -\rcsection{notify} section of a \hgrc\ file.
   1.147 -\begin{itemize}
   1.148 -\item[\rcitem{notify}{test}] By default, this hook does not send out
   1.149 -  email at all; instead, it prints the message that it \emph{would}
   1.150 -  send.  Set this item to \texttt{false} to allow email to be sent.
   1.151 -  The reason that sending of email is turned off by default is that it
   1.152 -  takes several tries to configure this extension exactly as you would
   1.153 -  like, and it would be bad form to spam subscribers with a number of
   1.154 -  ``broken'' notifications while you debug your configuration.
   1.155 -\item[\rcitem{notify}{config}] The path to a configuration file that
   1.156 -  contains subscription information.  This is kept separate from the
   1.157 -  main \hgrc\ so that you can maintain it in a repository of its own.
   1.158 -  People can then clone that repository, update their subscriptions,
   1.159 -  and push the changes back to your server.
   1.160 -\item[\rcitem{notify}{strip}] The number of leading path separator
   1.161 -  characters to strip from a repository's path, when deciding whether
   1.162 -  a repository has subscribers.  For example, if the repositories on
   1.163 -  your server live in \dirname{/home/hg/repos}, and \hgext{notify} is
   1.164 -  considering a repository named \dirname{/home/hg/repos/shared/test},
   1.165 -  setting \rcitem{notify}{strip} to \texttt{4} will cause
   1.166 -  \hgext{notify} to trim the path it considers down to
   1.167 -  \dirname{shared/test}, and it will match subscribers against that.
   1.168 -\item[\rcitem{notify}{template}] The template text to use when sending
   1.169 -  messages.  This specifies both the contents of the message header
   1.170 -  and its body.
   1.171 -\item[\rcitem{notify}{maxdiff}] The maximum number of lines of diff
   1.172 -  data to append to the end of a message.  If a diff is longer than
   1.173 -  this, it is truncated.  By default, this is set to 300.  Set this to
   1.174 -  \texttt{0} to omit diffs from notification emails.
   1.175 -\item[\rcitem{notify}{sources}] A list of sources of changesets to
   1.176 -  consider.  This lets you limit \hgext{notify} to only sending out
   1.177 -  email about changes that remote users pushed into this repository
   1.178 -  via a server, for example.  See section~\ref{sec:hook:sources} for
   1.179 -  the sources you can specify here.
   1.180 -\end{itemize}
   1.181 -
   1.182 -If you set the \rcitem{web}{baseurl} item in the \rcsection{web}
   1.183 -section, you can use it in a template; it will be available as
   1.184 -\texttt{webroot}.
   1.185 -
   1.186 -Here is an example set of \hgext{notify} configuration information.
   1.187 +La información para configurar este gancho se ubica en la sección
   1.188 +\rcsection{notify} de un fichero \hgrc.
   1.189 +\begin{itemize}
   1.190 +\item[\rcitem{notify}{test}] Por defecto, este gancho no envía correos
   1.191 +  en absoluto; en vez de eso, imprime el mensaje que se
   1.192 +  \emph{enviaría}. Fije este ítem en \texttt{false} para permitir el
   1.193 +  envío de correos. El motivo por el que el envío de correos está
   1.194 +  desactivado es que hacen falta varios intentos para configurar esta
   1.195 +  extensión exactamente como usted desea, y sería maleducado enviar a
   1.196 +  los subscriptores una cantidad de notificaciones ``rotas'' mientras
   1.197 +  usted depura su configuración.
   1.198 +\item[\rcitem{notify}{config}] La ruta a un fichero de configuración
   1.199 +  que contiene información de subscripción. Esto se mantiene separado
   1.200 +  del \hgrc\ principal para que usted pueda mantenerlo en un
   1.201 +  repositorio. La gente puede clonar ese repositorio, actualizar sus
   1.202 +  subscripciones, y empujar los cambios de vuelta a su servidor.
   1.203 +\item[\rcitem{notify}{strip}] La cantidad de caracteres iniciales de
   1.204 +  separación de ruta a remover de la ruta del repositorio, al decidir
   1.205 +  si un repositorio tiene subscriptores. Por ejemplo, si los
   1.206 +  repositorios en su servidor están en \dirname{/home/hg/repos}, y
   1.207 +  \hgext{notify} está trabajando con un repositorio llamado
   1.208 +  \dirname{/home/hg/repos/shared/test}, fijar \rcitem{notify}{strip} a
   1.209 +  \texttt{4} hará que \hgext{notify} elimine las partes iniciales de
   1.210 +  la ruta hasta \dirname{shared/test}, y asociará los subscriptores
   1.211 +  frente a dicha ruta.
   1.212 +\item[\rcitem{notify}{template}] El texto de plantilla a usar cuando
   1.213 +  se envíen mensajes. Especifica los contenidos de la cabecera del
   1.214 +  mensaje y el cuerpo del mismo.
   1.215 +\item[\rcitem{notify}{maxdiff}] El número máximo de líneas de datos de
   1.216 +  diff a añadir al final de un mensaje. Si la longitud de un diff es
   1.217 +  mayor a eso, se trunca. Por defecto, está fijado en 300. Fije esto a 
   1.218 +  \texttt{0} para omitir los diffs en los correos de notificación.
   1.219 +\item[\rcitem{notify}{sources}] Una lista de fuentes de conjuntos de
   1.220 +  cambios a considerar. Esto le permite a usted indicar a
   1.221 +  \hgext{notify} para que sólo envíe correos acerca de cambios que
   1.222 +  usuarios remotos hayan empujado al repositorio vía un servidor, por
   1.223 +  ejemplo.  Vea la sección~\ref{sec:hook:sources} para las fuentes que
   1.224 +  usted puede especificar aquí.
   1.225 +\end{itemize}
   1.226 +
   1.227 +Si usted fija el ítem \rcitem{web}{baseurl} en la sección
   1.228 +\rcsection{web}, usted lo puede usar en una plantilla; estará
   1.229 +disponible como \texttt{webroot}.
   1.230 +
   1.231 +A continuación se presenta un ejemplo completo de configuración para
   1.232 +el gancho \hgext{notify}.
   1.233  \begin{codesample2}
   1.234    [notify]
   1.235 -  # really send email
   1.236 +  # enviar correo
   1.237    test = false
   1.238 -  # subscriber data lives in the notify repo
   1.239 +  # datos de subscriptores están en el repositorio notify
   1.240    config = /home/hg/repos/notify/notify.conf
   1.241 -  # repos live in /home/hg/repos on server, so strip 4 "/" chars
   1.242 +  # repos están en /home/hg/repos on server, así que elimine 4
   1.243 +  # caracteres"/"
   1.244    strip = 4
   1.245    template = X-Hg-Repo: \{webroot\}
   1.246      Subject: \{webroot\}: \{desc|firstline|strip\}
   1.247 @@ -1027,7 +1039,7 @@
   1.248    baseurl = http://hg.example.com/
   1.249  \end{codesample2}
   1.250  
   1.251 -This will produce a message that looks like the following:
   1.252 +Esto producirá un mensaje que se verá como el siguiente:
   1.253  \begin{codesample2}
   1.254    X-Hg-Repo: tests/slave
   1.255    Subject: tests/slave: Handle error case when slave has no buffers