hgbook
diff es/undo.tex @ 374:c2ff82128ac5
Started translating undo.tex , added mistake and rollback
author | Igor TAmara <igor@tamarapatino.org> |
---|---|
date | Mon Oct 27 13:32:16 2008 -0500 (2008-10-27) |
parents | 2fb78d342e07 |
children | d5f1049a79dd |
line diff
1.1 --- a/es/undo.tex Sun Oct 19 19:56:21 2008 -0500 1.2 +++ b/es/undo.tex Mon Oct 27 13:32:16 2008 -0500 1.3 @@ -1,79 +1,80 @@ 1.4 -\chapter{Finding and fixing your mistakes} 1.5 +\chapter{Encontrar y arreglar sus equivocaciones} 1.6 \label{chap:undo} 1.7 1.8 -To err might be human, but to really handle the consequences well 1.9 -takes a top-notch revision control system. In this chapter, we'll 1.10 -discuss some of the techniques you can use when you find that a 1.11 -problem has crept into your project. Mercurial has some highly 1.12 -capable features that will help you to isolate the sources of 1.13 -problems, and to handle them appropriately. 1.14 - 1.15 -\section{Erasing local history} 1.16 - 1.17 -\subsection{The accidental commit} 1.18 - 1.19 -I have the occasional but persistent problem of typing rather more 1.20 -quickly than I can think, which sometimes results in me committing a 1.21 -changeset that is either incomplete or plain wrong. In my case, the 1.22 -usual kind of incomplete changeset is one in which I've created a new 1.23 -source file, but forgotten to \hgcmd{add} it. A ``plain wrong'' 1.24 -changeset is not as common, but no less annoying. 1.25 - 1.26 -\subsection{Rolling back a transaction} 1.27 +Errar es humano, pero tratar adecuadamente las consecuencias requiere 1.28 +un sistema de control de revisiones de primera categoría. En este 1.29 +capítulo, discutiremos algunas técnicas que puede usar cuando 1.30 +encuentra que hay un problema enraizado en su proyecto. Mercurial 1.31 +tiene unas características poderosas que le ayudarán a isolar las 1.32 +fuentes de los problemas, y a dar cuenta de ellas apropiadamente. 1.33 + 1.34 +\section{Borrar la historia local} 1.35 + 1.36 +\subsection{La consignación accidental} 1.37 + 1.38 +Tengo el problema ocasional, pero persistente de teclear más rápido de 1.39 +lo que pienso, que aveces resulta en consignar un conjunto de cambios 1.40 +incompleto o simplemente malo. En mi caso, el conjunto de cambios 1.41 +incompleto consiste en que creé un nuevo archivo fuente, pero olvidé 1.42 +hacerle \hgcmd{add}. Un conjunto de cambios``simplemente malo'' no es 1.43 +tan común, pero sí resulta muy molesto. 1.44 + 1.45 +\subsection{Retroceder una transacción} 1.46 \label{sec:undo:rollback} 1.47 1.48 -In section~\ref{sec:concepts:txn}, I mentioned that Mercurial treats 1.49 -each modification of a repository as a \emph{transaction}. Every time 1.50 -you commit a changeset or pull changes from another repository, 1.51 -Mercurial remembers what you did. You can undo, or \emph{roll back}, 1.52 -exactly one of these actions using the \hgcmd{rollback} command. (See 1.53 -section~\ref{sec:undo:rollback-after-push} for an important caveat 1.54 -about the use of this command.) 1.55 - 1.56 -Here's a mistake that I often find myself making: committing a change 1.57 -in which I've created a new file, but forgotten to \hgcmd{add} it. 1.58 +En la sección~\ref{sec:concepts:txn}, mencioné que Mercurial trata 1.59 +modificación a un repositorio como una \emph{transacción}. Cada vez 1.60 +que consigna un conjunto de cambios o lo jala de otro repositorio, 1.61 +Mercurial recuerda lo que hizo. Puede deshacer, o \emph{retroceder}, 1.62 +exactamente una de tales acciones usando la orden \hgcmd{rollback}. 1.63 +(Ver en la sección~\ref{sec:undo:rollback-after-push} una anotación 1.64 +importante acerca del uso de esta orden.) 1.65 + 1.66 +A continuación una equivocación que me sucede frecuentemente: 1.67 +consignar un cambio en el cual he creado un nuevo fichero, pero he 1.68 +olvidado hacerle \hgcmd{add}. 1.69 \interaction{rollback.commit} 1.70 -Looking at the output of \hgcmd{status} after the commit immediately 1.71 -confirms the error. 1.72 +La salida de \hgcmd{status} después de la consignación confirma 1.73 +inmediatamente este error. 1.74 \interaction{rollback.status} 1.75 -The commit captured the changes to the file \filename{a}, but not the 1.76 -new file \filename{b}. If I were to push this changeset to a 1.77 -repository that I shared with a colleague, the chances are high that 1.78 -something in \filename{a} would refer to \filename{b}, which would not 1.79 -be present in their repository when they pulled my changes. I would 1.80 -thus become the object of some indignation. 1.81 - 1.82 -However, luck is with me---I've caught my error before I pushed the 1.83 -changeset. I use the \hgcmd{rollback} command, and Mercurial makes 1.84 -that last changeset vanish. 1.85 +La consignación capturó los cambios en el archivo \filename{a}, pero 1.86 +no el nuevo fichero \filename{b}. Si yo publicara este conjunto de 1.87 +cambios a un repositorio compartido con un colega, es bastante 1.88 +probable que algo en \filename{a} se refiriera a \filename{b}, el cual 1.89 +podría no estar presente cuando jalen mis cambios del repositorio. Me 1.90 +convertiría el sujeto de cierta indignación. 1.91 + 1.92 +Como sea, la suerte me acompaña---Encontré mi error antes de publicar 1.93 +el conjunto de cambios. Uso la orden \hgcmd{rollback}, y Mercurial 1.94 +hace desaparecer el último conjunto de cambios. 1.95 \interaction{rollback.rollback} 1.96 -Notice that the changeset is no longer present in the repository's 1.97 -history, and the working directory once again thinks that the file 1.98 -\filename{a} is modified. The commit and rollback have left the 1.99 -working directory exactly as it was prior to the commit; the changeset 1.100 -has been completely erased. I can now safely \hgcmd{add} the file 1.101 -\filename{b}, and rerun my commit. 1.102 +El conjunto de cambios ya no está en la historia del repositorio, y el 1.103 +directorio de trabajo cree que el fichero \filename{a} ha sido 1.104 +modificado. La consignación y el retroceso dejaron el directorio de 1.105 +trabajo exactamente como estaban antes de la consignación; el conjunto 1.106 +de cambios ha sido eliminado totlamente. Ahora puedo hacer \hgcmd{add} 1.107 +al fichero \filename{b}, y hacer de nuevo la consignación. 1.108 \interaction{rollback.add} 1.109 1.110 -\subsection{The erroneous pull} 1.111 - 1.112 -It's common practice with Mercurial to maintain separate development 1.113 -branches of a project in different repositories. Your development 1.114 -team might have one shared repository for your project's ``0.9'' 1.115 -release, and another, containing different changes, for the ``1.0'' 1.116 -release. 1.117 - 1.118 -Given this, you can imagine that the consequences could be messy if 1.119 -you had a local ``0.9'' repository, and accidentally pulled changes 1.120 -from the shared ``1.0'' repository into it. At worst, you could be 1.121 -paying insufficient attention, and push those changes into the shared 1.122 -``0.9'' tree, confusing your entire team (but don't worry, we'll 1.123 -return to this horror scenario later). However, it's more likely that 1.124 -you'll notice immediately, because Mercurial will display the URL it's 1.125 -pulling from, or you will see it pull a suspiciously large number of 1.126 -changes into the repository. 1.127 - 1.128 -The \hgcmd{rollback} command will work nicely to expunge all of the 1.129 +\subsection{Erroneamente jalado} 1.130 + 1.131 +Mantener ramas de desarrollo separadas de un proyecto en distintos 1.132 +repositorios es una práctica común con Mercurial. Su equipo de 1.133 +desarrollo puede tener un repositorio compartido para la versión ``0.9'' 1.134 +y otra con cambios distintos para la versión ``1.0''. 1.135 + 1.136 +Con este escenario, puede imaginar las consecuencias si tuviera un 1.137 +repositorio local ``0.9'', y jalara accidentalmente los cambios del 1.138 +repositorio compartido de la versión ``1.0'' en este. En el peor de 1.139 +los casos, por falta de atención, es posible que publique tales 1.140 +cambios en el árbol compartido ``0.9'', confundiendo a todo su equipo 1.141 +de trabajo(pero no se preocupe, volveremos a este terrorífico 1.142 +escenario posteriormente). En todo caso, es muy probable que usted se 1.143 +de cuenta inmediatamente, dado que Mercurial mostrará el URL de donde 1.144 +está jalando, o que vea jalando una sospechosa gran cantidad de 1.145 +cambios en el repositorio. 1.146 + 1.147 +La orden \hgcmd{rollback} command will work nicely to expunge all of the 1.148 changesets that you just pulled. Mercurial groups all changes from 1.149 one \hgcmd{pull} into a single transaction, so one \hgcmd{rollback} is 1.150 all you need to undo this mistake.