annotate es/filenames.tex @ 530:f809de31887a

more translation :D added a term to the glossary
author jerojasro@localhost
date Sun, 30 Nov 2008 18:41:51 -0500
parents 3afc654d70e5
children 5da084395a69
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
501
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
1 \chapter{File names and pattern matching}
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
2 \label{chap:names}
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
3
529
3afc654d70e5 translated some paragraphs. yawn sleepy
jerojasro@localhost
parents: 501
diff changeset
4 Mercurial provee mecanismos que le permiten trabajar con nombres de
3afc654d70e5 translated some paragraphs. yawn sleepy
jerojasro@localhost
parents: 501
diff changeset
5 ficheros en una manera consistente y expresiva.
501
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
6
529
3afc654d70e5 translated some paragraphs. yawn sleepy
jerojasro@localhost
parents: 501
diff changeset
7 \section{Nombrado de ficheros simple}
501
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
8
529
3afc654d70e5 translated some paragraphs. yawn sleepy
jerojasro@localhost
parents: 501
diff changeset
9 % TODO traducción literal de "under the hood". revisar
3afc654d70e5 translated some paragraphs. yawn sleepy
jerojasro@localhost
parents: 501
diff changeset
10 Mercurial usa un mecanismo unificado ``bajo el capó'' para manejar
3afc654d70e5 translated some paragraphs. yawn sleepy
jerojasro@localhost
parents: 501
diff changeset
11 nombres de ficheros. Cada comando se comporta de manera uniforme con
3afc654d70e5 translated some paragraphs. yawn sleepy
jerojasro@localhost
parents: 501
diff changeset
12 respecto a los nombres de fichero. La manera en que los comandos
3afc654d70e5 translated some paragraphs. yawn sleepy
jerojasro@localhost
parents: 501
diff changeset
13 operan con nombres de fichero es la siguiente.
501
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
14
529
3afc654d70e5 translated some paragraphs. yawn sleepy
jerojasro@localhost
parents: 501
diff changeset
15 Si usted especifica explícitamente nombres reales de ficheros en la
3afc654d70e5 translated some paragraphs. yawn sleepy
jerojasro@localhost
parents: 501
diff changeset
16 línea de comandos, Mercurial opera únicamente sobre dichos ficheros,
3afc654d70e5 translated some paragraphs. yawn sleepy
jerojasro@localhost
parents: 501
diff changeset
17 como usted esperaría.
501
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
18 \interaction{filenames.files}
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
19
529
3afc654d70e5 translated some paragraphs. yawn sleepy
jerojasro@localhost
parents: 501
diff changeset
20 Cuando usted provee el nombre de un directorio, Mercurial interpreta
3afc654d70e5 translated some paragraphs. yawn sleepy
jerojasro@localhost
parents: 501
diff changeset
21 eso como ``opere en cada fichero en este directorio y sus
3afc654d70e5 translated some paragraphs. yawn sleepy
jerojasro@localhost
parents: 501
diff changeset
22 subdirectorios''. Mercurial va por todos los ficheros y subdirectorios
3afc654d70e5 translated some paragraphs. yawn sleepy
jerojasro@localhost
parents: 501
diff changeset
23 de un directorio en orden alfabético. Cuando encuentra un
3afc654d70e5 translated some paragraphs. yawn sleepy
jerojasro@localhost
parents: 501
diff changeset
24 subdirectorio, lo recorrerá antes de continuar con el directorio
3afc654d70e5 translated some paragraphs. yawn sleepy
jerojasro@localhost
parents: 501
diff changeset
25 actual.
501
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
26 \interaction{filenames.dirs}
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
27
529
3afc654d70e5 translated some paragraphs. yawn sleepy
jerojasro@localhost
parents: 501
diff changeset
28 \section{Ejecución de comandos sin ningún nombre de fichero}
501
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
29
529
3afc654d70e5 translated some paragraphs. yawn sleepy
jerojasro@localhost
parents: 501
diff changeset
30 Los comandos de Mercurial que trabajan con nombres de fichero tienen
3afc654d70e5 translated some paragraphs. yawn sleepy
jerojasro@localhost
parents: 501
diff changeset
31 comportamientos por defecto adecuados cuando son utilizados sin pasar
3afc654d70e5 translated some paragraphs. yawn sleepy
jerojasro@localhost
parents: 501
diff changeset
32 ningún patrón o nombre de fichero. El tipo de comportamiento depende
530
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
33 de lo que haga el comando. Aquí presento unas cuantas reglas generales
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
34 que usted puede usar para que es lo que probablemente hará un comando
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
35 si usted no le pasa ningún nombre de fichero con el cual trabajar.
501
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
36 \begin{itemize}
530
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
37 \item Muchos comandos operarán sobre el directorio de trabajo
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
38 completo. Por ejemplo, esto es lo que hace el comando
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
39 \hgcmd{add},
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
40 \item Si el comando tiene efectos difíciles o incluso imposibles de
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
41 revertir, se le obligará a usted a proveer explícitamente al menos
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
42 % TODO revisar ese "lo proteje a usted"
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
43 un nombre o patrón (ver más abajo). Esto lo proteje a usted de,
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
44 por ejemplo, borrar ficheros accidentalmente al ejecutar
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
45 \hgcmd{remove} sin ningún argumento.
501
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
46 \end{itemize}
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
47
530
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
48
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
49 Es fácil evitar este comportamiento por defecto, si no es el adecuado
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
50 para usted. Si un comando opera normalmente en todo el directorio de
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
51 trabajo, usted puede llamarlo para que trabaje sólo en el directorio
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
52 actual y sus subdirectorio pasándole el nombre ``\dirname{.}''.
501
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
53 \interaction{filenames.wdir-subdir}
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
54
530
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
55 Siguiendo la misma línea, algunos comandos normalmente imprimen las
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
56 rutas de ficheros con respecto a la raíz del repositorio, aún si usted
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
57 los llama dentro de un subdirectorio. Dichos comandos imprimirán las
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
58 rutas de los ficheros respecto al directorio en que usted se encuentra
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
59 si se les pasan nombres explícitos. Vamos a ejecutar el comando
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
60 \hgcmd{status} desde un subdirectorio, y a hacer que opere en el
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
61 directorio de trabajo completo, a la vez que todas las rutas de
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
62 ficheros se imprimen respecto a nuestro subdirectorio, pasándole la
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
63 salida del comando \hgcmd{root}.
501
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
64 \interaction{filenames.wdir-relname}
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
65
530
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
66 \section{Reportar que está pasando}
501
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
67
530
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
68 El ejemplo con el comando \hgcmd{add} en la sección anterior ilustra
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
69 algo más que es útil acerca de los comandos de Mercurial. Si un
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
70 comando opera en un fichero que usted no pasó explícitamente en la
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
71 línea de comandos, usualmente se imprimirá el nombre del fichero, para
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
72 que usted no sea sorprendido por lo que sucede.
501
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
73
530
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
74 Esto es el principio de \emph{mínima sorpresa}. Si usted se ha
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
75 referido explícitamente a un fichero en la línea de comandos, no tiene
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
76 mucho sentido repetir esto de vuelta a usted. Si Mercurial está
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
77 actuando en un fichero \emph{implícitamente}, porque usted no pasó
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
78 nombres, ni directorios, ni patrones (ver más abajo), lo más seguro es
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
79 decirle a usted qué se está haciendo.
501
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
80
530
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
81 Usted puede silenciar a los comandos que se comportan de esta manera
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
82 usando la opción \hggopt{-q}. También puede hacer que impriman el
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
83 nombre de cada fichero, aún aquellos que usted indicó explícitamente,
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
84 usando la opción \hggopt{-v}.
501
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
85
530
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
86 \section{Uso de patrones para identificar ficheros}
501
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
87
530
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
88 Además de trabajar con nombres de ficheros y directorios, Mercurial le
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
89 permite usar \emph{patrones} para identificar ficheros. El manejo de
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
90 patrones de Mercurial es expresivo.
501
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
91
530
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
92 En sistemas tipo Unix (Linux, MacOS, etc.), el trabajo de asociar
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
93 patrones con nombres de ficheros recae sobre el intérprete de comandos.
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
94 En estos sistemas, usted debe indicarle explícitamente a Mercurial que
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
95 el nombre que se le pasa es un patrón. En Windows, el intérprete no
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
96 expande los patrones, así que Mercurial identificará automáticamente
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
97 los nombres que son patrones, y hará la expansión necesaria.
501
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
98
530
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
99 Para pasar un patrón en vez de un nombre normal en la línea de
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
100 comandos, el mecanismo es simple:
501
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
101 \begin{codesample2}
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
102 syntax:patternbody
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
103 \end{codesample2}
530
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
104 Un patrón es identificado por una cadena de texto corta que indica qué
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
105 tipo de patrón es, seguido por un dos puntos, seguido por el patrón en
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
106 sí.
501
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
107
530
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
108 Mercurial soporta dos tipos de sintaxis para patrones. La que se usa
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
109 con más frecuencia se denomina \texttt{glob}\ndt{Grupo, colección,
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
110 aglomeración.}; es el mismo tipo de asociación de patrones usado por
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
111 el intérprete de Unix, y también debería ser familiar para los
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
112 usuarios de la línea de comandos de Windows.
501
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
113
530
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
114 Cuando Mercurial hace asociación automática de patrones en Windows,
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
115 usa la sintaxis \texttt{glob}. Por esto, usted puede omitir el
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
116 prefijo ``\texttt{glob:}'' en Windows, pero también es seguro usarlo.
501
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
117
530
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
118 La sintaxis \texttt{re}\ndt{Expresiones regulares.} es más poderosa;
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
119 le permite especificar patrones usando expresiones regulares, también
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
120 conocidas como regexps.
501
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
121
530
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
122 A propósito, en los ejemplos siguientes, por favor note que yo tengo
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
123 el cuidado de rodear todos mis patrones con comillas sencillas, para
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
124 que no sean expandidos por el intérprete antes de que Mercurial pueda
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
125 verlos.
501
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
126
530
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
127 \subsection{Patrones \texttt{glob} estilo intérprete}
501
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
128
530
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
129 Este es un vistazo general de los tipos de patrones que usted puede
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
130 usar cuando está usando asociación con patrone glob.
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
131
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
132 La secuencia ``\texttt{*}'' se asocia con cualquier cadena, dentro de
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
133 un único directorio.
501
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
134 \interaction{filenames.glob.star}
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
135
530
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
136 La secuencia ``\texttt{**}'' se asocia con cualquier cadena, y cruza los
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
137 % TODO token
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
138 límites de los directorios. No es una elemento estándar de los tokens
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
139 de glob de Unix, pero es aceptado por varios intérpretes Unix
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
140 populares, y es muy útil.
501
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
141 \interaction{filenames.glob.starstar}
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
142
530
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
143 La secuencia ``\texttt{?}'' se asocia con cualquier caracter sencillo.
501
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
144 \interaction{filenames.glob.question}
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
145
530
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
146 El caracter ``\texttt{[}'' marca el inicio de una \emph{clase de
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
147 caracteres}. Ella se asocia con cualquier caracter sencillo dentro de
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
148 la clase. La clase se finaliza con un caracter ``\texttt{]}''. Una
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
149 clase puede contener múltiples \emph{rango}s de la forma
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
150 ``\texttt{a-f}'', que en este caso es una abreviación para
501
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
151 ``\texttt{abcdef}''.
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
152 \interaction{filenames.glob.range}
530
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
153 Si el primer caracter en aparecer después de ``\texttt{[}'' en la
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
154 clase de caracteres es un ``\texttt{!}'', se \emph{niega} la clase,
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
155 haciendo que se asocie con cualquier caracter sencillo que no se
f809de31887a more translation :D
jerojasro@localhost
parents: 529
diff changeset
156 encuentre en la clase.
501
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
157
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
158 A ``\texttt{\{}'' begins a group of subpatterns, where the whole group
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
159 matches if any subpattern in the group matches. The ``\texttt{,}''
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
160 character separates subpatterns, and ``\texttt{\}}'' ends the group.
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
161 \interaction{filenames.glob.group}
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
162
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
163 \subsubsection{Watch out!}
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
164
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
165 Don't forget that if you want to match a pattern in any directory, you
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
166 should not be using the ``\texttt{*}'' match-any token, as this will
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
167 only match within one directory. Instead, use the ``\texttt{**}''
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
168 token. This small example illustrates the difference between the two.
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
169 \interaction{filenames.glob.star-starstar}
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
170
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
171 \subsection{Regular expression matching with \texttt{re} patterns}
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
172
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
173 Mercurial accepts the same regular expression syntax as the Python
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
174 programming language (it uses Python's regexp engine internally).
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
175 This is based on the Perl language's regexp syntax, which is the most
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
176 popular dialect in use (it's also used in Java, for example).
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
177
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
178 I won't discuss Mercurial's regexp dialect in any detail here, as
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
179 regexps are not often used. Perl-style regexps are in any case
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
180 already exhaustively documented on a multitude of web sites, and in
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
181 many books. Instead, I will focus here on a few things you should
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
182 know if you find yourself needing to use regexps with Mercurial.
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
183
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
184 A regexp is matched against an entire file name, relative to the root
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
185 of the repository. In other words, even if you're already in
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
186 subbdirectory \dirname{foo}, if you want to match files under this
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
187 directory, your pattern must start with ``\texttt{foo/}''.
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
188
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
189 One thing to note, if you're familiar with Perl-style regexps, is that
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
190 Mercurial's are \emph{rooted}. That is, a regexp starts matching
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
191 against the beginning of a string; it doesn't look for a match
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
192 anywhere within the string. To match anywhere in a string, start
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
193 your pattern with ``\texttt{.*}''.
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
194
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
195 \section{Filtering files}
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
196
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
197 Not only does Mercurial give you a variety of ways to specify files;
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
198 it lets you further winnow those files using \emph{filters}. Commands
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
199 that work with file names accept two filtering options.
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
200 \begin{itemize}
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
201 \item \hggopt{-I}, or \hggopt{--include}, lets you specify a pattern
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
202 that file names must match in order to be processed.
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
203 \item \hggopt{-X}, or \hggopt{--exclude}, gives you a way to
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
204 \emph{avoid} processing files, if they match this pattern.
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
205 \end{itemize}
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
206 You can provide multiple \hggopt{-I} and \hggopt{-X} options on the
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
207 command line, and intermix them as you please. Mercurial interprets
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
208 the patterns you provide using glob syntax by default (but you can use
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
209 regexps if you need to).
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
210
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
211 You can read a \hggopt{-I} filter as ``process only the files that
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
212 match this filter''.
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
213 \interaction{filenames.filter.include}
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
214 The \hggopt{-X} filter is best read as ``process only the files that
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
215 don't match this pattern''.
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
216 \interaction{filenames.filter.exclude}
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
217
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
218 \section{Ignoring unwanted files and directories}
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
219
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
220 XXX.
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
221
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
222 \section{Case sensitivity}
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
223 \label{sec:names:case}
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
224
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
225 If you're working in a mixed development environment that contains
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
226 both Linux (or other Unix) systems and Macs or Windows systems, you
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
227 should keep in the back of your mind the knowledge that they treat the
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
228 case (``N'' versus ``n'') of file names in incompatible ways. This is
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
229 not very likely to affect you, and it's easy to deal with if it does,
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
230 but it could surprise you if you don't know about it.
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
231
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
232 Operating systems and filesystems differ in the way they handle the
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
233 \emph{case} of characters in file and directory names. There are
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
234 three common ways to handle case in names.
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
235 \begin{itemize}
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
236 \item Completely case insensitive. Uppercase and lowercase versions
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
237 of a letter are treated as identical, both when creating a file and
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
238 during subsequent accesses. This is common on older DOS-based
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
239 systems.
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
240 \item Case preserving, but insensitive. When a file or directory is
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
241 created, the case of its name is stored, and can be retrieved and
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
242 displayed by the operating system. When an existing file is being
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
243 looked up, its case is ignored. This is the standard arrangement on
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
244 Windows and MacOS. The names \filename{foo} and \filename{FoO}
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
245 identify the same file. This treatment of uppercase and lowercase
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
246 letters as interchangeable is also referred to as \emph{case
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
247 folding}.
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
248 \item Case sensitive. The case of a name is significant at all times.
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
249 The names \filename{foo} and {FoO} identify different files. This
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
250 is the way Linux and Unix systems normally work.
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
251 \end{itemize}
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
252
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
253 On Unix-like systems, it is possible to have any or all of the above
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
254 ways of handling case in action at once. For example, if you use a
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
255 USB thumb drive formatted with a FAT32 filesystem on a Linux system,
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
256 Linux will handle names on that filesystem in a case preserving, but
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
257 insensitive, way.
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
258
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
259 \subsection{Safe, portable repository storage}
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
260
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
261 Mercurial's repository storage mechanism is \emph{case safe}. It
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
262 translates file names so that they can be safely stored on both case
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
263 sensitive and case insensitive filesystems. This means that you can
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
264 use normal file copying tools to transfer a Mercurial repository onto,
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
265 for example, a USB thumb drive, and safely move that drive and
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
266 repository back and forth between a Mac, a PC running Windows, and a
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
267 Linux box.
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
268
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
269 \subsection{Detecting case conflicts}
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
270
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
271 When operating in the working directory, Mercurial honours the naming
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
272 policy of the filesystem where the working directory is located. If
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
273 the filesystem is case preserving, but insensitive, Mercurial will
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
274 treat names that differ only in case as the same.
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
275
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
276 An important aspect of this approach is that it is possible to commit
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
277 a changeset on a case sensitive (typically Linux or Unix) filesystem
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
278 that will cause trouble for users on case insensitive (usually Windows
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
279 and MacOS) users. If a Linux user commits changes to two files, one
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
280 named \filename{myfile.c} and the other named \filename{MyFile.C},
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
281 they will be stored correctly in the repository. And in the working
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
282 directories of other Linux users, they will be correctly represented
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
283 as separate files.
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
284
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
285 If a Windows or Mac user pulls this change, they will not initially
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
286 have a problem, because Mercurial's repository storage mechanism is
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
287 case safe. However, once they try to \hgcmd{update} the working
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
288 directory to that changeset, or \hgcmd{merge} with that changeset,
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
289 Mercurial will spot the conflict between the two file names that the
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
290 filesystem would treat as the same, and forbid the update or merge
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
291 from occurring.
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
292
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
293 \subsection{Fixing a case conflict}
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
294
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
295 If you are using Windows or a Mac in a mixed environment where some of
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
296 your collaborators are using Linux or Unix, and Mercurial reports a
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
297 case folding conflict when you try to \hgcmd{update} or \hgcmd{merge},
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
298 the procedure to fix the problem is simple.
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
299
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
300 Just find a nearby Linux or Unix box, clone the problem repository
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
301 onto it, and use Mercurial's \hgcmd{rename} command to change the
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
302 names of any offending files or directories so that they will no
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
303 longer cause case folding conflicts. Commit this change, \hgcmd{pull}
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
304 or \hgcmd{push} it across to your Windows or MacOS system, and
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
305 \hgcmd{update} to the revision with the non-conflicting names.
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
306
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
307 The changeset with case-conflicting names will remain in your
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
308 project's history, and you still won't be able to \hgcmd{update} your
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
309 working directory to that changeset on a Windows or MacOS system, but
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
310 you can continue development unimpeded.
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
311
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
312 \begin{note}
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
313 Prior to version~0.9.3, Mercurial did not use a case safe repository
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
314 storage mechanism, and did not detect case folding conflicts. If
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
315 you are using an older version of Mercurial on Windows or MacOS, I
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
316 strongly recommend that you upgrade.
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
317 \end{note}
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
318
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
319 %%% Local Variables:
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
320 %%% mode: latex
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
321 %%% TeX-master: "00book"
b05e35d641e4 Copying the files from en to es and taking intro chapter
Igor TAmara <igor@tamarapatino.org>
parents: 432
diff changeset
322 %%% End: