comparison es/undo.tex @ 486:7864f2264e28

translated some paragraphs of undo.tex
author Igor TAmara <igor@tamarapatino.org>
date Sun, 02 Nov 2008 19:24:30 -0500
parents d2467817c934
children 9fdb45b994d4
comparison
equal deleted inserted replaced
485:d2467817c934 486:7864f2264e28
206 Mercurial restaure el fichero que fue eliminado como parte del 206 Mercurial restaure el fichero que fue eliminado como parte del
207 renombramiento, no será modificado. 207 renombramiento, no será modificado.
208 Si necesita que las modificaciones en el archivo destino del 208 Si necesita que las modificaciones en el archivo destino del
209 renombramiento se muestren, no olvide copiarlas encima.) 209 renombramiento se muestren, no olvide copiarlas encima.)
210 210
211 Estos aspectos engorrosos de revertir el renombramiento se constituyen 211 Estos aspectos engorrosos al revertir un renombramiento se constituyen
212 discutiblemente en un fallo de Mercurial. 212 discutiblemente en un fallo de Mercurial.
213 213
214 \section{Dealing with committed changes} 214 \section{Tratar cambios consignados}
215 215
216 Consider a case where you have committed a change $a$, and another 216 Considere un caso en el que ha consignado el cambio $a$, y otro cambio
217 change $b$ on top of it; you then realise that change $a$ was 217 $b$ sobre este; se ha dado cuenta que el cambio $a$ era
218 incorrect. Mercurial lets you ``back out'' an entire changeset 218 incorrecto. Mercurial le permite ``retroceder'' un conjunto de cambios
219 automatically, and building blocks that let you reverse part of a 219 completo automáticamente, y construir bloques que le permitan revertir
220 changeset by hand. 220 parte de un conjunto de cambios a mano.
221 221
222 Before you read this section, here's something to keep in mind: the 222 Antes de leer esta sección, hay algo para tener en cuenta: la orden
223 \hgcmd{backout} command undoes changes by \emph{adding} history, not 223 \hgcmd{backout} deshace cambios \emph{adicionando} a la historia, sin
224 by modifying or erasing it. It's the right tool to use if you're 224 modificar o borrar. Es la herramienta correcta si está arreglando
225 fixing bugs, but not if you're trying to undo some change that has 225 fallos, pero no si está tratando de deshacer algún cambio que tiene
226 catastrophic consequences. To deal with those, see 226 consecuencias catastróficas. Para tratar con esos, vea la sección~\ref{sec:undo:aaaiiieee}.
227 section~\ref{sec:undo:aaaiiieee}. 227
228 228 \subsection{Retroceder un conjunto de cambios}
229 \subsection{Backing out a changeset} 229
230 230 La orden \hgcmd{backout} le permite ``deshacer'' los efectos de todo
231 The \hgcmd{backout} command lets you ``undo'' the effects of an entire 231 un conjunto de cambios de forma automatizada. Dado que la historia de
232 changeset in an automated fashion. Because Mercurial's history is 232 Mercurial es inmutable, esta orden \emph{no} se deshace del conjunto
233 immutable, this command \emph{does not} get rid of the changeset you 233 de cambios que usted desea deshacer. En cambio, crea un nuevo
234 want to undo. Instead, it creates a new changeset that 234 conjunto de cambios que \emph{reversa} el conjunto de cambios que
235 \emph{reverses} the effect of the to-be-undone changeset. 235 usted indique.
236 236
237 The operation of the \hgcmd{backout} command is a little intricate, so 237 La operación de la orden \hgcmd{backout} es un poco intrincada, y lo
238 let's illustrate it with some examples. First, we'll create a 238 ilustraremos con algunos ejemplos. Primero crearemos un repositorio
239 repository with some simple changes. 239 con algunos cambios sencillos.
240 \interaction{backout.init} 240 \interaction{backout.init}
241 241
242 The \hgcmd{backout} command takes a single changeset ID as its 242 La orden \hgcmd{backout} toma un ID de conjunto de cambios como su
243 argument; this is the changeset to back out. Normally, 243 argumento; el conjunto de cambios a retroceder. Normalmente
244 \hgcmd{backout} will drop you into a text editor to write a commit 244 \hgcmd{backout} le ofrecerá un editor de texto para escribir el
245 message, so you can record why you're backing the change out. In this 245 mensaje de la consignación, para dejar un registro de por qué está
246 example, we provide a commit message on the command line using the 246 retrocediendo. En este ejemplo, colocamos un mensaje en la
247 \hgopt{backout}{-m} option. 247 consignación usando la opción \hgopt{backout}{-m} .
248 248
249 \subsection{Backing out the tip changeset} 249 \subsection{Retroceder el conjunto de cambios tip}
250 250
251 We're going to start by backing out the last changeset we committed. 251 Comenzamos retrocediendo el último conjunto de cambios que consignamos.
252 \interaction{backout.simple} 252 \interaction{backout.simple}
253 You can see that the second line from \filename{myfile} is no longer 253 Puede ver que la segunda línea de \filename{myfile} ya no está
254 present. Taking a look at the output of \hgcmd{log} gives us an idea 254 presente. La salida de \hgcmd{log} nos da una idea de lo que la orden
255 of what the \hgcmd{backout} command has done. 255 \hgcmd{backout} ha hecho.
256 \interaction{backout.simple.log} 256 \interaction{backout.simple.log}
257 Notice that the new changeset that \hgcmd{backout} has created is a 257 Vea que el nuevo conjunto de cambios que \hgcmd{backout} ha creado es
258 child of the changeset we backed out. It's easier to see this in 258 un hijo del conjunto de cambios que retrocedimos. Es más sencillo de
259 figure~\ref{fig:undo:backout}, which presents a graphical view of the 259 ver en la figura~\ref{fig:undo:backout}, que presenta una vista
260 change history. As you can see, the history is nice and linear. 260 gráfica de la historia de cambios. Como puede ver, la historia es
261 bonita y lineal.
261 262
262 \begin{figure}[htb] 263 \begin{figure}[htb]
263 \centering 264 \centering
264 \grafix{undo-simple} 265 \grafix{undo-simple}
265 \caption{Backing out a change using the \hgcmd{backout} command} 266 \caption{Retroceso de un cambio con la orden \hgcmd{backout}}
266 \label{fig:undo:backout} 267 \label{fig:undo:backout}
267 \end{figure} 268 \end{figure}
268 269
269 \subsection{Backing out a non-tip change} 270 \subsection{Retroceso de un cambio que no es tip}
270 271
271 If you want to back out a change other than the last one you 272 Si desea retrocede un cambio distinto al último que ha consignado, use
272 committed, pass the \hgopt{backout}{--merge} option to the 273 la opción \hgopt{backout}{--merge} a la orden \hgcmd{backout}.
273 \hgcmd{backout} command.
274 \interaction{backout.non-tip.clone} 274 \interaction{backout.non-tip.clone}
275 This makes backing out any changeset a ``one-shot'' operation that's 275 Que resulta en un retroceso de un conjunto de cambios ``en un sólo
276 usually simple and fast. 276 tiro'', una operación que resulta normalmente rápida y sencilla.
277 \interaction{backout.non-tip.backout} 277 \interaction{backout.non-tip.backout}
278 278
279 If you take a look at the contents of \filename{myfile} after the 279 Si ve los contenidos del fichero \filename{myfile} después de
280 backout finishes, you'll see that the first and third changes are 280 finalizar el retroceso, verá que el primer y el tercer cambio están
281 present, but not the second. 281 presentes, pero no el segundo.
282 \interaction{backout.non-tip.cat} 282 \interaction{backout.non-tip.cat}
283 283
284 As the graphical history in figure~\ref{fig:undo:backout-non-tip} 284 Como lo muestra la historia gráfica en la
285 illustrates, Mercurial actually commits \emph{two} changes in this 285 figura~\ref{fig:undo:backout-non-tip}, Mercurial realmente consigna
286 kind of situation (the box-shaped nodes are the ones that Mercurial 286 \emph{dos} cambios en estas situaciones (los nodos encerrados en una
287 commits automatically). Before Mercurial begins the backout process, 287 caja son aquellos que Mercurial consigna automaticamente). Antes de
288 it first remembers what the current parent of the working directory 288 que Mercurial comience el proceso de retroceso, primero recuerda cuál
289 is. It then backs out the target changeset, and commits that as a 289 es el padre del directorio de trabajo. Posteriormente hace un
290 changeset. Finally, it merges back to the previous parent of the 290 retroceso al conjunto de cambios objetivo y lo consigna como un
291 working directory, and commits the result of the merge. 291 conjunto de cambios. Finalmente, fusiona con el padre anterior del
292 directorio de trabajo, y consigna el resultado de la fusión.
292 293
293 % TODO: to me it looks like mercurial doesn't commit the second merge automatically! 294 % TODO: to me it looks like mercurial doesn't commit the second merge automatically!
294 295
295 \begin{figure}[htb] 296 \begin{figure}[htb]
296 \centering 297 \centering
297 \grafix{undo-non-tip} 298 \grafix{undo-non-tip}
298 \caption{Automated backout of a non-tip change using the \hgcmd{backout} command} 299 \caption{Retroceso automatizado de un cambio a algo que no es tip con la orden \hgcmd{backout}}
299 \label{fig:undo:backout-non-tip} 300 \label{fig:undo:backout-non-tip}
300 \end{figure} 301 \end{figure}
301 302
302 The result is that you end up ``back where you were'', only with some 303 El resultado es que usted termina ``donde estaba'', solamente con un
303 extra history that undoes the effect of the changeset you wanted to 304 poco de historia adicional que deshace el efecto de un conjunto de
304 back out. 305 cambios que usted quería evitar.
305 306
306 \subsubsection{Always use the \hgopt{backout}{--merge} option} 307 \subsubsection{Always use the \hgopt{backout}{--merge} option}
307 308
308 In fact, since the \hgopt{backout}{--merge} option will do the ``right 309 In fact, since the \hgopt{backout}{--merge} option will do the ``right
309 thing'' whether or not the changeset you're backing out is the tip 310 thing'' whether or not the changeset you're backing out is the tip