annotate es/undo.tex @ 709:4432ad34b8e5

Check in example outputs with begin/end markers.
author Bryan O'Sullivan <bos@serpentine.com>
date Tue, 31 Mar 2009 12:19:01 -0700
parents 801442e58e6d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
473
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
1 \chapter{Encontrar y arreglar sus equivocaciones}
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
2 \label{chap:undo}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
3
473
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
4 Errar es humano, pero tratar adecuadamente las consecuencias requiere
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
5 un sistema de control de revisiones de primera categoría. En este
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
6 capítulo, discutiremos algunas técnicas que puede usar cuando
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
7 encuentra que hay un problema enraizado en su proyecto. Mercurial
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
8 tiene unas características poderosas que le ayudarán a isolar las
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
9 fuentes de los problemas, y a dar cuenta de ellas apropiadamente.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
10
615
9da096de3c52 changed "historia" to "historial".
Javier Rojas <jerojasro@devnull.li>
parents: 557
diff changeset
11 \section{Borrar el historial local}
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
12
473
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
13 \subsection{La consignación accidental}
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
14
473
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
15 Tengo el problema ocasional, pero persistente de teclear más rápido de
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
16 lo que pienso, que aveces resulta en consignar un conjunto de cambios
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
17 incompleto o simplemente malo. En mi caso, el conjunto de cambios
477
6d2bbeb50af6 Fixing mistake preventing from build, footnote to ndt, moving archivo to fichero on daily.tex
Igor TAmara <igor@tamarapatino.org>
parents: 476
diff changeset
18 incompleto consiste en que creé un nuevo fichero fuente, pero olvidé
473
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
19 hacerle \hgcmd{add}. Un conjunto de cambios``simplemente malo'' no es
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
20 tan común, pero sí resulta muy molesto.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
21
477
6d2bbeb50af6 Fixing mistake preventing from build, footnote to ndt, moving archivo to fichero on daily.tex
Igor TAmara <igor@tamarapatino.org>
parents: 476
diff changeset
22 \subsection{Hacer rollback una transacción}
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
23 \label{sec:undo:rollback}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
24
473
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
25 En la sección~\ref{sec:concepts:txn}, mencioné que Mercurial trata
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
26 modificación a un repositorio como una \emph{transacción}. Cada vez
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
27 que consigna un conjunto de cambios o lo jala de otro repositorio,
477
6d2bbeb50af6 Fixing mistake preventing from build, footnote to ndt, moving archivo to fichero on daily.tex
Igor TAmara <igor@tamarapatino.org>
parents: 476
diff changeset
28 Mercurial recuerda lo que hizo. Puede deshacer, o hacer \emph{roll back}\ndt{El significado igual que en los
6d2bbeb50af6 Fixing mistake preventing from build, footnote to ndt, moving archivo to fichero on daily.tex
Igor TAmara <igor@tamarapatino.org>
parents: 476
diff changeset
29 ambientes de sistemas manejadores de bases de datos se refiere a
6d2bbeb50af6 Fixing mistake preventing from build, footnote to ndt, moving archivo to fichero on daily.tex
Igor TAmara <igor@tamarapatino.org>
parents: 476
diff changeset
30 la atomicidad e integridad al devolver un conjunto de acciones que
6d2bbeb50af6 Fixing mistake preventing from build, footnote to ndt, moving archivo to fichero on daily.tex
Igor TAmara <igor@tamarapatino.org>
parents: 476
diff changeset
31 permitan dejar el repositorio en un estado consistente previo},
473
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
32 exactamente una de tales acciones usando la orden \hgcmd{rollback}.
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
33 (Ver en la sección~\ref{sec:undo:rollback-after-push} una anotación
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
34 importante acerca del uso de esta orden.)
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
35
473
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
36 A continuación una equivocación que me sucede frecuentemente:
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
37 consignar un cambio en el cual he creado un nuevo fichero, pero he
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
38 olvidado hacerle \hgcmd{add}.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
39 \interaction{rollback.commit}
473
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
40 La salida de \hgcmd{status} después de la consignación confirma
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
41 inmediatamente este error.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
42 \interaction{rollback.status}
477
6d2bbeb50af6 Fixing mistake preventing from build, footnote to ndt, moving archivo to fichero on daily.tex
Igor TAmara <igor@tamarapatino.org>
parents: 476
diff changeset
43 La consignación capturó los cambios en el fichero \filename{a}, pero
473
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
44 no el nuevo fichero \filename{b}. Si yo publicara este conjunto de
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
45 cambios a un repositorio compartido con un colega, es bastante
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
46 probable que algo en \filename{a} se refiriera a \filename{b}, el cual
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
47 podría no estar presente cuando jalen mis cambios del repositorio. Me
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
48 convertiría el sujeto de cierta indignación.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
49
473
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
50 Como sea, la suerte me acompaña---Encontré mi error antes de publicar
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
51 el conjunto de cambios. Uso la orden \hgcmd{rollback}, y Mercurial
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
52 hace desaparecer el último conjunto de cambios.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
53 \interaction{rollback.rollback}
615
9da096de3c52 changed "historia" to "historial".
Javier Rojas <jerojasro@devnull.li>
parents: 557
diff changeset
54 El conjunto de cambios ya no está en el historial del repositorio, y el
473
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
55 directorio de trabajo cree que el fichero \filename{a} ha sido
476
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
56 modificado. La consignación y el roll back dejaron el directorio de
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
57 trabajo exactamente como estaba antes de la consignación; el conjunto
473
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
58 de cambios ha sido eliminado totlamente. Ahora puedo hacer \hgcmd{add}
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
59 al fichero \filename{b}, y hacer de nuevo la consignación.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
60 \interaction{rollback.add}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
61
473
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
62 \subsection{Erroneamente jalado}
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
63
473
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
64 Mantener ramas de desarrollo separadas de un proyecto en distintos
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
65 repositorios es una práctica común con Mercurial. Su equipo de
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
66 desarrollo puede tener un repositorio compartido para la versión ``0.9''
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
67 y otra con cambios distintos para la versión ``1.0''.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
68
473
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
69 Con este escenario, puede imaginar las consecuencias si tuviera un
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
70 repositorio local ``0.9'', y jalara accidentalmente los cambios del
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
71 repositorio compartido de la versión ``1.0'' en este. En el peor de
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
72 los casos, por falta de atención, es posible que publique tales
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
73 cambios en el árbol compartido ``0.9'', confundiendo a todo su equipo
619
bbc5db74bd77 changed many "X(" for "X ("
Javier Rojas <jerojasro@devnull.li>
parents: 617
diff changeset
74 de trabajo (pero no se preocupe, volveremos a este terrorífico
473
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
75 escenario posteriormente). En todo caso, es muy probable que usted se
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
76 de cuenta inmediatamente, dado que Mercurial mostrará el URL de donde
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
77 está jalando, o que vea jalando una sospechosa gran cantidad de
c2ff82128ac5 Started translating undo.tex , added mistake and rollback
Igor TAmara <igor@tamarapatino.org>
parents: 442
diff changeset
78 cambios en el repositorio.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
79
476
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
80 La orden \hgcmd{rollback} excluirá eficientemente los conjuntos de
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
81 cambios que haya acabado de jalar. Mercurial agrupa todos los cambios
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
82 de un \hgcmd{pull} a una única transacción y bastará con un
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
83 \hgcmd{rollback} para deshacer esta equivocación.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
84
476
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
85 \subsection{Después de publicar, un roll back es futil}
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
86 \label{sec:undo:rollback-after-push}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
87
476
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
88 El valor de \hgcmd{rollback} se anula cuando ha publicado sus cambios
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
89 a otro repositorio. Un cambio desaparece totalmente al hacer roll back,
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
90 pero \emph{solamente} en el repositorio en el cual aplica
615
9da096de3c52 changed "historia" to "historial".
Javier Rojas <jerojasro@devnull.li>
parents: 557
diff changeset
91 \hgcmd{rollback}. Debido a que un roll back elimina el historial,
476
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
92 no hay forma de que la desaparición de un cambio se propague entre
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
93 repositorios.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
94
476
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
95 Si ha publicado un cambio en otro repositorio---particularmente si es
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
96 un repositorio público---esencialmente está ``en terreno agreste,''
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
97 y tendrá que reparar la equivocación de un modo distinto. Lo que
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
98 pasará si publica un conjunto de cambios en algún sitio, hacer
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
99 rollback y después volver a jalar del repositorio del cual había
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
100 publicado, es que el conjunto de cambios reaparecerá en su repositorio.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
101
476
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
102 (Si está absolutamente segruro de que el conjunto de cambios al que
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
103 desea hacer rollback es el cambio más reciente del repositorio en el
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
104 cual publicó, \emph{y} sabe que nadie más pudo haber jalado de tal
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
105 repositorio, puede hacer rollback del conjunto de cambios allí, pero
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
106 es mejor no confiar en una solución de este estilo. Si lo hace, tarde
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
107 o temprano un conjunto de cambios logrará colarse en un repositorio
619
bbc5db74bd77 changed many "X(" for "X ("
Javier Rojas <jerojasro@devnull.li>
parents: 617
diff changeset
108 que usted no controle directamente (o del cual se ha olvidado), y
476
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
109 volverá a hostigarle.)
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
110
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
111 \subsection{Solamente hay un roll back}
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
112
476
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
113 Mercurial almacena exactamente una transacción en su bitácora de
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
114 transacciones; tal transacción es la más reciente de las que haya
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
115 ocurrido en el repositorio. Esto significa que solamente puede hacer
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
116 roll back a una transacción. Si espera poder hacer roll back a una
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
117 transacción después al antecesor, observará que no es el
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
118 comportamiento que obtendrá.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
119 \interaction{rollback.twice}
476
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
120 Una vez que haya aplicado un rollback en una transacción a un
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
121 repositorio, no podrá volver a hacer rollback hasta que haga una
d5f1049a79dd roll back untranslatable and more on undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 473
diff changeset
122 consignación o haya jalado.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
123
485
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
124 \section{Revertir un cambio equivocado}
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
125
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
126 Si modifica un fichero y se da cuenta que no quería realmente cambiar
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
127 tal fichero, y todavía no ha consignado los cambios, la orden
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
128 necesaria es \hgcmd{revert}. Observa el conjunto de cambios padre del
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
129 directorio y restaura los contenidos del fichero al estado de tal
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
130 conjunto de cambios. (Es una forma larga de decirlo, usualmente
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
131 deshace sus modificaciones.)
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
132
485
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
133 Ilustremos como actúa la orden \hgcmd{revert} con un ejemplo
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
134 pequeño. Comenzaremos modificando un fichero al cual Mercurial ya está
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
135 siguiendo.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
136 \interaction{daily.revert.modify}
485
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
137 Si no queremos ese cambio, podemos aplicar \hgcmd{revert} al fichero.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
138 \interaction{daily.revert.unmodify}
485
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
139 La orden \hgcmd{revert} nos brinda un grado adicional de seguridad
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
140 guardando nuestro fichero modificado con la extensión \filename{.orig}.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
141 \interaction{daily.revert.status}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
142
485
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
143 Este es un resumen de casos en los cuales la orden \hgcmd{revert} es
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
144 de utilidad. Describiremos cada uno de ellos con más detalle en la
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
145 sección siguiente.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
146 \begin{itemize}
485
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
147 \item Si usted modifica un fichero, lo restaurará a su estado sin
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
148 modificación previo.
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
149 \item Si usted hace \hgcmd{add} a un fichero, revertirá el estado de
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
150 ``adicionado'' del fichero, pero no lo tocará
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
151 \item Si borra un fichero sin decirle a Mercurial, restaurará el
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
152 fichero con sus contenidos sin modificación.
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
153 \item Si usa la orden \hgcmd{remove} para eliminar un fichero, deshará
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
154 el estado ``removido'' del fichero, y lo restaurará con sus
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
155 contenidos sin modificación.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
156 \end{itemize}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
157
485
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
158 \subsection{Errores al administrar ficheros}
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
159 \label{sec:undo:mgmt}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
160
485
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
161 La orden \hgcmd{revert} es útil para más que ficheros modificados. Le
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
162 permite reversar los resultados de todas las órdenes de administración
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
163 de ficheros que provee Mercurial---\hgcmd{add}, \hgcmd{remove}, y las
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
164 demás.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
165
485
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
166 Si usted hace \hgcmd{add} a un fichero, y no deseaba que Mercurial le
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
167 diera seguimiento, use \hgcmd{revert} para deshacer la adición. No se
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
168 preocupe; Mercurial no modificará de forma alguna el fichero.
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
169 Solamente lo ``desmarcará''.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
170 \interaction{daily.revert.add}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
171
485
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
172 De forma similar, Si le solicita a Mercurial hacer \hgcmd{remove} a un
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
173 fichero, puede usar \hgcmd{revert} para restarurarlo a los contenidos
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
174 que tenía la revisión padre del directorio de trabajo.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
175 \interaction{daily.revert.remove}
485
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
176 Funciona de la misma manera para un fichero que usted haya eliminado
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
177 manualmente, sin decirle a Mercurial (recuerde que en la terminología
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
178 de Mercurial esta clase de fichero se llama ``faltante'').
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
179 \interaction{daily.revert.missing}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
180
485
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
181 Si usted revierte un \hgcmd{copy}, el fichero a donde se copió
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
182 permanece en su directorio de trabajo, pero sin seguimiento. Dado que
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
183 una copia no afecta el fichero fuente de copiado de ninguna maner,
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
184 Mercurial no hace nada con este.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
185 \interaction{daily.revert.copy}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
186
485
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
187 \subsubsection{Un caso ligeramente especial:revertir un renombramiento}
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
188
485
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
189 Si hace \hgcmd{rename} a un fichero, hay un detalle que debe tener en
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
190 cuenta. Cuando aplica \hgcmd{revert} a un cambio de nombre, no es
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
191 suficiente proveer el nombre del fichero destino, como puede verlo en
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
192 el siguiente ejemplo.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
193 \interaction{daily.revert.rename}
485
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
194 Como puede ver en la salida de \hgcmd{status}, el fichero con el nuevo
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
195 nombre no se identifica más como agregado, pero el fichero con el
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
196 nombre-\emph{inicial} se elimna! Esto es contra-intuitivo (por lo
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
197 menos para mí), pero por lo menos es fácil arreglarlo.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
198 \interaction{daily.revert.rename-orig}
485
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
199 Por lo tanto, recuerde, para revertir un \hgcmd{rename}, debe proveer
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
200 \emph{ambos} nombres, la fuente y el destino.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
201
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
202 % TODO: the output doesn't look like it will be removed!
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
203
485
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
204 (A propósito, si elimina un fichero, y modifica el fichero con el
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
205 nuevo nombre, al revertir ambos componentes del renombramiento, cuando
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
206 Mercurial restaure el fichero que fue eliminado como parte del
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
207 renombramiento, no será modificado.
499
f89ee6f63ea2 Archivo to Fichero and update Leame.1st
Igor TAmara <igor@tamarapatino.org>
parents: 497
diff changeset
208 Si necesita que las modificaciones en el fichero destino del
485
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
209 renombramiento se muestren, no olvide copiarlas encima.)
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
210
486
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
211 Estos aspectos engorrosos al revertir un renombramiento se constituyen
485
d2467817c934 some paragraphs translated to spanish
Igor TAmara <igor@tamarapatino.org>
parents: 477
diff changeset
212 discutiblemente en un fallo de Mercurial.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
213
486
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
214 \section{Tratar cambios consignados}
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
215
486
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
216 Considere un caso en el que ha consignado el cambio $a$, y otro cambio
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
217 $b$ sobre este; se ha dado cuenta que el cambio $a$ era
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
218 incorrecto. Mercurial le permite ``retroceder'' un conjunto de cambios
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
219 completo automáticamente, y construir bloques que le permitan revertir
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
220 parte de un conjunto de cambios a mano.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
221
486
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
222 Antes de leer esta sección, hay algo para tener en cuenta: la orden
617
4bfe08b3c3e4 corrected a couple of typos
Javier Rojas <jerojasro@devnull.li>
parents: 616
diff changeset
223 \hgcmd{backout} deshace cambios \emph{adicionando} al historial, sin
486
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
224 modificar o borrar. Es la herramienta correcta si está arreglando
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
225 fallos, pero no si está tratando de deshacer algún cambio que tiene
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
226 consecuencias catastróficas. Para tratar con esos, vea la sección~\ref{sec:undo:aaaiiieee}.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
227
486
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
228 \subsection{Retroceder un conjunto de cambios}
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
229
486
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
230 La orden \hgcmd{backout} le permite ``deshacer'' los efectos de todo
615
9da096de3c52 changed "historia" to "historial".
Javier Rojas <jerojasro@devnull.li>
parents: 557
diff changeset
231 un conjunto de cambios de forma automatizada. Dado que el historial de
486
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
232 Mercurial es inmutable, esta orden \emph{no} se deshace del conjunto
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
233 de cambios que usted desea deshacer. En cambio, crea un nuevo
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
234 conjunto de cambios que \emph{reversa} el conjunto de cambios que
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
235 usted indique.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
236
486
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
237 La operación de la orden \hgcmd{backout} es un poco intrincada, y lo
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
238 ilustraremos con algunos ejemplos. Primero crearemos un repositorio
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
239 con algunos cambios sencillos.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
240 \interaction{backout.init}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
241
486
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
242 La orden \hgcmd{backout} toma un ID de conjunto de cambios como su
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
243 argumento; el conjunto de cambios a retroceder. Normalmente
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
244 \hgcmd{backout} le ofrecerá un editor de texto para escribir el
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
245 mensaje de la consignación, para dejar un registro de por qué está
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
246 retrocediendo. En este ejemplo, colocamos un mensaje en la
621
4af39acbb3cf changed " ." to "." where needed
Javier Rojas <jerojasro@devnull.li>
parents: 619
diff changeset
247 consignación usando la opción \hgopt{backout}{-m}.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
248
487
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
249 \subsection{Retroceder el conjunto de cambios punta}
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
250
486
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
251 Comenzamos retrocediendo el último conjunto de cambios que consignamos.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
252 \interaction{backout.simple}
486
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
253 Puede ver que la segunda línea de \filename{myfile} ya no está
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
254 presente. La salida de \hgcmd{log} nos da una idea de lo que la orden
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
255 \hgcmd{backout} ha hecho.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
256 \interaction{backout.simple.log}
486
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
257 Vea que el nuevo conjunto de cambios que \hgcmd{backout} ha creado es
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
258 un hijo del conjunto de cambios que retrocedimos. Es más sencillo de
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
259 ver en la figura~\ref{fig:undo:backout}, que presenta una vista
616
3f32047a3f25 changed all "de el" to "del"
Javier Rojas <jerojasro@devnull.li>
parents: 615
diff changeset
260 gráfica del historial de cambios. Como puede ver, el historial es
615
9da096de3c52 changed "historia" to "historial".
Javier Rojas <jerojasro@devnull.li>
parents: 557
diff changeset
261 bonito y lineal.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
262
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
263 \begin{figure}[htb]
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
264 \centering
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
265 \grafix{undo-simple}
486
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
266 \caption{Retroceso de un cambio con la orden \hgcmd{backout}}
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
267 \label{fig:undo:backout}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
268 \end{figure}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
269
487
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
270 \subsection{Retroceso de un cambio que no es la punta}
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
271
486
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
272 Si desea retrocede un cambio distinto al último que ha consignado, use
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
273 la opción \hgopt{backout}{--merge} a la orden \hgcmd{backout}.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
274 \interaction{backout.non-tip.clone}
486
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
275 Que resulta en un retroceso de un conjunto de cambios ``en un sólo
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
276 tiro'', una operación que resulta normalmente rápida y sencilla.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
277 \interaction{backout.non-tip.backout}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
278
486
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
279 Si ve los contenidos del fichero \filename{myfile} después de
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
280 finalizar el retroceso, verá que el primer y el tercer cambio están
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
281 presentes, pero no el segundo.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
282 \interaction{backout.non-tip.cat}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
283
615
9da096de3c52 changed "historia" to "historial".
Javier Rojas <jerojasro@devnull.li>
parents: 557
diff changeset
284 Como lo muestra el historial gráfico en la
486
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
285 figura~\ref{fig:undo:backout-non-tip}, Mercurial realmente consigna
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
286 \emph{dos} cambios en estas situaciones (los nodos encerrados en una
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
287 caja son aquellos que Mercurial consigna automaticamente). Antes de
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
288 que Mercurial comience el proceso de retroceso, primero recuerda cuál
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
289 es el padre del directorio de trabajo. Posteriormente hace un
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
290 retroceso al conjunto de cambios objetivo y lo consigna como un
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
291 conjunto de cambios. Finalmente, fusiona con el padre anterior del
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
292 directorio de trabajo, y consigna el resultado de la fusión.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
293
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
294 % TODO: to me it looks like mercurial doesn't commit the second merge automatically!
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
295
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
296 \begin{figure}[htb]
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
297 \centering
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
298 \grafix{undo-non-tip}
487
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
299 \caption{Retroceso automatizado de un cambio a algo que no es la punta con la orden \hgcmd{backout}}
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
300 \label{fig:undo:backout-non-tip}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
301 \end{figure}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
302
486
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
303 El resultado es que usted termina ``donde estaba'', solamente con un
615
9da096de3c52 changed "historia" to "historial".
Javier Rojas <jerojasro@devnull.li>
parents: 557
diff changeset
304 poco de historial adicional que deshace el efecto de un conjunto de
486
7864f2264e28 translated some paragraphs of undo.tex
Igor TAmara <igor@tamarapatino.org>
parents: 485
diff changeset
305 cambios que usted quería evitar.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
306
487
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
307 \subsubsection{Use siempre la opción \hgopt{backout}{--merge}}
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
308
487
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
309 De hecho, dado que la opción \hgopt{backout}{--merge} siempre hara lo
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
310 ``correcto'' esté o no retrocediendo el conjunto de cambios punta
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
311 (p.e.~no tratará de fusionar si está retrocediendo la punta, dado que
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
312 no es necesario), usted debería usar \emph{siempre} esta opción cuando
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
313 ejecuta la orden \hgcmd{backout}.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
314
487
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
315 \subsection{Más control sobre el proceso de retroceso}
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
316
487
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
317 A pesar de que recomiendo usar siempre la opción
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
318 \hgopt{backout}{--merge} cuando está retrocediendo un cambio, la orden
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
319 \hgcmd{backout} le permite decidir cómo mezclar un retroceso de un
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
320 conjunto de cambios. Es muy extraño que usted necestite tomar control
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
321 del proceso de retroceso de forma manual, pero puede ser útil entender
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
322 lo que la orden \hgcmd{backout} está haciendo automáticamente para
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
323 usted. Para ilustrarlo, clonemos nuestro primer repositorio, pero
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
324 omitamos el retroceso que contiene.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
325
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
326 \interaction{backout.manual.clone}
487
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
327 Como en el ejemplo anterior, consignaremos un tercer cambio, después
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
328 haremos retroceso de su padre, y veremos qué pasa.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
329 \interaction{backout.manual.backout}
487
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
330 Nuestro nuevo conjunto de cambios es de nuevo un descendiente del
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
331 conjunto de cambio que retrocedimos; es por lo tanto una nueva cabeza,
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
332 \emph{no} un descendiente del conjunto de cambios que era la punta. La
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
333 orden \hgcmd{backout} fue muy explícita diciéndolo.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
334 \interaction{backout.manual.log}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
335
615
9da096de3c52 changed "historia" to "historial".
Javier Rojas <jerojasro@devnull.li>
parents: 557
diff changeset
336 De nuevo, es más sencillo lo que pasó viendo una gráfica del
9da096de3c52 changed "historia" to "historial".
Javier Rojas <jerojasro@devnull.li>
parents: 557
diff changeset
337 historial de revisiones, en la figura~\ref{fig:undo:backout-manual}.
487
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
338 Esto nos aclara que cuando usamos \hgcmd{backout} para retroceder un
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
339 cambio a algo que no sea la punta, Mercurial añade una nueva cabeza al
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
340 repositorio (el cambio que consignó está encerrado en una caja).
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
341
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
342 \begin{figure}[htb]
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
343 \centering
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
344 \grafix{undo-manual}
487
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
345 \caption{Retroceso usando la orden \hgcmd{backout}}
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
346 \label{fig:undo:backout-manual}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
347 \end{figure}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
348
487
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
349 Después de que la orden \hgcmd{backout} ha terminado, deja un nuevo
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
350 conjunto de cambios de ``retroceso'' como el padre del directorio de trabajo.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
351 \interaction{backout.manual.parents}
487
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
352 Ahora tenemos dos conjuntos de cambios aislados.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
353 \interaction{backout.manual.heads}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
354
487
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
355 Reflexionemos acerca de lo que esperamos ver como contenidos de
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
356 \filename{myfile}. El primer cambio debería estar presente, porque
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
357 nunca le hicimos retroceso. El segundo cambio debió desaparecer,
616
3f32047a3f25 changed all "de el" to "del"
Javier Rojas <jerojasro@devnull.li>
parents: 615
diff changeset
358 puesto que es el que retrocedimos. Dado que la gráfica del historial
487
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
359 muestra que el tercer camlio es una cabeza separada, \emph{no}
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
360 esperamos ver el tercer cambio presente en \filename{myfile}.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
361 \interaction{backout.manual.cat}
499
f89ee6f63ea2 Archivo to Fichero and update Leame.1st
Igor TAmara <igor@tamarapatino.org>
parents: 497
diff changeset
362 Para que el tercer cambio esté en el fichero, hacemos una fusión usual
487
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
363 de las dos cabezas.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
364 \interaction{backout.manual.merge}
615
9da096de3c52 changed "historia" to "historial".
Javier Rojas <jerojasro@devnull.li>
parents: 557
diff changeset
365 Después de eso, el historial gráfica de nuestro repositorio luce como
487
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
366 la figura~\ref{fig:undo:backout-manual-merge}.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
367
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
368 \begin{figure}[htb]
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
369 \centering
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
370 \grafix{undo-manual-merge}
487
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
371 \caption{Fusión manual de un retroceso}
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
372 \label{fig:undo:backout-manual-merge}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
373 \end{figure}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
374
487
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
375 \subsection{Por qué \hgcmd{backout} hace lo que hace}
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
376
487
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
377 Esta es una descripción corta de cómo trabaja la orden \hgcmd{backout}.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
378 \begin{enumerate}
487
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
379 \item Se asegura de que el directorio de trabajo es ``limpio'', esto
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
380 es, que la salida de \hgcmd{status} debería ser vacía.
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
381 \item Recuerda el padre actual del directorio de trabajo. A este
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
382 conjunto de cambio lo llamaremos \texttt{orig}
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
383 \item Hace el equivalente de un \hgcmd{update} para sincronizar el
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
384 directorio de trabajo con el conjunto de cambios que usted quiere
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
385 retroceder. Lo llamaremos \texttt{backout}
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
386 \item Encuentra el padre del conjunto de cambios. Lo llamaremos
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
387 \texttt{parent}.
499
f89ee6f63ea2 Archivo to Fichero and update Leame.1st
Igor TAmara <igor@tamarapatino.org>
parents: 497
diff changeset
388 \item Para cada fichero del conjunto de cambios que el
487
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
389 \texttt{retroceso} afecte, hará el equivalente a
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
390 \hgcmdargs{revert}{-r parent} sobre ese fichero, para restaurarlo a
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
391 los contenidos que tenía antes de que el conjunto de cambios fuera
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
392 consignado.
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
393 \item Se consigna el resultado como un nuevo conjunto de cambios y
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
394 tiene a \texttt{backout} como su padre.
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
395 \item Si especifica \hgopt{backout}{--merge} en la línea de comandos,
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
396 se fusiona con \texttt{orig}, y se consigna el resultado de la
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
397 fusión.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
398 \end{enumerate}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
399
487
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
400 Una vía alternativa de implementar la orden \hgcmd{backout} sería usar
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
401 \hgcmd{export} sobre el conjunto de cambios a retroceder como un diff
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
402 y después usar laa opción \cmdopt{patch}{--reverse} de la orden
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
403 \command{patch} para reversar el efecto del cambio sin molestar el
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
404 directorio de trabajo. Suena mucho más simple, pero no funcionaría
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
405 bien ni de cerca.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
406
487
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
407 La razón por la cual \hgcmd{backout} hace una actualización, una
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
408 consignación, una fusión y otra consignación es para dar a la
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
409 maquinaria de fusión la mayor oportunidad de hacer un buen trabajo
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
410 cuando se trata con todos los cambios \emph{entre} el cambio que está
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
411 retrocediendo y la punta actual.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
412
487
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
413 Si está retrocediendo un conjunto de cambios que está a unas ~100
615
9da096de3c52 changed "historia" to "historial".
Javier Rojas <jerojasro@devnull.li>
parents: 557
diff changeset
414 atrás en su historial del proyecto, las posibilidades de que una orden
487
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
415 \command{patch} sea capaz de ser aplicada a un diff reverso,
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
416 claramente no son altas, porque los cambios que intervienen podrían
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
417 ``no coincidir con el contexto'' que \command{patch} usa para
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
418 determinar si puede aplicar un parche (si esto suena como cháchara,
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
419 vea una discusión de la orden \command{patch} en \ref{sec:mq:patch}).
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
420 Adicionalmente, la maquinaria de fusión de Mercurial manejará ficheros
9fdb45b994d4 Finished backing out section
Igor TAmara <igor@tamarapatino.org>
parents: 486
diff changeset
421 y directorios renombrados, cambios de permisos, y modificaciones a
499
f89ee6f63ea2 Archivo to Fichero and update Leame.1st
Igor TAmara <igor@tamarapatino.org>
parents: 497
diff changeset
422 ficheros binarios, nada de lo cual la orden \command{patch} puede manejar.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
423
488
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
424 \section{Cambios que nunca debieron ocurrir}
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
425 \label{sec:undo:aaaiiieee}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
426
488
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
427 En la mayoría de los casos, la orden \hgcmd{backout} es exactamente lo
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
428 que necesita para deshacer los efectos de un cambio. Deja un registro
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
429 permanente y exacto de lo que usted hizo, cuando se consignó el
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
430 conjunto de cambios original y cuando se hizo la limpieza.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
431
488
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
432 En ocasiones particulares, puede haber consignado un cambio que no
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
433 debería estar de ninguna forma en el repositorio. Por ejemplo, sería
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
434 muy inusual, y considerado como una equivocación, consignar los
624
801442e58e6d changed ". x" to ". X"
Javier Rojas <jerojasro@devnull.li>
parents: 621
diff changeset
435 ficheros objeto junto con el código fuente. Los ficheros objeto no
488
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
436 tienen valor intrínseco y son \emph{grandes}, por lo tanto aumentan el
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
437 tamaño del repositorio y la cantidad de tiempo que se emplea al clonar
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
438 o jalar cambios.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
439
488
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
440 Antes de discutir las opciones que tiene si consignó cambio del tipo
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
441 ``bolsa de papel deschable'' (el tipo que es tan malo que le gustaría
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
442 colocarse una bolsa de papel desechable en su cabeza), permítame
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
443 discutir primero unas aproximaciones que probablemente no funcionen.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
444
615
9da096de3c52 changed "historia" to "historial".
Javier Rojas <jerojasro@devnull.li>
parents: 557
diff changeset
445 Dado que Mercurial trata de forma acumulativa al historial---cada
9da096de3c52 changed "historia" to "historial".
Javier Rojas <jerojasro@devnull.li>
parents: 557
diff changeset
446 cambio se coloca encima de todos los cambios que le
9da096de3c52 changed "historia" to "historial".
Javier Rojas <jerojasro@devnull.li>
parents: 557
diff changeset
447 preceden---usualmente usted no puede hacer que unos cambios desastrosos
488
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
448 desaparezcan. La única excepción es cuando usted ha acabado de
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
449 consignar un cambio y este no ha sido publicado o jalado en otro
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
450 repositorio. Ahí es cuando puede usar la orden \hgcmd{rollback} con
615
9da096de3c52 changed "historia" to "historial".
Javier Rojas <jerojasro@devnull.li>
parents: 557
diff changeset
451 seguridad, como detallé en la sección~\ref{sec:undo:rollback}.
488
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
452
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
453 Después de que usted haya publicado un cambio en otro repositorio, usted
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
454 \emph{podría} usar la orden \hgcmd{rollback} para hacer que en su copia
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
455 local desaparezca el cambio, pero no tendrá las consecuencias que
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
456 desea. El cambio estará presente en un repositorio remoto, y
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
457 reaparecerá en su repositorio local la próxima vez que jale
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
458
488
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
459 Si una situación como esta se presenta, y usted sabe en qué
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
460 repositorios su mal cambio se ha propagado, puede \emph{intentar}
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
461 deshacerse del conjunto de cambios de \emph{todos} los repositorios en
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
462 los que se pueda encontrar. Esta por supuesto, no es una solución
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
463 satisfactoria: si usted deja de hacerlo en un solo repositorio,
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
464 mientras esté eliminándolo, el cambio todavía estará ``allí afuera'',
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
465 y podría propagarse más tarde.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
466
488
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
467 Si ha consignado uno o más cambios \emph{después} del cambio que desea
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
468 desaparecer, sus opciones son aún más reducidas. Mercurial no provee
615
9da096de3c52 changed "historia" to "historial".
Javier Rojas <jerojasro@devnull.li>
parents: 557
diff changeset
469 una forma de ``cabar un hueco'' en el historial, dejando los conjuntos
488
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
470 de cambios intactos.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
471
488
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
472 %Dejamos de traducir lo que viene a continuación, porque será
b7d4d66c3ae5 Aiiiiiee section translated
Igor TAmara <igor@tamarapatino.org>
parents: 487
diff changeset
473 %modificado por upstream...
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
474
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
475 XXX This needs filling out. The \texttt{hg-replay} script in the
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
476 \texttt{examples} directory works, but doesn't handle merge
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
477 changesets. Kind of an important omission.
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
478
496
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
479 \subsection{Cómo protegerse de cambios que han ``escapado''}
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
480
496
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
481 Si ha consignado cambios a su repositorio local y estos han sido
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
482 publicados o jalados en cualquier otro sitio, no es necesariamente un
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
483 desastre. Puede protegerse de antemano de ciertas clases de conjuntos
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
484 de cambios malos. Esto es particularmente sencillo si su equipo de
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
485 trabajo jala cambios de un repositorio central.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
486
557
626c16b87174 corrected a typo
Javier Rojas <jerojasro@devnull.li>
parents: 500
diff changeset
487 Al configurar algunos ganchos en el repositorio central para validar
619
bbc5db74bd77 changed many "X(" for "X ("
Javier Rojas <jerojasro@devnull.li>
parents: 617
diff changeset
488 conjuntos de cambios (ver capítulo~\ref{chap:hook}), puede prevenir la
496
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
489 publicación automáticamente de cierta clase de cambios malos. Con tal
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
490 configuración, cierta clase de conjuntos de cambios malos tenderán
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
491 naturalmente a``morir'' debido a que no pueden propagarse al
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
492 repositorio central. Esto sucederá sin necesidad de intervención
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
493 explícita.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
494
496
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
495 Por ejemplo, un gancho de cambios de entrada que verifique que un
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
496 conjunto de cambios compila, puede prevenir que la gente ``rompa
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
497 la compilación'' inadvertidamente.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
498
496
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
499 \section{Al encuentro de la fuente de un fallo}
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
500 \label{sec:undo:bisect}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
501
496
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
502 Aunque es muy bueno poder retroceder el conjunto de cambios que
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
503 originó un fallo, se requiere que usted sepa cual conjunto de cambios
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
504 retroceder. Mercurial brinda una orden invaluable, llamada
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
505 \hgcmd{bisect}, que ayuda a automatizar este proceso y a alcanzarlo
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
506 muy eficientemente.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
507
496
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
508 La idea tras la orden \hgcmd{bisect} es que el conjunto de cambios que
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
509 ha introducido un cambio de comportamiento pueda identificarse con una
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
510 prueba binaria sencilla. No tiene que saber qué pieza de código
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
511 introdujo el cambio, pero si requiere que sepa cómo probar la
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
512 existencia de un fallo. La orden \hgcmd{bisect} usa su prueba para
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
513 dirigir su búsqueda del conjunto de cambios que introdujo el código
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
514 causante del fallo.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
515
496
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
516 A continuación un conjunto de escenarios que puede ayudarle a entender
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
517 cómo puede aplicar esta orden.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
518 \begin{itemize}
496
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
519 \item La versión más reciente de su programa tiene un fallo que usted
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
520 recuerda no estaba hace unas semanas, pero no sabe cuándo fue
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
521 introducido. En este caso, su prueba binaria busca la presencia de
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
522 tal fallo.
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
523 \item Usted arregló un fallo en un apurto, y es hora de dar por
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
524 cerrado el caso en la base de datos de fallos de su equipo de
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
525 trabajo. La base de datos de fallos requiere el ID del conjunto de
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
526 cambios que permita dar por cerrado el caso, pero usted no recuerda
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
527 qué conjunto de cambios arregló tal fallo. De nuevo la prueba
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
528 binaria revisa la presencia del fallo.
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
529 \item Su programa funciona correctamente, pero core ~15\% más lento
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
530 que la última vez que lo midió. Usted desea saber qué conjunto de
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
531 cambios introdujo esta disminución de desempeño. En este caso su
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
532 prueba binaria mide el desempeño de su programa, para ver dónde es
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
533 ``rápido'' y dónde es ``lento''.
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
534 \item Los tamaños de los componentes del proyecto que usted lleva se
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
535 expandieron recientemente, y sospecha que algo cambio en la forma en
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
536 que se construye su proyecto.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
537 \end{itemize}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
538
496
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
539 Para estos ejemplos debería ser claro que la orden \hgcmd{bisect}
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
540 es útil no solamente para encontrar la fuente de los fallos. Puede
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
541 usarla para encontrar cualquier ``propiedad emergente'' de un
619
bbc5db74bd77 changed many "X(" for "X ("
Javier Rojas <jerojasro@devnull.li>
parents: 617
diff changeset
542 repositorio (Cualquier cosa que usted no pueda encontrar con una
499
f89ee6f63ea2 Archivo to Fichero and update Leame.1st
Igor TAmara <igor@tamarapatino.org>
parents: 497
diff changeset
543 búsqueda de texto sencilla sobre los ficheros en el árbol) para la
496
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
544 cual pueda escribir una prueba binaria.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
545
496
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
546 A continuación introduciremos algo terminología, para aclarar qué
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
547 partes del proceso de búsqueda son su responsabilidad y cuáles de
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
548 Mercurial. Una \emph{prueba} es algo que \emph{usted} ejecuta cuando
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
549 \hgcmd{bisect} elige un conjunto de cambios. Un \emph{sondeo} es lo que
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
550 \hgcmd{bisect} ejecuta para decidir si una revisión es buena. Finalmente,
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
551 usaremos la palabra ``biseccionar', en frases como ``buscar con la
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
552 orden \hgcmd{bisect}''.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
553
496
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
554 Una forma sencilla de automatizar el proceso de búsqueda sería probar
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
555 cada conjunto de cambios. Lo cual escala muy poco. Si le tomó diez
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
556 minutos hacer pruebas sobre un conjunto de cambios y tiene 10.000
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
557 conjuntos de cambios en su repositorio, esta aproximación exhaustiva
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
558 tomaría en promedio~35 \emph{días} para encontrar el conjunto de
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
559 cambios que introdujo el fallo. Incluso si supiera que el fallo se
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
560 introdujo en un de los últimos 500 conjuntos de cambios y limitara la
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
561 búsqueda a ellos, estaría tomabdi más de 40 horas para encontrar al
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
562 conjunto de cambios culpable.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
563
615
9da096de3c52 changed "historia" to "historial".
Javier Rojas <jerojasro@devnull.li>
parents: 557
diff changeset
564 La orden \hgcmd{bisect} usa su conocimiento de la ``forma'' del
9da096de3c52 changed "historia" to "historial".
Javier Rojas <jerojasro@devnull.li>
parents: 557
diff changeset
565 historial de revisiones de su proyecto para hacer una búsqueda
496
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
566 proporcional al \emph{logaritmo} del número de conjunto de cambios a
615
9da096de3c52 changed "historia" to "historial".
Javier Rojas <jerojasro@devnull.li>
parents: 557
diff changeset
567 revisar (el tipo de búsqueda que realiza se llama búsqueda
496
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
568 binaria). Con esta aproximación, el buscar entre 10.000 conjuntos de
615
9da096de3c52 changed "historia" to "historial".
Javier Rojas <jerojasro@devnull.li>
parents: 557
diff changeset
569 cambios tomará menos de 3 horas, incluso a diez minutos por prueba (La
496
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
570 búsqueda requerirá cerca de 14 pruebas). Al limitar la búsqueda a la
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
571 última centena de conjuntos de cambios, tomará a lo sumo una
615
9da096de3c52 changed "historia" to "historial".
Javier Rojas <jerojasro@devnull.li>
parents: 557
diff changeset
572 hora (Apenas unas 7 pruebas).
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
573
496
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
574 La orden \hgcmd{bisect} tiene en cuenta la naturaleza ``ramificada''
616
3f32047a3f25 changed all "de el" to "del"
Javier Rojas <jerojasro@devnull.li>
parents: 615
diff changeset
575 del historial de revisiones del proyecto con Mercurial, así que no
496
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
576 hay problemas al tratar con ramas, fusiones o cabezas múltiples en un
615
9da096de3c52 changed "historia" to "historial".
Javier Rojas <jerojasro@devnull.li>
parents: 557
diff changeset
577 repositorio. Puede evitar ramas enteras de historial con un solo
496
b8d9066abcea Translated initial paragraphs regarding bisect command
Igor TAmara <igor@tamarapatino.org>
parents: 488
diff changeset
578 sondeo.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
579
497
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
580 \subsection{Uso de la orden \hgcmd{bisect}}
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
581
497
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
582 A continuación un ejemplo de \hgcmd{bisect} en acción.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
583
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
584 \begin{note}
497
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
585 En las versiones 0.9.5 y anteriores de Mercurial, \hgcmd{bisect} no
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
586 era una orden incluída en la distribución principal: se ofrecía como
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
587 una extensión de Mercurial. Esta sección describe la orden embebida
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
588 y no la extensión anterior.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
589 \end{note}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
590
497
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
591 Creamos un repostorio para probar el comando \hgcmd{bisect} de forma
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
592 aislada
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
593 \interaction{bisect.init}
497
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
594 Simularemos de forma sencilla un proyecto con un fallo: haremos
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
595 cambios triviales en un ciclo, e indicaremos que un cambio específico
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
596 sea el ``fallo''. Este ciclo crea 35 conjuntos de cambios, cada uno
499
f89ee6f63ea2 Archivo to Fichero and update Leame.1st
Igor TAmara <igor@tamarapatino.org>
parents: 497
diff changeset
597 añade un único fichero al repositorio. Representaremos nuestro ``fallo''
497
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
598 con un fichero que contiene el texto ``tengo un gub''.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
599 \interaction{bisect.commits}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
600
497
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
601 A continuación observaremos cómo usar la orden \hgcmd{bisect}. Podemos
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
602 usar el mecanismo de ayuda embebida que trae Mercurial.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
603 \interaction{bisect.help}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
604
497
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
605 La orden \hgcmd{bisect} trabaja en etapas, de la siguiente forma:
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
606 \begin{enumerate}
497
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
607 \item Usted ejecuta una prueba binaria.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
608 \begin{itemize}
497
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
609 \item Si la prueba es exitosa, usted se lo indicará a \hgcmd{bisect}
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
610 ejecutando la orden \hgcmdargs{bisect}{good}.
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
611 \item Si falla, ejecutará la orden \hgcmdargs{bisect}{--bad}.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
612 \end{itemize}
497
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
613 \item La orden usa su información para decidir qué conjuntos de
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
614 cambios deben probarse a continuación.
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
615 \item Actualiza el directorio de trabajo a tal conjunto de cambios y
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
616 el proceso se lleva a cabo de nuevo.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
617 \end{enumerate}
497
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
618 El proceso termina cuando \hgcmd{bisect} identifica un único conjunto
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
619 de cambios que marca el punto donde se encontró la transición de
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
620 ``exitoso'' a ``fallido''.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
621
497
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
622 Para comenzar la búsqueda, es indispensable ejecutar la orden
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
623 \hgcmdargs{bisect}{--reset}.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
624 \interaction{bisect.search.init}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
625
497
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
626 En nuestro caso, la prueba binaria es sencilla: revisamos si el
499
f89ee6f63ea2 Archivo to Fichero and update Leame.1st
Igor TAmara <igor@tamarapatino.org>
parents: 497
diff changeset
627 fichero en el repositorio contiene la cadena ``tengo un gub''. Si la
497
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
628 tiene, este conjunto de cambios contiene aquel que ``causó el fallo''.
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
629 Por convención, un conjunto de cambios que tiene la propiedad que
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
630 estamos buscando es ``malo'', mientras que el otro que no la tiene es
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
631 ``bueno''.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
632
497
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
633 En la mayoría de casos, la revisión del directorio actual (usualmente
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
634 la punta) exhibe el problema introducido por el cambio con el fallo,
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
635 por lo tanto la marcaremos como ``mala''.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
636 \interaction{bisect.search.bad-init}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
637
497
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
638 Nuestra próxima tarea es nominar al conjunto de cambios que sabemos
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
639 \emph{no} tiene el fallo; la orden \hgcmd{bisect} ``acotará'' su
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
640 búsqueda entre el primer par de conjuntos de cambios buenos y malos.
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
641 En nuestro caso, sabemos que la revisión~10 no tenía el fallo. (Más
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
642 adelante diré un poco más acerca de la elección del conjunto de
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
643 cambios ``bueno''.)
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
644 \interaction{bisect.search.good-init}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
645
497
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
646 Note que esta orden mostró algo.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
647 \begin{itemize}
497
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
648 \item Nos dijo cuántos conjuntos de cambios debe considerar antes de
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
649 que pueda identifica aquel que introdujo el fallo, y cuántas pruebas
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
650 se requerirán.
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
651 \item Actualizó el directorio de trabajo al siguiente conjunto de
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
652 cambios, y nos dijo qué conjunto de cambios está evaluando.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
653 \end{itemize}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
654
497
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
655 Ahora ejecutamos nuestra prueba en el directorio de trabajo. Usamos la
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
656 orden \command{grep} para ver si nuestro fichero ``malo'' está
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
657 presente en el directorio de trabajo. Si lo está, esta revisión es
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
658 mala; si no esta revisión es buena.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
659 \interaction{bisect.search.step1}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
660
497
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
661 Esta prueba luce como candidata perfecta para automatizarse, por lo
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
662 tanto la convertimos en una función de interfaz de comandos.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
663 \interaction{bisect.search.mytest}
497
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
664 Ahora podemos ejecutar un paso entero de pruebas con un solo comando,
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
665 \texttt{mytest}.
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
666 \interaction{bisect.search.step2}
497
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
667 Unas invocaciones más de nuestra prueba, y hemos terminado.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
668 \interaction{bisect.search.rest}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
669
497
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
670 Aunque teníamos unos~40 conjuntos de cambios en los cuales buscar, la
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
671 orden \hgcmd{bisect} nos permitió encontrar el conjunto de cambios que
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
672 introdujo el ``fallo'' con sólo cinco pruebas. Porque el número de
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
673 pruebas que la orden \hgcmd{bisect} ejecuta crece logarítmicamente con
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
674 la cantidad de conjuntos de cambios a buscar, la ventaja que esto
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
675 tiene frente a la búsqueda por``fuerza bruta'' crece con cada
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
676 conjunto de cambios que usted adicione.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
677
497
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
678 \subsection{Limpieza después de la búsqueda}
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
679
497
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
680 Cuando haya terminado de usar la orden \hgcmd{bisect} en un
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
681 repositorio, puede usar la orden \hgcmdargs{bisect}{reset} para
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
682 deshacerse de la información que se estaba usando para lograr la
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
683 búsqueda. Lar orden no usa mucho espacio, así que no hay problema si
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
684 olvida ejecutar la orden. En todo caso, \hgcmd{bisect} no le
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
685 permitirá comenzar una nueva búsqueda sobre el repositorio hasta que
c368e324eeb2 Finished translating bisect
Igor TAmara <igor@tamarapatino.org>
parents: 496
diff changeset
686 no aplique \hgcmdargs{bisect}{reset}.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
687 \interaction{bisect.search.reset}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
688
500
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
689 \section{Consejos para encontrar fallos efectivamente}
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
690
500
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
691 \subsection{Dar una entrada consistente}
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
692
500
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
693 La orden \hgcmd{bisect} requiere que usted ofrezca un reporte correcto
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
694 del resultado de cada prueba que aplique. Si usted le dice que una
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
695 prueba falla cuando en realidad era acertada, \emph{podría} detectar
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
696 la inconsistencia. Si puede identificar una inconsistencia en sus
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
697 reportes, le dirá que un conjunto de cambios particular es a la vez
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
698 bueno y malo. Aunque puede no hacerlo; estaría tratando de reportar
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
699 un conjunto de cambios como el responsable de un fallo aunque no lo
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
700 sea.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
701
500
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
702 \subsection{Automatizar tanto como se pueda}
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
703
500
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
704 Cuando comencé a usar la orden \hgcmd{bisect}, intenté ejecutar
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
705 algunas veces las pruebas a mano desde la línea de comandos. Es una
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
706 aproximación a la cual no esta acostumbrado. Después de algunos
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
707 intentos, me di cuenta que estaba cometiendo tantas equivocaciones que
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
708 tenía que comenzar de nuevo con mis búsquedas varias veces antes de
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
709 llegar a los resultados deseados.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
710
500
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
711 Mi problema inicial al dirigir a la orden \hgcmd{bisect} manualmente
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
712 ocurrieron incluso con búsquedas en repositorios pequeños; si el
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
713 problema que está buscando es más sutil, o el número de pruebas que
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
714 \hgcmd{bisect} debe aplicar, la posibilidad de errar es mucho más
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
715 alta. Una vez que comencé a automatizar mis pruebas, obtuve mejores
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
716 resultados.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
717
500
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
718 La clave para las pruebas automatizadas se puede resumir en:
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
719 \begin{itemize}
500
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
720 \item pruebe siempre buscando el mismo síntoma y
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
721 \item ofrezca siempre datos consistentes a la orden \hgcmd{bisect}.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
722 \end{itemize}
500
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
723 En mi tutorial de ejemplo anterior, la orden \command{grep} busca el
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
724 síntoma, y la construcción \texttt{if} toma el resultado de esta
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
725 prueba y verifica que siempre alimentamos con los mismos datos a la
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
726 orden \hgcmd{bisect}. La función \texttt{mytest} los une de una forma
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
727 reproducible, logrando que cada prueba sea uniforme y consistente.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
728
500
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
729 \subsection{Verificar los resultados}
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
730
500
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
731 Dado que la salida de la búsqueda de \hgcmd{bisect} es tan buena como
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
732 los datos ofrecidos por usted, no confíe en esto como si fuera la
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
733 verdad absoluta. Una forma sencilla de asegurarse es ejecutar
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
734 manualmente su prueba a cada uno de los siguientes conjuntos de
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
735 cambios:
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
736 \begin{itemize}
500
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
737 \item El conjunto de cambios que se reportó como la primera versión
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
738 erronea. Su prueba debería dar un reporte de fallo.
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
739 \item El conjunto de cambios padre (cada padre, si es una fusión).
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
740 Su prueba debería reportar este(os) conjunto(s) de cambios como
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
741 bueno(s).
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
742 \item Un hijo del conjunto de cambios. Su prueba debería reportar al
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
743 conjunto de cambios hijo como malo.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
744 \end{itemize}
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
745
500
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
746 \subsection{Tener en cuenta la interferencia entre fallos}
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
747
500
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
748 Es posible que su búsqueda de un fallo pueda viciarse por la presencia
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
749 de otro. Por ejemplo, digamos que su programa se revienta en la
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
750 revisión 100, y que funcionó correctamente en la revisión 50. Sin su
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
751 conocimiento, alguien introdujo un fallo con consecuencias grandes en
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
752 la revisión 60, y lo arregló en la revisión 80. Sus resultados
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
753 estarían distorcionados de una o muchas formas.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
754
500
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
755 Es posible que este fallo ``enmascare'' completamente al suyo, y que
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
756 podría haberse revelado antes de que su propio fallo haya tenido
619
bbc5db74bd77 changed many "X(" for "X ("
Javier Rojas <jerojasro@devnull.li>
parents: 617
diff changeset
757 oportunidad de manifestarse. Si no puede saltar el otro fallo (por
500
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
758 ejemplo, este evita que su proyecto se arme o compile), y de esta
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
759 forma no se pueda revisar si su fallo esté presente en un conjunto
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
760 particular de cambios, la orden \hgcmd{bisect} no podrá ayudarle
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
761 directamente. En cambio, puede marcar este conjunto de cambios como
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
762 al ejecutar \hgcmdargs{bisect}{--skip}.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
763
500
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
764 Un problema distinto podría surgir si su prueba de la presencia de un
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
765 fallo no es suficientemente específica. Si usted busca ``mi programa
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
766 se revienta'', entonces tanto su fallo como el otro fallo sin relación
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
767 que terminan presentando síntomas distintos, podría terminar
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
768 confundiendo a \hgcmd{bisect}.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
769
500
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
770 Otra situación en la cual sería de mucha utilidad emplear a
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
771 \hgcmdargs{bisect}{--skip} surge cuando usted no puede probar una
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
772 revisión porque su proyecto estaba en una situación de rompimiento y
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
773 por lo tanto en un estado en el cual era imposible hacer la prueba en
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
774 esa revisión, tal vez porque alguien consignó un cambio que hacía
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
775 imposible la construcción del proyecto.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
776
500
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
777 \subsection{Acotar la búsqueda perezosamente}
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
778
500
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
779 Elegir los primeros ``buenos'' y ``malos'' conjuntos de cambios que
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
780 marcarán los límites de su búsqueda en general es sencillo, pero vale
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
781 la pena discutirlo. Desde la perspectiva de \hgcmd{bisect}, el
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
782 conjunto de cambios ``más nuevo'' por convención es el ``malo'', y el
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
783 otro conjunto de cambios es el ``bueno''.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
784
500
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
785 Si no recuerda cuál podría ser el cambio ``bueno'', para informar a
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
786 \hgcmd{bisect}, podría hacer pruebas aleatorias en el peor de los
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
787 casos. Pero recuerde eliminar aquellos conjuntos de cambios que
619
bbc5db74bd77 changed many "X(" for "X ("
Javier Rojas <jerojasro@devnull.li>
parents: 617
diff changeset
788 podrían no exhibir el fallo (tal vez porque la característica donde se
500
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
789 presenta el fallo todavía no está presente) y aquellos en los cuales
619
bbc5db74bd77 changed many "X(" for "X ("
Javier Rojas <jerojasro@devnull.li>
parents: 617
diff changeset
790 otro fallo puede enmascararlo (como se discutió anteriormente).
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
791
500
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
792 Incluso si termina ``muy atrás'' por miles de conjuntos de cambios o
615
9da096de3c52 changed "historia" to "historial".
Javier Rojas <jerojasro@devnull.li>
parents: 557
diff changeset
793 meses de historial, solamente estaŕa adicionando unas pruebas contadas
500
3e78daaad99b Finished undo chapter
Igor TAmara <igor@tamarapatino.org>
parents: 499
diff changeset
794 para \hgcmd{bisect}, gracias al comportamiento logarítmico.
442
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
795
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
796 %%% Local Variables:
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
797 %%% mode: latex
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
798 %%% TeX-master: "00book"
2fb78d342e07 changed es/Leame.1st
jerojasro@localhost
parents: 432
diff changeset
799 %%% End: