hgbook
changeset 398:c368e324eeb2
Finished translating bisect
author | Igor TAmara <igor@tamarapatino.org> |
---|---|
date | Thu Nov 06 23:06:16 2008 -0500 (2008-11-06) |
parents | b8d9066abcea |
children | 2a1067c24be1 |
files | es/Leame.1st es/undo.tex |
line diff
1.1 --- a/es/Leame.1st Wed Nov 05 23:04:06 2008 -0500 1.2 +++ b/es/Leame.1st Thu Nov 06 23:06:16 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 || 60% || 26/10/2008 || || 1.8 +|| undo.tex || Igor Támara || 71% || 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 @@ -131,6 +131,7 @@ 1.13 1.14 Anne: Ana 1.15 Back out: Retroceder 1.16 + Binary test: Prueba binaria 1.17 Bob : Roberto 1.18 Branch: Rama 1.19 Bug: Fallo 1.20 @@ -149,6 +150,7 @@ 1.21 Mistake: Equivocación, cometida por un humano 1.22 Patch: Parche 1.23 Path: Ruta de archivo 1.24 + Probe: Sondeo 1.25 Pull: Jalar 1.26 Push: Publicar 1.27 Release: Versión o liberación de versión
2.1 --- a/es/undo.tex Wed Nov 05 23:04:06 2008 -0500 2.2 +++ b/es/undo.tex Thu Nov 06 23:06:16 2008 -0500 2.3 @@ -577,109 +577,113 @@ 2.4 repositorio. Puede evitar ramas enteras de historia con un solo 2.5 sondeo. 2.6 2.7 -\subsection{Using the \hgcmd{bisect} command} 2.8 - 2.9 -Here's an example of \hgcmd{bisect} in action. 2.10 +\subsection{Uso de la orden \hgcmd{bisect}} 2.11 + 2.12 +A continuación un ejemplo de \hgcmd{bisect} en acción. 2.13 2.14 \begin{note} 2.15 - In versions 0.9.5 and earlier of Mercurial, \hgcmd{bisect} was not a 2.16 - core command: it was distributed with Mercurial as an extension. 2.17 - This section describes the built-in command, not the old extension. 2.18 + En las versiones 0.9.5 y anteriores de Mercurial, \hgcmd{bisect} no 2.19 + era una orden incluída en la distribución principal: se ofrecía como 2.20 + una extensión de Mercurial. Esta sección describe la orden embebida 2.21 + y no la extensión anterior. 2.22 \end{note} 2.23 2.24 -Now let's create a repository, so that we can try out the 2.25 -\hgcmd{bisect} command in isolation. 2.26 +Creamos un repostorio para probar el comando \hgcmd{bisect} de forma 2.27 +aislada 2.28 \interaction{bisect.init} 2.29 -We'll simulate a project that has a bug in it in a simple-minded way: 2.30 -create trivial changes in a loop, and nominate one specific change 2.31 -that will have the ``bug''. This loop creates 35 changesets, each 2.32 -adding a single file to the repository. We'll represent our ``bug'' 2.33 -with a file that contains the text ``i have a gub''. 2.34 +Simularemos de forma sencilla un proyecto con un fallo: haremos 2.35 +cambios triviales en un ciclo, e indicaremos que un cambio específico 2.36 +sea el ``fallo''. Este ciclo crea 35 conjuntos de cambios, cada uno 2.37 +añade un único archivo al repositorio. Representaremos nuestro ``fallo'' 2.38 +con un fichero que contiene el texto ``tengo un gub''. 2.39 \interaction{bisect.commits} 2.40 2.41 -The next thing that we'd like to do is figure out how to use the 2.42 -\hgcmd{bisect} command. We can use Mercurial's normal built-in help 2.43 -mechanism for this. 2.44 +A continuación observaremos cómo usar la orden \hgcmd{bisect}. Podemos 2.45 +usar el mecanismo de ayuda embebida que trae Mercurial. 2.46 \interaction{bisect.help} 2.47 2.48 -The \hgcmd{bisect} command works in steps. Each step proceeds as follows. 2.49 +La orden \hgcmd{bisect} trabaja en etapas, de la siguiente forma: 2.50 \begin{enumerate} 2.51 -\item You run your binary test. 2.52 +\item Usted ejecuta una prueba binaria. 2.53 \begin{itemize} 2.54 - \item If the test succeeded, you tell \hgcmd{bisect} by running the 2.55 - \hgcmdargs{bisect}{good} command. 2.56 - \item If it failed, run the \hgcmdargs{bisect}{--bad} command. 2.57 + \item Si la prueba es exitosa, usted se lo indicará a \hgcmd{bisect} 2.58 + ejecutando la orden \hgcmdargs{bisect}{good}. 2.59 + \item Si falla, ejecutará la orden \hgcmdargs{bisect}{--bad}. 2.60 \end{itemize} 2.61 -\item The command uses your information to decide which changeset to 2.62 - test next. 2.63 -\item It updates the working directory to that changeset, and the 2.64 - process begins again. 2.65 +\item La orden usa su información para decidir qué conjuntos de 2.66 + cambios deben probarse a continuación. 2.67 +\item Actualiza el directorio de trabajo a tal conjunto de cambios y 2.68 + el proceso se lleva a cabo de nuevo. 2.69 \end{enumerate} 2.70 -The process ends when \hgcmd{bisect} identifies a unique changeset 2.71 -that marks the point where your test transitioned from ``succeeding'' 2.72 -to ``failing''. 2.73 - 2.74 -To start the search, we must run the \hgcmdargs{bisect}{--reset} command. 2.75 +El proceso termina cuando \hgcmd{bisect} identifica un único conjunto 2.76 +de cambios que marca el punto donde se encontró la transición de 2.77 +``exitoso'' a ``fallido''. 2.78 + 2.79 +Para comenzar la búsqueda, es indispensable ejecutar la orden 2.80 +\hgcmdargs{bisect}{--reset}. 2.81 \interaction{bisect.search.init} 2.82 2.83 -In our case, the binary test we use is simple: we check to see if any 2.84 -file in the repository contains the string ``i have a gub''. If it 2.85 -does, this changeset contains the change that ``caused the bug''. By 2.86 -convention, a changeset that has the property we're searching for is 2.87 -``bad'', while one that doesn't is ``good''. 2.88 - 2.89 -Most of the time, the revision to which the working directory is 2.90 -synced (usually the tip) already exhibits the problem introduced by 2.91 -the buggy change, so we'll mark it as ``bad''. 2.92 +En nuestro caso, la prueba binaria es sencilla: revisamos si el 2.93 +archivo en el repositorio contiene la cadena ``tengo un gub''. Si la 2.94 +tiene, este conjunto de cambios contiene aquel que ``causó el fallo''. 2.95 +Por convención, un conjunto de cambios que tiene la propiedad que 2.96 +estamos buscando es ``malo'', mientras que el otro que no la tiene es 2.97 +``bueno''. 2.98 + 2.99 +En la mayoría de casos, la revisión del directorio actual (usualmente 2.100 +la punta) exhibe el problema introducido por el cambio con el fallo, 2.101 +por lo tanto la marcaremos como ``mala''. 2.102 \interaction{bisect.search.bad-init} 2.103 2.104 -Our next task is to nominate a changeset that we know \emph{doesn't} 2.105 -have the bug; the \hgcmd{bisect} command will ``bracket'' its search 2.106 -between the first pair of good and bad changesets. In our case, we 2.107 -know that revision~10 didn't have the bug. (I'll have more words 2.108 -about choosing the first ``good'' changeset later.) 2.109 +Nuestra próxima tarea es nominar al conjunto de cambios que sabemos 2.110 +\emph{no} tiene el fallo; la orden \hgcmd{bisect} ``acotará'' su 2.111 +búsqueda entre el primer par de conjuntos de cambios buenos y malos. 2.112 +En nuestro caso, sabemos que la revisión~10 no tenía el fallo. (Más 2.113 +adelante diré un poco más acerca de la elección del conjunto de 2.114 +cambios ``bueno''.) 2.115 \interaction{bisect.search.good-init} 2.116 2.117 -Notice that this command printed some output. 2.118 +Note que esta orden mostró algo. 2.119 \begin{itemize} 2.120 -\item It told us how many changesets it must consider before it can 2.121 - identify the one that introduced the bug, and how many tests that 2.122 - will require. 2.123 -\item It updated the working directory to the next changeset to test, 2.124 - and told us which changeset it's testing. 2.125 +\item Nos dijo cuántos conjuntos de cambios debe considerar antes de 2.126 + que pueda identifica aquel que introdujo el fallo, y cuántas pruebas 2.127 + se requerirán. 2.128 +\item Actualizó el directorio de trabajo al siguiente conjunto de 2.129 + cambios, y nos dijo qué conjunto de cambios está evaluando. 2.130 \end{itemize} 2.131 2.132 -We now run our test in the working directory. We use the 2.133 -\command{grep} command to see if our ``bad'' file is present in the 2.134 -working directory. If it is, this revision is bad; if not, this 2.135 -revision is good. 2.136 +Ahora ejecutamos nuestra prueba en el directorio de trabajo. Usamos la 2.137 +orden \command{grep} para ver si nuestro fichero ``malo'' está 2.138 +presente en el directorio de trabajo. Si lo está, esta revisión es 2.139 +mala; si no esta revisión es buena. 2.140 \interaction{bisect.search.step1} 2.141 2.142 -This test looks like a perfect candidate for automation, so let's turn 2.143 -it into a shell function. 2.144 +Esta prueba luce como candidata perfecta para automatizarse, por lo 2.145 +tanto la convertimos en una función de interfaz de comandos. 2.146 \interaction{bisect.search.mytest} 2.147 -We can now run an entire test step with a single command, 2.148 +Ahora podemos ejecutar un paso entero de pruebas con un solo comando, 2.149 \texttt{mytest}. 2.150 \interaction{bisect.search.step2} 2.151 -A few more invocations of our canned test step command, and we're 2.152 -done. 2.153 +Unas invocaciones más de nuestra prueba, y hemos terminado. 2.154 \interaction{bisect.search.rest} 2.155 2.156 -Even though we had~40 changesets to search through, the \hgcmd{bisect} 2.157 -command let us find the changeset that introduced our ``bug'' with 2.158 -only five tests. Because the number of tests that the \hgcmd{bisect} 2.159 -command performs grows logarithmically with the number of changesets to 2.160 -search, the advantage that it has over the ``brute force'' search 2.161 -approach increases with every changeset you add. 2.162 - 2.163 -\subsection{Cleaning up after your search} 2.164 - 2.165 -When you're finished using the \hgcmd{bisect} command in a 2.166 -repository, you can use the \hgcmdargs{bisect}{reset} command to drop 2.167 -the information it was using to drive your search. The command 2.168 -doesn't use much space, so it doesn't matter if you forget to run this 2.169 -command. However, \hgcmd{bisect} won't let you start a new search in 2.170 -that repository until you do a \hgcmdargs{bisect}{reset}. 2.171 +Aunque teníamos unos~40 conjuntos de cambios en los cuales buscar, la 2.172 +orden \hgcmd{bisect} nos permitió encontrar el conjunto de cambios que 2.173 +introdujo el ``fallo'' con sólo cinco pruebas. Porque el número de 2.174 +pruebas que la orden \hgcmd{bisect} ejecuta crece logarítmicamente con 2.175 +la cantidad de conjuntos de cambios a buscar, la ventaja que esto 2.176 +tiene frente a la búsqueda por``fuerza bruta'' crece con cada 2.177 +conjunto de cambios que usted adicione. 2.178 + 2.179 +\subsection{Limpieza después de la búsqueda} 2.180 + 2.181 +Cuando haya terminado de usar la orden \hgcmd{bisect} en un 2.182 +repositorio, puede usar la orden \hgcmdargs{bisect}{reset} para 2.183 +deshacerse de la información que se estaba usando para lograr la 2.184 +búsqueda. Lar orden no usa mucho espacio, así que no hay problema si 2.185 +olvida ejecutar la orden. En todo caso, \hgcmd{bisect} no le 2.186 +permitirá comenzar una nueva búsqueda sobre el repositorio hasta que 2.187 +no aplique \hgcmdargs{bisect}{reset}. 2.188 \interaction{bisect.search.reset} 2.189 2.190 \section{Tips for finding bugs effectively}