hgbook

changeset 388:9fdb45b994d4

Finished backing out section
author Igor TAmara <igor@tamarapatino.org>
date Sun Nov 02 21:00:40 2008 -0500 (2008-11-02)
parents 7864f2264e28
children b7d4d66c3ae5
files es/Leame.1st es/undo.tex
line diff
     1.1 --- a/es/Leame.1st	Sun Nov 02 19:24:30 2008 -0500
     1.2 +++ b/es/Leame.1st	Sun Nov 02 21:00:40 2008 -0500
     1.3 @@ -99,7 +99,7 @@
     1.4  || preface.tex     || Javier Rojas  ||    100%    || 18/10/2008 ||  19/10/2008 ||
     1.5  || daily.tex       || Igor Támara   ||    100%    || 19/10/2008 ||  26/10/2008 ||
     1.6  || tour-basic.tex  || Javier Rojas  ||    100%    || 19/10/2008 ||  27/10/2008 ||
     1.7 -|| undo.tex        || Igor Támara   ||     39%    || 26/10/2008 ||             ||
     1.8 +|| undo.tex        || Igor Támara   ||     52%    || 26/10/2008 ||             ||
     1.9  || tour-merge.tex  || Javier Rojas  ||     10%    || 28/10/2008 ||             ||
    1.10  
    1.11  == Archivos en proceso de revisión ==
    1.12 @@ -156,6 +156,7 @@
    1.13   Roll back: NO se traduce Ver más abajo
    1.14   Snapshot: instantánea
    1.15   Tip: punta
    1.16 + Update: actualización
    1.17  
    1.18  abort -> cancelar
    1.19  
     2.1 --- a/es/undo.tex	Sun Nov 02 19:24:30 2008 -0500
     2.2 +++ b/es/undo.tex	Sun Nov 02 21:00:40 2008 -0500
     2.3 @@ -246,7 +246,7 @@
     2.4  retrocediendo. En este ejemplo, colocamos un mensaje en la
     2.5  consignación usando la opción \hgopt{backout}{-m} .
     2.6  
     2.7 -\subsection{Retroceder el conjunto de cambios tip}
     2.8 +\subsection{Retroceder el conjunto de cambios punta}
     2.9  
    2.10  Comenzamos retrocediendo el último conjunto de cambios que consignamos.
    2.11  \interaction{backout.simple}
    2.12 @@ -267,7 +267,7 @@
    2.13    \label{fig:undo:backout}
    2.14  \end{figure}
    2.15  
    2.16 -\subsection{Retroceso de un cambio que no es tip}
    2.17 +\subsection{Retroceso de un cambio que no es la punta}
    2.18  
    2.19  Si desea retrocede un cambio distinto al último que ha consignado, use
    2.20  la opción \hgopt{backout}{--merge} a la orden \hgcmd{backout}.
    2.21 @@ -296,7 +296,7 @@
    2.22  \begin{figure}[htb]
    2.23    \centering
    2.24    \grafix{undo-non-tip}
    2.25 -  \caption{Retroceso automatizado de un cambio a algo que no es tip con la orden \hgcmd{backout}}
    2.26 +  \caption{Retroceso automatizado de un cambio a algo que no es la punta con la orden \hgcmd{backout}}
    2.27    \label{fig:undo:backout-non-tip}
    2.28  \end{figure}
    2.29  
    2.30 @@ -304,119 +304,122 @@
    2.31  poco de historia adicional que deshace el efecto de un conjunto de
    2.32  cambios que usted quería evitar.
    2.33  
    2.34 -\subsubsection{Always use the \hgopt{backout}{--merge} option}
    2.35 -
    2.36 -In fact, since the \hgopt{backout}{--merge} option will do the ``right
    2.37 -thing'' whether or not the changeset you're backing out is the tip
    2.38 -(i.e.~it won't try to merge if it's backing out the tip, since there's
    2.39 -no need), you should \emph{always} use this option when you run the
    2.40 -\hgcmd{backout} command.
    2.41 -
    2.42 -\subsection{Gaining more control of the backout process}
    2.43 -
    2.44 -While I've recommended that you always use the
    2.45 -\hgopt{backout}{--merge} option when backing out a change, the
    2.46 -\hgcmd{backout} command lets you decide how to merge a backout
    2.47 -changeset.  Taking control of the backout process by hand is something
    2.48 -you will rarely need to do, but it can be useful to understand what
    2.49 -the \hgcmd{backout} command is doing for you automatically.  To
    2.50 -illustrate this, let's clone our first repository, but omit the
    2.51 -backout change that it contains.
    2.52 +\subsubsection{Use siempre la opción \hgopt{backout}{--merge}}
    2.53 +
    2.54 +De hecho, dado que la opción \hgopt{backout}{--merge} siempre hara lo
    2.55 +``correcto'' esté o no retrocediendo el conjunto de cambios punta
    2.56 +(p.e.~no tratará de fusionar si está retrocediendo la punta, dado que
    2.57 +no es necesario), usted debería usar \emph{siempre} esta opción cuando
    2.58 +ejecuta la orden \hgcmd{backout}.
    2.59 +
    2.60 +\subsection{Más control sobre el proceso de retroceso}
    2.61 +
    2.62 +A pesar de que recomiendo usar siempre la opción 
    2.63 +\hgopt{backout}{--merge} cuando está retrocediendo un cambio, la orden
    2.64 +\hgcmd{backout} le permite decidir cómo mezclar un retroceso de un
    2.65 +conjunto de cambios.  Es muy extraño que usted necestite tomar control
    2.66 +del proceso de retroceso de forma manual, pero puede ser útil entender
    2.67 +lo que la orden \hgcmd{backout} está haciendo automáticamente para
    2.68 +usted. Para ilustrarlo, clonemos nuestro primer repositorio, pero
    2.69 +omitamos el retroceso que contiene.
    2.70  
    2.71  \interaction{backout.manual.clone}
    2.72 -As with our earlier example, We'll commit a third changeset, then back
    2.73 -out its parent, and see what happens.
    2.74 +Como en el ejemplo anterior, consignaremos un tercer cambio, después
    2.75 +haremos retroceso de su padre, y veremos qué pasa.
    2.76  \interaction{backout.manual.backout} 
    2.77 -Our new changeset is again a descendant of the changeset we backout
    2.78 -out; it's thus a new head, \emph{not} a descendant of the changeset
    2.79 -that was the tip.  The \hgcmd{backout} command was quite explicit in
    2.80 -telling us this.
    2.81 +Nuestro nuevo conjunto de cambios es de nuevo un descendiente del
    2.82 +conjunto de cambio que retrocedimos; es por lo tanto una nueva cabeza,
    2.83 +\emph{no} un descendiente del conjunto de cambios que era la punta. La
    2.84 +orden \hgcmd{backout} fue muy explícita diciéndolo.
    2.85  \interaction{backout.manual.log}
    2.86  
    2.87 -Again, it's easier to see what has happened by looking at a graph of
    2.88 -the revision history, in figure~\ref{fig:undo:backout-manual}.  This
    2.89 -makes it clear that when we use \hgcmd{backout} to back out a change
    2.90 -other than the tip, Mercurial adds a new head to the repository (the
    2.91 -change it committed is box-shaped).
    2.92 +De nuevo, es más sencillo lo que pasó viendo una gráfica de la
    2.93 +historia de revisiones, en la figura~\ref{fig:undo:backout-manual}.
    2.94 +Esto nos aclara que cuando usamos \hgcmd{backout} para retroceder un
    2.95 +cambio a algo que no sea la punta, Mercurial añade una nueva cabeza al
    2.96 +repositorio (el cambio que consignó está encerrado en una caja).
    2.97  
    2.98  \begin{figure}[htb]
    2.99    \centering
   2.100    \grafix{undo-manual}
   2.101 -  \caption{Backing out a change using the \hgcmd{backout} command}
   2.102 +  \caption{Retroceso usando la orden \hgcmd{backout}}
   2.103    \label{fig:undo:backout-manual}
   2.104  \end{figure}
   2.105  
   2.106 -After the \hgcmd{backout} command has completed, it leaves the new
   2.107 -``backout'' changeset as the parent of the working directory.
   2.108 +Después de que la orden \hgcmd{backout} ha terminado, deja un nuevo
   2.109 +conjunto de cambios de ``retroceso'' como el padre del directorio de trabajo.
   2.110  \interaction{backout.manual.parents}
   2.111 -Now we have two isolated sets of changes.
   2.112 +Ahora tenemos dos conjuntos de cambios aislados.
   2.113  \interaction{backout.manual.heads}
   2.114  
   2.115 -Let's think about what we expect to see as the contents of
   2.116 -\filename{myfile} now.  The first change should be present, because
   2.117 -we've never backed it out.  The second change should be missing, as
   2.118 -that's the change we backed out.  Since the history graph shows the
   2.119 -third change as a separate head, we \emph{don't} expect to see the
   2.120 -third change present in \filename{myfile}.
   2.121 +Reflexionemos acerca de lo que esperamos ver como contenidos de
   2.122 +\filename{myfile}.  El primer cambio debería estar presente, porque
   2.123 +nunca le hicimos retroceso.  El segundo cambio debió desaparecer,
   2.124 +puesto que es el que retrocedimos.  Dado que la gráfica de la historia
   2.125 +muestra que el tercer camlio es una cabeza separada, \emph{no}
   2.126 +esperamos ver el tercer cambio presente en \filename{myfile}.
   2.127  \interaction{backout.manual.cat}
   2.128 -To get the third change back into the file, we just do a normal merge
   2.129 -of our two heads.
   2.130 +Para que el tercer cambio esté en el archivo, hacemos una fusión usual
   2.131 +de las dos cabezas.
   2.132  \interaction{backout.manual.merge}
   2.133 -Afterwards, the graphical history of our repository looks like
   2.134 -figure~\ref{fig:undo:backout-manual-merge}.
   2.135 +Después de eso, la historia gráfica de nuestro repositorio luce como
   2.136 +la figura~\ref{fig:undo:backout-manual-merge}.
   2.137  
   2.138  \begin{figure}[htb]
   2.139    \centering
   2.140    \grafix{undo-manual-merge}
   2.141 -  \caption{Manually merging a backout change}
   2.142 +  \caption{Fusión manual de un retroceso}
   2.143    \label{fig:undo:backout-manual-merge}
   2.144  \end{figure}
   2.145  
   2.146 -\subsection{Why \hgcmd{backout} works as it does}
   2.147 -
   2.148 -Here's a brief description of how the \hgcmd{backout} command works.
   2.149 +\subsection{Por qué \hgcmd{backout} hace lo que hace}
   2.150 +
   2.151 +Esta es una descripción corta de cómo trabaja la orden \hgcmd{backout}.
   2.152  \begin{enumerate}
   2.153 -\item It ensures that the working directory is ``clean'', i.e.~that
   2.154 -  the output of \hgcmd{status} would be empty.
   2.155 -\item It remembers the current parent of the working directory.  Let's
   2.156 -  call this changeset \texttt{orig}
   2.157 -\item It does the equivalent of a \hgcmd{update} to sync the working
   2.158 -  directory to the changeset you want to back out.  Let's call this
   2.159 -  changeset \texttt{backout}
   2.160 -\item It finds the parent of that changeset.  Let's call that
   2.161 -  changeset \texttt{parent}.
   2.162 -\item For each file that the \texttt{backout} changeset affected, it
   2.163 -  does the equivalent of a \hgcmdargs{revert}{-r parent} on that file,
   2.164 -  to restore it to the contents it had before that changeset was
   2.165 -  committed.
   2.166 -\item It commits the result as a new changeset.  This changeset has
   2.167 -  \texttt{backout} as its parent.
   2.168 -\item If you specify \hgopt{backout}{--merge} on the command line, it
   2.169 -  merges with \texttt{orig}, and commits the result of the merge.
   2.170 +\item Se asegura de que el directorio de trabajo es ``limpio'', esto
   2.171 +  es, que la salida de \hgcmd{status} debería ser vacía.
   2.172 +\item Recuerda el padre actual del directorio de trabajo. A este
   2.173 +  conjunto de cambio lo llamaremos \texttt{orig}
   2.174 +\item Hace el equivalente de un \hgcmd{update} para sincronizar el
   2.175 +  directorio de trabajo con el conjunto de cambios que usted quiere
   2.176 +  retroceder. Lo llamaremos \texttt{backout}
   2.177 +\item Encuentra el padre del conjunto de cambios. Lo llamaremos
   2.178 +  \texttt{parent}.
   2.179 +\item Para cada archivo del conjunto de cambios que el
   2.180 +  \texttt{retroceso} afecte, hará el equivalente a
   2.181 +  \hgcmdargs{revert}{-r parent} sobre ese fichero, para restaurarlo a
   2.182 +  los contenidos que tenía antes de que el conjunto de cambios fuera
   2.183 +  consignado.
   2.184 +\item Se consigna el resultado como un nuevo conjunto de cambios y
   2.185 +  tiene a  \texttt{backout} como su padre.
   2.186 +\item Si especifica \hgopt{backout}{--merge} en la línea de comandos,
   2.187 +  se fusiona con \texttt{orig}, y se consigna el resultado de la
   2.188 +  fusión.
   2.189  \end{enumerate}
   2.190  
   2.191 -An alternative way to implement the \hgcmd{backout} command would be
   2.192 -to \hgcmd{export} the to-be-backed-out changeset as a diff, then use
   2.193 -the \cmdopt{patch}{--reverse} option to the \command{patch} command to
   2.194 -reverse the effect of the change without fiddling with the working
   2.195 -directory.  This sounds much simpler, but it would not work nearly as
   2.196 -well.
   2.197 -
   2.198 -The reason that \hgcmd{backout} does an update, a commit, a merge, and
   2.199 -another commit is to give the merge machinery the best chance to do a
   2.200 -good job when dealing with all the changes \emph{between} the change
   2.201 -you're backing out and the current tip.  
   2.202 -
   2.203 -If you're backing out a changeset that's~100 revisions back in your
   2.204 -project's history, the chances that the \command{patch} command will
   2.205 -be able to apply a reverse diff cleanly are not good, because
   2.206 -intervening changes are likely to have ``broken the context'' that
   2.207 -\command{patch} uses to determine whether it can apply a patch (if
   2.208 -this sounds like gibberish, see \ref{sec:mq:patch} for a
   2.209 -discussion of the \command{patch} command).  Also, Mercurial's merge
   2.210 -machinery will handle files and directories being renamed, permission
   2.211 -changes, and modifications to binary files, none of which
   2.212 -\command{patch} can deal with.
   2.213 +Una vía alternativa de implementar la orden \hgcmd{backout} sería usar
   2.214 +\hgcmd{export} sobre el conjunto de cambios a retroceder como un diff
   2.215 +y después usar laa opción \cmdopt{patch}{--reverse} de la orden
   2.216 +\command{patch} para reversar el efecto del cambio sin molestar el
   2.217 +directorio de trabajo.  Suena mucho más simple, pero no funcionaría
   2.218 +bien ni de cerca.
   2.219 +
   2.220 +La razón por la cual \hgcmd{backout} hace una actualización, una
   2.221 +consignación, una fusión y otra consignación es para dar a la
   2.222 +maquinaria de fusión la mayor oportunidad de hacer un buen trabajo
   2.223 +cuando se trata con todos los cambios \emph{entre} el cambio que está
   2.224 +retrocediendo y la punta actual.
   2.225 +
   2.226 +Si está retrocediendo un conjunto de cambios que está a unas ~100
   2.227 +atrás en su historia del proyecto, las posibilidades de que una orden
   2.228 +\command{patch} sea capaz de ser aplicada a un diff reverso,
   2.229 +claramente no son altas, porque los cambios que intervienen podrían
   2.230 +``no coincidir con el contexto'' que \command{patch} usa  para
   2.231 +determinar si puede aplicar un parche (si esto suena como cháchara,
   2.232 +vea una discusión de la orden \command{patch} en \ref{sec:mq:patch}).
   2.233 +Adicionalmente, la maquinaria de fusión de Mercurial manejará ficheros
   2.234 +y directorios renombrados, cambios de permisos, y modificaciones a
   2.235 +archivos binarios, nada de lo cual la orden \command{patch} puede manejar.
   2.236  
   2.237  \section{Changes that should never have been}
   2.238  \label{sec:undo:aaaiiieee}