annotate es/tour-merge.tex @ 490:53b4a0d0052e

finished translation of section 2.2
author Javier Rojas <jerojasro@devnull.li>
date Sun, 02 Nov 2008 21:34:16 -0500
parents c3a867bba34a
children 4fa646914ff8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
480
7ca1186c422f testing push
Javier Rojas <jerojasro@devnull.li>
parents: 435
diff changeset
1 \chapter{Una gira de Mercurial: fusionar trabajo}
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
2 \label{chap:tour-merge}
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
3
482
772b30049b80 translated a couple of paragraphs
Javier Rojas <jerojasro@devnull.li>
parents: 480
diff changeset
4 Hasta ahora hemos cubierto cómo clonar un repositorio, hacer cambios,
772b30049b80 translated a couple of paragraphs
Javier Rojas <jerojasro@devnull.li>
parents: 480
diff changeset
5 y jalar o empujar dichos cambios de un repositorio a otro. Nuestro
772b30049b80 translated a couple of paragraphs
Javier Rojas <jerojasro@devnull.li>
parents: 480
diff changeset
6 siguiente paso es \emph{fusionar} cambios de repositorios separados.
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
7
482
772b30049b80 translated a couple of paragraphs
Javier Rojas <jerojasro@devnull.li>
parents: 480
diff changeset
8 % TODO cambié streams por líneas. check please
772b30049b80 translated a couple of paragraphs
Javier Rojas <jerojasro@devnull.li>
parents: 480
diff changeset
9 \section{Fusionar líneas de trabajo}
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
10
482
772b30049b80 translated a couple of paragraphs
Javier Rojas <jerojasro@devnull.li>
parents: 480
diff changeset
11 Fusionar es una parte fundamental de trabajar con una herramienta
772b30049b80 translated a couple of paragraphs
Javier Rojas <jerojasro@devnull.li>
parents: 480
diff changeset
12 de control distribuido de versiones.
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
13 \begin{itemize}
482
772b30049b80 translated a couple of paragraphs
Javier Rojas <jerojasro@devnull.li>
parents: 480
diff changeset
14 \item Alicia y Roberto tienen cada uno una copia personal del
772b30049b80 translated a couple of paragraphs
Javier Rojas <jerojasro@devnull.li>
parents: 480
diff changeset
15 repositorio de un proyecto en el que están trabajando. Alicia
772b30049b80 translated a couple of paragraphs
Javier Rojas <jerojasro@devnull.li>
parents: 480
diff changeset
16 arregla un fallo en su repositorio; Roberto añade una nueva
772b30049b80 translated a couple of paragraphs
Javier Rojas <jerojasro@devnull.li>
parents: 480
diff changeset
17 característica en el suyo. Ambos desean que el repositorio
772b30049b80 translated a couple of paragraphs
Javier Rojas <jerojasro@devnull.li>
parents: 480
diff changeset
18 compartido contenga el arreglo del fallo y la nueva
772b30049b80 translated a couple of paragraphs
Javier Rojas <jerojasro@devnull.li>
parents: 480
diff changeset
19 característica.
772b30049b80 translated a couple of paragraphs
Javier Rojas <jerojasro@devnull.li>
parents: 480
diff changeset
20 \item Frecuentemente trabajo en varias tareas diferentes en un mismo
772b30049b80 translated a couple of paragraphs
Javier Rojas <jerojasro@devnull.li>
parents: 480
diff changeset
21 proyecto al mismo tiempo, cada una aislada convenientemente de las
772b30049b80 translated a couple of paragraphs
Javier Rojas <jerojasro@devnull.li>
parents: 480
diff changeset
22 otras en su propio repositorio. Trabajar de esta manera significa
772b30049b80 translated a couple of paragraphs
Javier Rojas <jerojasro@devnull.li>
parents: 480
diff changeset
23 que a menudo debo fusionar una parte de mi propio trabajo con
772b30049b80 translated a couple of paragraphs
Javier Rojas <jerojasro@devnull.li>
parents: 480
diff changeset
24 otra.
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
25 \end{itemize}
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
26
482
772b30049b80 translated a couple of paragraphs
Javier Rojas <jerojasro@devnull.li>
parents: 480
diff changeset
27 Como fusionar es una operación tan necesaria y común, Mercurial la
772b30049b80 translated a couple of paragraphs
Javier Rojas <jerojasro@devnull.li>
parents: 480
diff changeset
28 facilita. Revisemos el proceso. Empezaremos clonando (otro)
772b30049b80 translated a couple of paragraphs
Javier Rojas <jerojasro@devnull.li>
parents: 480
diff changeset
29 % TODO poner interrogante de apertura
772b30049b80 translated a couple of paragraphs
Javier Rojas <jerojasro@devnull.li>
parents: 480
diff changeset
30 repositorio (ve lo seguido que aparecen?) y haciendo un cambio en él.
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
31 \interaction{tour.merge.clone}
482
772b30049b80 translated a couple of paragraphs
Javier Rojas <jerojasro@devnull.li>
parents: 480
diff changeset
32 Ahora deberíamos tener dos copias de \filename{hello.c} con contenidos
772b30049b80 translated a couple of paragraphs
Javier Rojas <jerojasro@devnull.li>
parents: 480
diff changeset
33 diferentes. El historial de los dos repositorios diverge ahora, como
772b30049b80 translated a couple of paragraphs
Javier Rojas <jerojasro@devnull.li>
parents: 480
diff changeset
34 se ilustra en la figura~\ref{fig:tour-merge:sep-repos}.
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
35 \interaction{tour.merge.cat}
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
36
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
37 \begin{figure}[ht]
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
38 \centering
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
39 \grafix{tour-merge-sep-repos}
482
772b30049b80 translated a couple of paragraphs
Javier Rojas <jerojasro@devnull.li>
parents: 480
diff changeset
40 \caption{Historial reciente divergente de los repositorios
772b30049b80 translated a couple of paragraphs
Javier Rojas <jerojasro@devnull.li>
parents: 480
diff changeset
41 \dirname{my-hello} y \dirname{my-new-hello}}
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
42 \label{fig:tour-merge:sep-repos}
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
43 \end{figure}
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
44
482
772b30049b80 translated a couple of paragraphs
Javier Rojas <jerojasro@devnull.li>
parents: 480
diff changeset
45 Ya sabemos que jalar los cambios desde nuestro repositorio
772b30049b80 translated a couple of paragraphs
Javier Rojas <jerojasro@devnull.li>
parents: 480
diff changeset
46 \dirname{my-hello} no tendrá efecto en el directorio de trabajo.
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
47 \interaction{tour.merge.pull}
483
7f1572c365d2 translated up to section 2.1.1, included
Javier Rojas <jerojasro@devnull.li>
parents: 482
diff changeset
48 Sin embargo, el comando \hgcmd{pull} dice algo acerca de
7f1572c365d2 translated up to section 2.1.1, included
Javier Rojas <jerojasro@devnull.li>
parents: 482
diff changeset
49 ``frentes''\ndt{El autor se refiere a \emph{heads} aquí.}.
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
50
483
7f1572c365d2 translated up to section 2.1.1, included
Javier Rojas <jerojasro@devnull.li>
parents: 482
diff changeset
51 \subsection{Conjuntos de cambios de frentes}
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
52
483
7f1572c365d2 translated up to section 2.1.1, included
Javier Rojas <jerojasro@devnull.li>
parents: 482
diff changeset
53 Un frente es un cambio que no tiene descendientes, o hijos, como
7f1572c365d2 translated up to section 2.1.1, included
Javier Rojas <jerojasro@devnull.li>
parents: 482
diff changeset
54 también se les conoce. La revisión de punta es, por tanto, un frente,
7f1572c365d2 translated up to section 2.1.1, included
Javier Rojas <jerojasro@devnull.li>
parents: 482
diff changeset
55 porque la revisión más reciente en un repositorio no tiene ningún
7f1572c365d2 translated up to section 2.1.1, included
Javier Rojas <jerojasro@devnull.li>
parents: 482
diff changeset
56 % TODO cambio en la redacción de la frase, pero espero que conserve el
7f1572c365d2 translated up to section 2.1.1, included
Javier Rojas <jerojasro@devnull.li>
parents: 482
diff changeset
57 % sentido. Querido human@, apruebe o corrija :D
7f1572c365d2 translated up to section 2.1.1, included
Javier Rojas <jerojasro@devnull.li>
parents: 482
diff changeset
58 hijo. Sin embargo, un repositorio puede contener más de un frente.
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
59
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
60 \begin{figure}[ht]
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
61 \centering
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
62 \grafix{tour-merge-pull}
483
7f1572c365d2 translated up to section 2.1.1, included
Javier Rojas <jerojasro@devnull.li>
parents: 482
diff changeset
63 \caption{Contenidos del repositorio después de jalar
7f1572c365d2 translated up to section 2.1.1, included
Javier Rojas <jerojasro@devnull.li>
parents: 482
diff changeset
64 \dirname{my-hello} a \dirname{my-new-hello}}
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
65 \label{fig:tour-merge:pull}
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
66 \end{figure}
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
67
483
7f1572c365d2 translated up to section 2.1.1, included
Javier Rojas <jerojasro@devnull.li>
parents: 482
diff changeset
68 En la figura~\ref{fig:tour-merge:pull} usted puede ver el efecto que
7f1572c365d2 translated up to section 2.1.1, included
Javier Rojas <jerojasro@devnull.li>
parents: 482
diff changeset
69 tiene jalar los cambios de \dirname{my-hello} a \dirname{my-new-hello}.
7f1572c365d2 translated up to section 2.1.1, included
Javier Rojas <jerojasro@devnull.li>
parents: 482
diff changeset
70 El historial que ya existía en \dirname{my-new-hello} se mantiene
7f1572c365d2 translated up to section 2.1.1, included
Javier Rojas <jerojasro@devnull.li>
parents: 482
diff changeset
71 intacto, pero fue añadida una nueva revisión. Refiriéndonos a la
7f1572c365d2 translated up to section 2.1.1, included
Javier Rojas <jerojasro@devnull.li>
parents: 482
diff changeset
72 figura~\ref{fig:tour-merge:sep-repos}, podemos ver que el \emph{ID del
7f1572c365d2 translated up to section 2.1.1, included
Javier Rojas <jerojasro@devnull.li>
parents: 482
diff changeset
73 conjunto de cambios} se mantiene igual en el nuevo repositorio, pero
7f1572c365d2 translated up to section 2.1.1, included
Javier Rojas <jerojasro@devnull.li>
parents: 482
diff changeset
74 el \emph{número de revisión} ha cambiado. (Incidentalmente, éste es un
7f1572c365d2 translated up to section 2.1.1, included
Javier Rojas <jerojasro@devnull.li>
parents: 482
diff changeset
75 buen ejemplo de porqué no es seguro usar números de revisión cuando se
7f1572c365d2 translated up to section 2.1.1, included
Javier Rojas <jerojasro@devnull.li>
parents: 482
diff changeset
76 habla de conjuntos de cambios). Podemos ver los frentes en un
7f1572c365d2 translated up to section 2.1.1, included
Javier Rojas <jerojasro@devnull.li>
parents: 482
diff changeset
77 repositorio usando el comando \hgcmd{heads}\ndt{Frentes.}.
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
78 \interaction{tour.merge.heads}
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
79
484
0abd3d78172e finished translation of a figure
Javier Rojas <jerojasro@devnull.li>
parents: 483
diff changeset
80 \subsection{Hacer la fusión}
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
81
484
0abd3d78172e finished translation of a figure
Javier Rojas <jerojasro@devnull.li>
parents: 483
diff changeset
82 % TODO poner interrogante de apertura
0abd3d78172e finished translation of a figure
Javier Rojas <jerojasro@devnull.li>
parents: 483
diff changeset
83 Qué pasa si tratamos de usar el comando usual, \hgcmd{update}, para
0abd3d78172e finished translation of a figure
Javier Rojas <jerojasro@devnull.li>
parents: 483
diff changeset
84 actualizar el nuevo frente?
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
85 \interaction{tour.merge.update}
484
0abd3d78172e finished translation of a figure
Javier Rojas <jerojasro@devnull.li>
parents: 483
diff changeset
86 Mercurial nos indica que el comando \hgcmd{update} no hará la fusión;
0abd3d78172e finished translation of a figure
Javier Rojas <jerojasro@devnull.li>
parents: 483
diff changeset
87 no actualizará el directorio de trabajo cuando considera que lo que
0abd3d78172e finished translation of a figure
Javier Rojas <jerojasro@devnull.li>
parents: 483
diff changeset
88 deseamos hacer es una fusión, a menos que lo obliguemos a hacerlo.
0abd3d78172e finished translation of a figure
Javier Rojas <jerojasro@devnull.li>
parents: 483
diff changeset
89 En vez de \hgcmd{update}, usamos el comando \hgcmd{merge} para hacer
0abd3d78172e finished translation of a figure
Javier Rojas <jerojasro@devnull.li>
parents: 483
diff changeset
90 la fusión entre los dos frentes.
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
91 \interaction{tour.merge.merge}
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
92
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
93 \begin{figure}[ht]
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
94 \centering
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
95 \grafix{tour-merge-merge}
484
0abd3d78172e finished translation of a figure
Javier Rojas <jerojasro@devnull.li>
parents: 483
diff changeset
96 \caption{Directorio de trabajo y repositorio durante la fusión, y
0abd3d78172e finished translation of a figure
Javier Rojas <jerojasro@devnull.li>
parents: 483
diff changeset
97 consignación consecuente}
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
98 \label{fig:tour-merge:merge}
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
99 \end{figure}
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
100
484
0abd3d78172e finished translation of a figure
Javier Rojas <jerojasro@devnull.li>
parents: 483
diff changeset
101 Esto actualiza el directorio de trabajo, de tal forma que contenga los
0abd3d78172e finished translation of a figure
Javier Rojas <jerojasro@devnull.li>
parents: 483
diff changeset
102 cambios de \emph{ambos} frentes, lo que se ve reflejado tanto en la
0abd3d78172e finished translation of a figure
Javier Rojas <jerojasro@devnull.li>
parents: 483
diff changeset
103 salida de \hgcmd{parents} como en los contenidos de \filename{hello.c}.
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
104 \interaction{tour.merge.parents}
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
105
484
0abd3d78172e finished translation of a figure
Javier Rojas <jerojasro@devnull.li>
parents: 483
diff changeset
106 \subsection{Consignar los resultados de la fusión}
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
107
489
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
108 Siempre que hacemos una fusión, \hgcmd{parents} mostrará dos padres
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
109 hasta que consignemos (\hgcmd{commit}) los resultados de la fusión.
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
110 \interaction{tour.merge.commit}
489
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
111 Ahora tenemos una nueva revisión de punta; note que tiene \emph{los
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
112 dos} frentes anteriores como sus padres. Estos son las mismas
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
113 revisiones que mostró previamente el comando \hgcmd{parents}.
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
114 \interaction{tour.merge.tip}
489
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
115 En la figura~\ref{fig:tour-merge:merge} usted puede apreciar una
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
116 representación de lo que pasa en el directorio de trabajo durante la
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
117 fusión cuando se hace la consignación. Durante la fusión, el
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
118 directorio de trabajo tiene dos conjuntos de cambios como sus padres,
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
119 y éstos se vuelven los padres del nuevo conjunto de cambios.
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
120
489
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
121 \section{Fusionar cambios con conflictos}
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
122
489
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
123 La mayoría de las fusiones son algo simple, pero a veces usted se
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
124 encontrará fusionando cambios donde más de uno de ellos afecta las
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
125 mismas secciones de los mismos ficheros. A menos que ambas
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
126 modificaciones sean idénticas, el resultado es un \emph{conflicto}, en
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
127 donde usted debe decidir cómo reconciliar ambos cambios y producir un
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
128 resultado coherente.
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
129
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
130 \begin{figure}[ht]
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
131 \centering
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
132 \grafix{tour-merge-conflict}
489
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
133 \caption{Cambios con conflictos a un documento}
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
134 \label{fig:tour-merge:conflict}
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
135 \end{figure}
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
136
489
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
137 La figura~\ref{fig:tour-merge:conflict} ilustra un ejemplo con dos
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
138 cambios generando conflictos en un documento. Empezamos con una sola
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
139 versión de el fichero; luego hicimos algunos cambios; mientras tanto,
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
140 alguien más hizo cambios diferentes en el mismo texto. Lo que debemos
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
141 hacer para resolver el conflicto causado por ambos cambios es decidir
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
142 cómo debe quedar finalmente el fichero.
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
143
489
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
144 Mercurial no tiene ninguna utilidad integrada para manejar conflictos.
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
145 En vez de eso, ejecuta un programa externo llamado \command{hgmerge}.
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
146 Es un guión de línea de comandos que es instalado junto con Mercurial;
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
147 usted puede modificarlo para que se comporte como usted lo desee. Por
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
148 defecto, lo que hace es tratar de encontrar una de varias herramientas
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
149 para fusionar que es probable que estén instaladas en su sistema.
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
150 Primero se intenta con unas herramientas para fusionar cambios
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
151 automáticamente; si esto no tiene éxito (porque la fusión demanda
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
152 una guía humana) o dichas herramientas no están presentes, el guión
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
153 intenta con herramientas gráficas para fusionar.
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
154
489
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
155 También es posible hacer que Mercurial ejecute otro programa o guión
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
156 en vez de \command{hgmerge}, definiendo la variable de entorno
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
157 \envar{HGMERGE} con el nombre del programa de su preferencia.
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
158
489
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
159 \subsection{Usar una herramienta gráfica para fusión}
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
160
489
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
161 Mi herramienta favorita para hacer fusiones es \command{kdiff3}, y la
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
162 usaré para describir las características comunes de las herramientas
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
163 gráficas para hacer fusiones. Puede ver una captura de pantalla de
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
164 \command{kdiff3} ejecutándose, en la
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
165 figura~\ref{fig:tour-merge:kdiff3}. El tipo de fusión que la
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
166 herramienta hace se conoce como \emph{fusión de tres vías}, porque hay
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
167 tres versiones diferentes del archivo en que estamos interesados.
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
168 Debido a esto la herramienta divide la parte superior de la ventana en
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
169 tres paneles.
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
170 \begin{itemize}
489
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
171 \item A la izquierda está la revisión \emph{base} del fichero, p.ej.~la
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
172 versión más reciente de la que descienden las dos versiones que
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
173 estamos tratando de fusionar.
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
174 \item En la mitad está ``nuestra'' versión del fichero, con las
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
175 modificaciones que hemos hecho.
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
176 \item A la derecha está la versión del fichero de ``ellos'', la que
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
177 forma parte del conjunto de cambios que estamos tratando de
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
178 fusionar.
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
179 \end{itemize}
489
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
180 En el panel inferior se encuentra el \emph{resultado} actual de la
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
181 fusión. Nuestra tarea es reemplazar todo el texto rojo, que muestra
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
182 los conflictos sin resolver, con una fusión adecuada de ``nuestra''
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
183 versión del fichero y la de ``ellos''.
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
184
489
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
185 Los cuatro paneles están \emph{enlazados}; si avanzamos vertical o
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
186 horizontalmente en cualquiera de ellos, los otros son actualizados
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
187 para mostrar las secciones correspondientes del fichero que tengan
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
188 asociado.
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
189
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
190 \begin{figure}[ht]
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
191 \centering
489
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
192 \grafix[width=\textwidth]{kdiff3}
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
193 \caption{Usando \command{kdiff3} para fusionar versiones de un
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
194 fichero}
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
195 \label{fig:tour-merge:kdiff3}
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
196 \end{figure}
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
197
489
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
198 En cada conflicto del fichero podemos escoger resolverlo usando
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
199 cualquier combinación del texto de la revisión base, la nuestra, o la
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
200 de ellos. También podemos editar manualmente el fichero en que queda
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
201 la fusión, si es necesario hacer cambios adicionales.
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
202
489
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
203 Hay \emph{muchas} herramientas para fusionar ficheros disponibles. Se
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
204 diferencian en las plataformas para las que están disponibles, y en
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
205 sus fortalezas y debilidades particulares. La mayoría están afinadas
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
206 para fusionar texto plano, mientras que otras están pensadas para
c3a867bba34a modified definitions to allow optional arguments for the inclusion of images.
Javier Rojas <jerojasro@devnull.li>
parents: 484
diff changeset
207 formatos de archivos especializados (generalmente XML).
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
208
490
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
209 % TODO traduje "worked" como "real"
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
210 \subsection{Un ejemplo real}
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
211
490
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
212 En este ejemplo, reproduciremos el historial de modificaciones al
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
213 fichero de la figura~\ref{fig:tour-merge:conflict} mostrada
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
214 anteriormente. Empecemos creando un repositorio con la versión base
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
215 de nuestro documento.
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
216 \interaction{tour-merge-conflict.wife}
490
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
217 Clonaremos el repositorio y haremos un cambio al fichero.
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
218 \interaction{tour-merge-conflict.cousin}
490
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
219 Y haremos otro clon, para simular a alguien más haciendo un cambio al
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
220 mismo fichero. (Esto introduce la idea de que no es tan inusual hacer
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
221 fusiones consigo mismo, cuando usted aísla tareas en repositorios
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
222 separados, y de hecho encuentra conflictos al hacerlo.)
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
223 \interaction{tour-merge-conflict.son}
490
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
224 Ahora que tenemos dos versiones diferentes de nuestro fichero,
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
225 crearemos un entorno adecuado para hacer la fusión.
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
226 \interaction{tour-merge-conflict.pull}
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
227
490
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
228 En este ejemplo, no usaré el comando normal de Mercurial para hacer la
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
229 fusión (\command{hgmerge}), porque lanzaría mi linda herramienta
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
230 automatizada para correr ejemplos dentro de una interfaz gráfica de
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
231 usuario. En vez de eso, definiré la variable de entorno
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
232 \envar{HGMERGE} para indicarle a Mercurial que use el comando
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
233 \command{merge}. Este comando forma parte de la instalación base de
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
234 muchos sistemas Unix y similares. Si usted está ejecutando este
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
235 ejemplo en su computador, no se moleste en definir \envar{HGMERGE}.
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
236 \interaction{tour-merge-conflict.merge}
490
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
237 Debido a que \command{merge} no puede resolver los conflictos que
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
238 aparecen, él deja \emph{marcadores de fusión} en el fichero con
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
239 conflictos, indicando si provienen de nuestra versión o de la de
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
240 ellos.
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
241
490
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
242 Mercurial puede saber ---por el código de salida del comando
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
243 \command{merge}--- que no fue posible hacer la fusión exitosamente,
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
244 así que nos indica qué comandos debemos ejecutar si queremos rehacer
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
245 la fusión. Esto puede ser útil si, por ejemplo, estamos ejecutando una
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
246 herramienta gráfica de fusión y salimos de ella porque nos confundimos
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
247 o cometimos un error.
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
248
490
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
249 Si la fusión ---automática o manual--- falla, no hay nada que nos
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
250 impida ``arreglar'' los ficheros afectados por nosotros mismos, y
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
251 consignar los resultados de nuestra fusión:
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
252 % TODO este mercurial no tiene el comando resolve. Revisar si sigue
53b4a0d0052e finished translation of section 2.2
Javier Rojas <jerojasro@devnull.li>
parents: 489
diff changeset
253 % siendo necesario
435
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
254 \interaction{tour-merge-conflict.commit}
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
255
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
256 \section{Simplifying the pull-merge-commit sequence}
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
257 \label{sec:tour-merge:fetch}
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
258
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
259 The process of merging changes as outlined above is straightforward,
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
260 but requires running three commands in sequence.
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
261 \begin{codesample2}
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
262 hg pull
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
263 hg merge
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
264 hg commit -m 'Merged remote changes'
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
265 \end{codesample2}
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
266 In the case of the final commit, you also need to enter a commit
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
267 message, which is almost always going to be a piece of uninteresting
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
268 ``boilerplate'' text.
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
269
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
270 It would be nice to reduce the number of steps needed, if this were
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
271 possible. Indeed, Mercurial is distributed with an extension called
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
272 \hgext{fetch} that does just this.
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
273
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
274 Mercurial provides a flexible extension mechanism that lets people
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
275 extend its functionality, while keeping the core of Mercurial small
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
276 and easy to deal with. Some extensions add new commands that you can
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
277 use from the command line, while others work ``behind the scenes,''
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
278 for example adding capabilities to the server.
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
279
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
280 The \hgext{fetch} extension adds a new command called, not
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
281 surprisingly, \hgcmd{fetch}. This extension acts as a combination of
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
282 \hgcmd{pull}, \hgcmd{update} and \hgcmd{merge}. It begins by pulling
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
283 changes from another repository into the current repository. If it
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
284 finds that the changes added a new head to the repository, it begins a
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
285 merge, then commits the result of the merge with an
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
286 automatically-generated commit message. If no new heads were added,
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
287 it updates the working directory to the new tip changeset.
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
288
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
289 Enabling the \hgext{fetch} extension is easy. Edit your
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
290 \sfilename{.hgrc}, and either go to the \rcsection{extensions} section
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
291 or create an \rcsection{extensions} section. Then add a line that
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
292 simply reads ``\Verb+fetch +''.
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
293 \begin{codesample2}
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
294 [extensions]
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
295 fetch =
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
296 \end{codesample2}
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
297 (Normally, on the right-hand side of the ``\texttt{=}'' would appear
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
298 the location of the extension, but since the \hgext{fetch} extension
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
299 is in the standard distribution, Mercurial knows where to search for
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
300 it.)
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
301
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
302 %%% Local Variables:
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
303 %%% mode: latex
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
304 %%% TeX-master: "00book"
7e52f0cc4516 changed es/hgext.tex
jerojasro@localhost
parents: 432
diff changeset
305 %%% End: