hgbook
changeset 435:263a8436d72d
translated more text. Surprise!
author | jerojasro@localhost |
---|---|
date | Mon Dec 01 21:53:26 2008 -0500 (2008-12-01) |
parents | c847605eb2a9 |
children | 0d6c97362064 |
files | es/Leame.1st es/hook.tex |
line diff
1.1 --- a/es/Leame.1st Mon Dec 01 20:56:29 2008 -0500 1.2 +++ b/es/Leame.1st Mon Dec 01 21:53:26 2008 -0500 1.3 @@ -105,6 +105,7 @@ 1.4 || intro.tex || Igor Támara || 100% || 08/11/2008 || 09/11/2008 || 1.5 || collab.tex || Igor Támara || 65% || 10/11/2008 || || 1.6 || filenames.tex || Javier Rojas || 72% || 27/11/2008 || || 1.7 +|| hook.tex || Javier Rojas || 8% || 01/12/2008 || || 1.8 1.9 == Archivos en proceso de revisión == 1.10 ||'''archivo''' || '''revisor''' ||'''Estado'''||'''Inicio'''|| '''Fin''' ||
2.1 --- a/es/hook.tex Mon Dec 01 20:56:29 2008 -0500 2.2 +++ b/es/hook.tex Mon Dec 01 21:53:26 2008 -0500 2.3 @@ -1,109 +1,124 @@ 2.4 -\chapter{Handling repository events with hooks} 2.5 +\chapter{Manejo de eventos en repositorios con ganchos} 2.6 \label{chap:hook} 2.7 2.8 -Mercurial offers a powerful mechanism to let you perform automated 2.9 -actions in response to events that occur in a repository. In some 2.10 -cases, you can even control Mercurial's response to those events. 2.11 - 2.12 -The name Mercurial uses for one of these actions is a \emph{hook}. 2.13 -Hooks are called ``triggers'' in some revision control systems, but 2.14 -the two names refer to the same idea. 2.15 - 2.16 -\section{An overview of hooks in Mercurial} 2.17 - 2.18 -Here is a brief list of the hooks that Mercurial supports. We will 2.19 -revisit each of these hooks in more detail later, in 2.20 -section~\ref{sec:hook:ref}. 2.21 - 2.22 -\begin{itemize} 2.23 -\item[\small\hook{changegroup}] This is run after a group of 2.24 - changesets has been brought into the repository from elsewhere. 2.25 -\item[\small\hook{commit}] This is run after a new changeset has been 2.26 - created in the local repository. 2.27 -\item[\small\hook{incoming}] This is run once for each new changeset 2.28 - that is brought into the repository from elsewhere. Notice the 2.29 - difference from \hook{changegroup}, which is run once per 2.30 - \emph{group} of changesets brought in. 2.31 -\item[\small\hook{outgoing}] This is run after a group of changesets 2.32 - has been transmitted from this repository. 2.33 -\item[\small\hook{prechangegroup}] This is run before starting to 2.34 - bring a group of changesets into the repository. 2.35 -\item[\small\hook{precommit}] Controlling. This is run before starting 2.36 - a commit. 2.37 -\item[\small\hook{preoutgoing}] Controlling. This is run before 2.38 - starting to transmit a group of changesets from this repository. 2.39 -\item[\small\hook{pretag}] Controlling. This is run before creating a tag. 2.40 -\item[\small\hook{pretxnchangegroup}] Controlling. This is run after a 2.41 - group of changesets has been brought into the local repository from 2.42 - another, but before the transaction completes that will make the 2.43 - changes permanent in the repository. 2.44 -\item[\small\hook{pretxncommit}] Controlling. This is run after a new 2.45 - changeset has been created in the local repository, but before the 2.46 - transaction completes that will make it permanent. 2.47 -\item[\small\hook{preupdate}] Controlling. This is run before starting 2.48 - an update or merge of the working directory. 2.49 -\item[\small\hook{tag}] This is run after a tag is created. 2.50 -\item[\small\hook{update}] This is run after an update or merge of the 2.51 - working directory has finished. 2.52 -\end{itemize} 2.53 -Each of the hooks whose description begins with the word 2.54 -``Controlling'' has the ability to determine whether an activity can 2.55 -proceed. If the hook succeeds, the activity may proceed; if it fails, 2.56 -the activity is either not permitted or undone, depending on the hook. 2.57 - 2.58 -\section{Hooks and security} 2.59 - 2.60 -\subsection{Hooks are run with your privileges} 2.61 - 2.62 -When you run a Mercurial command in a repository, and the command 2.63 -causes a hook to run, that hook runs on \emph{your} system, under 2.64 -\emph{your} user account, with \emph{your} privilege level. Since 2.65 -hooks are arbitrary pieces of executable code, you should treat them 2.66 -with an appropriate level of suspicion. Do not install a hook unless 2.67 -you are confident that you know who created it and what it does. 2.68 - 2.69 -In some cases, you may be exposed to hooks that you did not install 2.70 -yourself. If you work with Mercurial on an unfamiliar system, 2.71 -Mercurial will run hooks defined in that system's global \hgrc\ file. 2.72 - 2.73 -If you are working with a repository owned by another user, Mercurial 2.74 -can run hooks defined in that user's repository, but it will still run 2.75 -them as ``you''. For example, if you \hgcmd{pull} from that 2.76 -repository, and its \sfilename{.hg/hgrc} defines a local 2.77 -\hook{outgoing} hook, that hook will run under your user account, even 2.78 -though you don't own that repository. 2.79 +Mercurial ofrece un poderoso mecanismo para permitirle a usted 2.80 +automatizar la ejecución de acciones en respuesta a eventos que 2.81 +ocurran en un repositorio. En algunos casos, usted puede controlar 2.82 +incluso la respuesta de Mercurial a dichos eventos. 2.83 + 2.84 +Mercurial usa el término \emph{gancho} para identificar estas 2.85 +acciones. Los ganchos son conocidos como ``disparadores'' en algunos 2.86 +sistemas de control de revisiones, pero los dos nombres se refieren al 2.87 +mismo concepto. 2.88 + 2.89 +\section{Vistazo general de ganchos en Mercurial} 2.90 + 2.91 +A continuación se encuentra una breve lista de los ganchos que 2.92 +Mercurial soporta. Volveremos a cada uno de estos ganchos con más 2.93 +detalle después, en la sección~\ref{sec:hook:ref}. 2.94 + 2.95 +\begin{itemize} 2.96 +\item[\small\hook{changegroup}] Es ejecutado luego de que un grupo de 2.97 + conjuntos de cambios ha sido traído al repositorio desde algún 2.98 + otro sitio. 2.99 +\item[\small\hook{commit}] Es ejecutado después de la creación de 2.100 + un conjunto de cambios en el repositorio local. 2.101 +\item[\small\hook{incoming}] Es ejecutado una vez por cada conjunto de 2.102 + cambios traído al repositorio desde otra ubicación. Note la 2.103 + diferencia respecto al gancho \hook{changegroup}, que es ejecutado 2.104 + una vez por cada \emph{grupo} de conjuntos de cambios que se 2.105 + traiga. 2.106 +\item[\small\hook{outgoing}] Es ejecutado luego de que un grupo de 2.107 + conjuntos de cambios ha sido transmitido desde el repositorio. 2.108 +\item[\small\hook{prechangegroup}] Es ejecutado antes de iniciar la 2.109 + recepción de un grupo de conjuntos de cambios en el repositorio. 2.110 +\item[\small\hook{precommit}] De control. Es ejecutado antes de 2.111 + iniciar una consignación. 2.112 +\item[\small\hook{preoutgoing}] De control. Es ejecutado antes de 2.113 + iniciar la transmisión de un grupo de conjuntos de cambios desde 2.114 + el repositorio. 2.115 +\item[\small\hook{pretag}] De control. Es ejecutado antes de crear una 2.116 + etiqueta. 2.117 +\item[\small\hook{pretxnchangegroup}] De control. Es ejecutado después 2.118 + de haber recibido un grupo de conjuntos de cambios en el 2.119 + repositorio local, pero antes de que la transacción se complete y 2.120 + los cambios sean permanentes dentro del repositorio. 2.121 +\item[\small\hook{pretxncommit}] De control. Es ejecutado luego de la 2.122 + creación de un conjunto de cambios en el repositorio local, pero 2.123 + antes de que la transacción que hace permanente el cambio sea 2.124 + completada. 2.125 +\item[\small\hook{preupdate}] De control. Es ejecutado antes de 2.126 + iniciar una actualización o fusión en el directorio de trabajo. 2.127 +\item[\small\hook{tag}] Es ejecutado después de la creación de una 2.128 + etiqueta. 2.129 +\item[\small\hook{update}] Es ejecutado después de que termina una 2.130 + actualización o una fusión. 2.131 +\end{itemize} 2.132 +Cada uno de los ganchos cuya descripción empieza con la frase 2.133 +``de control'' tiene la facultad de determinar si una actividad puede 2.134 +continuar. Si el gancho se ejecuta con éxito, la actividad puede 2.135 +continuar; si falla, o bien la actividad no es permitida, o se 2.136 +deshacen los cambios que se puedan haber llevado a cabo, dependiendo 2.137 +del gancho involucrado. 2.138 + 2.139 +\section{Ganchos y seguridad} 2.140 + 2.141 +\subsection{Los ganchos se ejecutan con sus privilegios de usuario} 2.142 + 2.143 +Cuando usted ejecuta un comando de Mercurial en un repositorio, y el 2.144 +comando causa la ejecución de un gancho, dicho gancho se ejecuta en 2.145 +\emph{su} sistema, en \emph{su} cuenta de usuario, con \emph{sus} 2.146 +privilegios. Ya que los ganchos son elementos arbitrarios de código 2.147 +ejecutable, usted debería tratarlos con un nivel adecuado de 2.148 +desconfianza. No instale un gancho a menos en que confíe en quien lo 2.149 +creó y en lo que el gancho hace. 2.150 + 2.151 +En algunos casos, usted puede estar expuesto a ganchos que usted no 2.152 +%TODO acá introduzco algo de texto por mi cuenta, por claridad 2.153 +instaló. Si usted usa Mercurial en un sistema extraño, tenga en cuenta 2.154 +que Mercurial ejecutará los ganchos definidos en el fichero \hgrc. 2.155 + 2.156 +Si está trabajando con un repositorio propiedad de otro usuario, 2.157 +Mercurial podrá ejecutar los ganchos definidos en el repositorio de 2.158 +dicho usuario, pero los ejecutará como ``usted''. Por ejemplo, si 2.159 +usted jala (\hgcmd{pull}) desde ese repositorio, y el 2.160 +\sfilename{.hg/hgrc} define un gancho saliente (\hook{outgoing}), 2.161 +dicho gancho se ejecuta bajo su cuenta de usuario, aun cuando usted no 2.162 +es el propietario del repositorio. 2.163 2.164 \begin{note} 2.165 - This only applies if you are pulling from a repository on a local or 2.166 - network filesystem. If you're pulling over http or ssh, any 2.167 - \hook{outgoing} hook will run under whatever account is executing 2.168 - the server process, on the server. 2.169 + Esto sólo aplica si usted está jalando desde un repositorio en un 2.170 + sistema de ficheros local o de red. Si está jalando a través de http 2.171 + o ssh, cualquier gancho saliente (\hook{outgoing}) se ejecutará bajo 2.172 + la cuenta que está ejecutando el proceso servidor, en el servidor. 2.173 \end{note} 2.174 2.175 -XXX To see what hooks are defined in a repository, use the 2.176 -\hgcmdargs{config}{hooks} command. If you are working in one 2.177 -repository, but talking to another that you do not own (e.g.~using 2.178 -\hgcmd{pull} or \hgcmd{incoming}), remember that it is the other 2.179 -repository's hooks you should be checking, not your own. 2.180 - 2.181 -\subsection{Hooks do not propagate} 2.182 - 2.183 -In Mercurial, hooks are not revision controlled, and do not propagate 2.184 -when you clone, or pull from, a repository. The reason for this is 2.185 -simple: a hook is a completely arbitrary piece of executable code. It 2.186 -runs under your user identity, with your privilege level, on your 2.187 -machine. 2.188 - 2.189 -It would be extremely reckless for any distributed revision control 2.190 -system to implement revision-controlled hooks, as this would offer an 2.191 -easily exploitable way to subvert the accounts of users of the 2.192 -revision control system. 2.193 - 2.194 -Since Mercurial does not propagate hooks, if you are collaborating 2.195 -with other people on a common project, you should not assume that they 2.196 -are using the same Mercurial hooks as you are, or that theirs are 2.197 -correctly configured. You should document the hooks you expect people 2.198 -to use. 2.199 +XXX Para ver qué ganchos han sido definidos en un repositorio, use el 2.200 +comando \hgcmdargs{config}{hooks}. Si usted está trabajando en un 2.201 +repositorio, pero comunicándose con otro que no le pertenece 2.202 +(por ejemplo, usando \hgcmd{pull} o \hgcmd{incoming}), recuerde que 2.203 +los ganchos que debe considerar son los del otro repositorio, no los 2.204 +del suyo. 2.205 + 2.206 +\subsection{Los ganchos no se propagan} 2.207 + 2.208 +En Mercurial, no se hace control de revisiones de los ganchos, y no se 2.209 +propagan cuando usted clona, o jala de, un repositorio. El motivo para 2.210 +esto es simple: un gancho es código ejecutable arbitrario. Se ejecuta 2.211 +bajo su identidad, con su nivel de privilegios, en su máquina. 2.212 + 2.213 +Sería extremadamente descuidado de parte de cualquier sistema 2.214 +distribuido de control de revisiones el implementar control de 2.215 +revisiones para ganchos, ya que esto ofrecería maneras fácilmente 2.216 +%TODO subvertir 2.217 +aprovechables de subvertir las cuentas de los usuarios del sistema de 2.218 +control de revisiones. 2.219 + 2.220 +Ya que Mercurial no propaga los ganchos, si usted está colaborando con 2.221 +otras personas en un proyecto común, no debería asumir que ellos están 2.222 +usando los mismos ganchos para Mercurial que usted usa, o que los de 2.223 +ellos están configurado correctamente. Usted debería documentar los 2.224 +ganchos que usted espera que la gente use. 2.225 2.226 In a corporate intranet, this is somewhat easier to control, as you 2.227 can for example provide a ``standard'' installation of Mercurial on an