hgbook

annotate es/mq-ref.tex @ 493:26fb9b724588

translated some paragraphs to spanish from mq-ref.tex
author Igor Támara <igor@tamarapatino.org>
date Wed Jan 07 23:47:09 2009 -0500 (2009-01-07)
parents 419853691d11
children 3e176d56ab84
rev   line source
igor@487 1 \chapter{Referencia de las Colas de Mercurial}
jerojasro@336 2 \label{chap:mqref}
jerojasro@336 3
igor@487 4 \section{Referencia de órdenes MQ}
jerojasro@336 5 \label{sec:mqref:cmdref}
jerojasro@336 6
igor@487 7 Si desea dar un vistazo a las órdenes que ofrece MQ, use la orden
jerojasro@336 8 \hgcmdargs{help}{mq}.
jerojasro@336 9
igor@487 10 \subsection{\hgxcmd{mq}{qapplied}---imprimir los parches aplicados}
igor@487 11
igor@487 12 La orden \hgxcmd{mq}{qapplied} imprime la pila actual de parches
igor@487 13 aplicados. Los parches se imprimen en orden de antigüedad, primero
igor@487 14 los más antiguos y después los más recientes, por lo tanto el último
igor@487 15 parche de la lista es el que está en el ``tope''.
igor@487 16
igor@487 17 \subsection{\hgxcmd{mq}{qcommit}---consignar cambios en la cola del repositorio}
igor@487 18
igor@487 19 La orden \hgxcmd{mq}{qcommit} consigna cualquier cambio sobresaliente
igor@487 20 en el repositorio \sdirname{.hg/patches}. Esta orden solamente
igor@487 21 funciona si el directorio \sdirname{.hg/patches} es un repositorio,
igor@487 22 p.e.~usted creó el directorio con
igor@487 23 \hgcmdargs{qinit}{\hgxopt{mq}{qinit}{-c}} o ejecutó
igor@487 24 \hgcmd{init} en el directorio después de correr \hgxcmd{mq}{qinit}.
igor@487 25
igor@487 26 Esta orden es un atajo para \hgcmdargs{commit}{--cwd .hg/patches}.
igor@487 27
igor@488 28 \subsection{\hgxcmd{mq}{qdelete}---eliminar un parche del fichero
igor@487 29 \sfilename{series}}
igor@487 30
igor@487 31 La orden \hgxcmd{mq}{qdelete} elimina la entrada del fichero
igor@487 32 \sfilename{series} para el parche en el directorio
igor@487 33 \sdirname{.hg/patches}. No sca el parche si ha sido aplicado. De
igor@487 34 forma predeterminada no borra el fichero del parche; use la opción
igor@487 35 \hgxopt{mq}{qdel}{-f} para hacerlo.
igor@487 36
igor@487 37 Opciones:
igor@487 38 \begin{itemize}
igor@487 39 \item[\hgxopt{mq}{qdel}{-f}] Elimina el fichero del parche.
igor@487 40 \end{itemize}
igor@487 41
igor@487 42 \subsection{\hgxcmd{mq}{qdiff}---imprimir la diferencia del último
igor@487 43 parche aplicado}
igor@487 44
igor@487 45 La orden \hgxcmd{mq}{qdiff} imprime un diff del parche más
igor@487 46 recientemente aplicado. Es equivalente a \hgcmdargs{diff}{-r-2:-1}.
igor@487 47
igor@488 48 \subsection{\hgxcmd{mq}{qfold}---fusionar (``integrar'') varios parches en
igor@487 49 uno solo}
igor@487 50
igor@487 51 La orden \hgxcmd{mq}{qfold} fusiona muchos parches en el último parche
igor@487 52 aplicado, de tal forma que el último parche aplicado es la unión de
igor@487 53 todos los cambios de los parches en cuestión.
igor@487 54
igor@487 55 Los parches a fusionar no deben haber sido aplicados;
igor@487 56 \hgxcmd{mq}{qfold} saldrá indicando un error si alguno ha sido
igor@487 57 aplicado. El orden en el cual los parches se pliegan es
igor@487 58 significativo; \hgcmdargs{qfold}{a b} significa ``aplique el parche
igor@487 59 más reciente, seguido de \texttt{a}, y seguido de \texttt{b}''.
igor@487 60
igor@488 61 Los comentarios de los parches integrados se colocan al final de los
igor@487 62 comentarios del parche destino, con cada bloque de comentarios
igor@487 63 separado con tres asteriscos(``\texttt{*}''). Se usa la opción
igor@487 64 \hgxopt{mq}{qfold}{-e} para editar el mensaje de consignación para el
igor@487 65 conjunto de cambios/parches después de completarse el pliegue.
igor@487 66
igor@487 67 Opciones:
igor@487 68 \begin{itemize}
igor@487 69 \item[\hgxopt{mq}{qfold}{-e}] Edita el mensaje de consignación y la
igor@488 70 descripción del parche del parche que se ha integrado.
igor@487 71 \item[\hgxopt{mq}{qfold}{-l}] Usa los contenidos del fichero dado como
igor@487 72 el nuevo mensaje de consignación y descripción del parche para el
igor@488 73 parche a integrar.
igor@487 74 \item[\hgxopt{mq}{qfold}{-m}] Usa el texto dado como el mensaje de
igor@488 75 consignación y descripción del parche para el parche integrado.
igor@488 76 \end{itemize}
igor@488 77
igor@488 78 \subsection{\hgxcmd{mq}{qheader}---desplegar el encabezado/descripción
igor@488 79 de un parche}
igor@488 80
igor@488 81 La orden \hgxcmd{mq}{qheader} imprime el encabezado o descripción de
igor@488 82 un parche. De forma predeterminada, imprime el encabezado del último
igor@488 83 parche aplicado. Si se da un argumento, imprime el encabezado del
igor@488 84 parche referenciado.
igor@488 85
igor@488 86 \subsection{\hgxcmd{mq}{qimport}---importar el parche de un tercero en
igor@488 87 la cola}
igor@488 88
igor@488 89 La orden \hgxcmd{mq}{qimport} añade una entrada de un parche externo
igor@488 90 al fichero \sfilename{series} y copia el parche en el directorio
igor@488 91 \sdirname{.hg/patches}. Añade la entrada inmediatamente después del
igor@488 92 último parche aplicado, pero no introduce el parche.
igor@488 93
igor@488 94 Si el directorio \sdirname{.hg/patches} es un repositorio,
igor@488 95 \hgxcmd{mq}{qimport} automáticamente hace un \hgcmd{add} del parche
igor@488 96 importado.
igor@488 97
igor@488 98 \subsection{\hgxcmd{mq}{qinit}---preparar un repositorio para trabajar
igor@488 99 con MQ}
igor@488 100
igor@488 101 La orden \hgxcmd{mq}{qinit} prepara un repositorio para trabajar con
igor@488 102 MQ. Crea un directorio llamado \sdirname{.hg/patches}.
igor@488 103
igor@488 104 Opciones:
igor@488 105 \begin{itemize}
igor@488 106 \item[\hgxopt{mq}{qinit}{-c}] Crea \sdirname{.hg/patches} como un
igor@488 107 repositorio por sí mismo. También crea un fichero
igor@488 108 \sfilename{.hgignore} que ignorará el fichero \sfilename{status}.
igor@488 109 \end{itemize}
igor@488 110
igor@488 111 Cuando el directorio \sdirname{.hg/patches} es un repositorio, las órdenes
igor@488 112 \hgxcmd{mq}{qimport} y \hgxcmd{mq}{qnew} hacen \hgcmd{add}
igor@488 113 automáticamente a los parches nuevos.
igor@488 114
igor@488 115 \subsection{\hgxcmd{mq}{qnew}---crear un parche nuevo}
igor@488 116
igor@488 117 La orden \hgxcmd{mq}{qnew} crea un parche nuevo. Exige un argumento,
igor@488 118 el nombre que se usará para tal parche. El parche recién creado está
igor@488 119 vacío inicialmente. Se añade al fichero \sfilename{series} después
igor@488 120 del último parche aplicado, y se introduce en el tope de ese parche.
igor@488 121
igor@488 122 Si \hgxcmd{mq}{qnew} encuentra ficheros modificados en el directorio
igor@488 123 de trabajo, rehusará crear un parche nuevo a meos que se emplee
igor@488 124 \hgxopt{mq}{qnew}{-f} la opción(ver más adelante). Este
igor@488 125 comportamiento le permite hacer \hgxcmd{mq}{qrefresh} al último parche
igor@488 126 aplicado antes de aplicar un parche nuevo encima de este.
igor@488 127
igor@488 128 Opciones:
igor@488 129 \begin{itemize}
igor@488 130 \item[\hgxopt{mq}{qnew}{-f}] Crea un parche nuevo si los contenidos
igor@488 131 del directorio actual han sido modificados. Cualquier modificación
igor@488 132 significativa se añade al parche recientemente creado, de tal forma
igor@488 133 que al finalizar la orden, el directorio de trabajo no lucirá
igor@488 134 modificado.
igor@488 135 \item[\hgxopt{mq}{qnew}{-m}] Usa el texto dado como el mensaje de
igor@488 136 consignación. Este texto se almacenará al principio del fichero del
igor@488 137 parche, antes de los datos del parche.
jerojasro@336 138 \end{itemize}
jerojasro@336 139
igor@493 140 \subsection{\hgxcmd{mq}{qnext}---imprimir el nombre del próximo parche}
igor@493 141
igor@493 142 La orden \hgxcmd{mq}{qnext} imprime el nombre del siguiente parche en
igor@493 143 el fichero \sfilename{series} a continuación del último parche
igor@493 144 aplicado. Este parche sería el próximo parche a aplicar si se
igor@493 145 ejecutara la orden \hgxcmd{mq}{qpush}.
igor@493 146
igor@493 147 \subsection{\hgxcmd{mq}{qpop}---sustraer parches de la pila}
igor@493 148
igor@493 149 La orden \hgxcmd{mq}{qpop} elimina los parches aplicados del tope de
igor@493 150 la pila de parches aplicados. De forma predeterminada solamente
igor@493 151 remueve un parche.
igor@493 152
igor@493 153 Esta orden elimina los conjuntos de cambios que representan los
igor@493 154 parches sustraídos del repositorio, y actualiza el directorio de
igor@493 155 trabajo para deshacer los efectos de los parches.
igor@493 156
igor@493 157 Esta orden toma un argumento opcional, que usa como el nombre o el
igor@493 158 índice del parche que desea sustraer. Si se da el nombre, sustraerá
igor@493 159 los parches hasta que el parche nombrado sea el último parche
igor@493 160 aplicado. Si se da un número, \hgxcmd{mq}{qpop} lo trata como un
igor@493 161 índice dentro del fichero \sfilename{series}, contando desde
igor@493 162 cero(no cuenta las líneas vacías o aquellas que sean únicamente
igor@493 163 comentarios). Sustrae los parches hasta que el parche identificado
igor@493 164 por el índice sea el último parche aplicado.
igor@493 165
igor@493 166 La orden \hgxcmd{mq}{qpop} no lee o escribe parches en el fichero
igor@493 167 \sfilename{series}. \hgxcmd{mq}{qpop} se constituye por tanto en una
igor@493 168 forma segura de sustraer un parche del fichero \sfilename{series} o un
igor@493 169 parche que ha eliminado o renombrado completamente. En los dos
igor@493 170 últimos casos, use el nombre del parche tal como lo hizo cuando lo
igor@493 171 aplicó.
igor@493 172
igor@493 173 De forma predeterminada, la orden \hgxcmd{mq}{qpop} no sustraerá
igor@493 174 parche alguno si el directorio de trabajo ha sido modificado. Puede
igor@493 175 modificar este comportamiento con la opción \hgxopt{mq}{qpop}{-f}, que
igor@493 176 revierte todas las modificaciones del directorio de trabajo.
igor@493 177
igor@493 178 Opciones:
igor@493 179 \begin{itemize}
igor@493 180 \item[\hgxopt{mq}{qpop}{-a}] Sustrae todos los parches aplicados.
igor@493 181 Restaura el repositorio al estado antes de haber aplicado parche alguno.
igor@493 182 \item[\hgxopt{mq}{qpop}{-f}] Revertir forzadamente cualquier
igor@493 183 modificación del directorio de trabajo cuando se hace sustracciones.
igor@493 184 \item[\hgxopt{mq}{qpop}{-n}] Sustraer un parche de la cola dado un nombre.
igor@493 185 \end{itemize}
igor@493 186
igor@493 187 La orden \hgxcmd{mq}{qpop} elimina una línea del final del fichero
igor@493 188 \sfilename{status} por cada parche que se sustrae.
igor@493 189
igor@493 190 \subsection{\hgxcmd{mq}{qprev}---imprimir el nombre del parche anterior}
igor@493 191
igor@493 192 La orden \hgxcmd{mq}{qprev} imprime el nombre del parche en el fichero
igor@493 193 \sfilename{series} que está antes del último parche aplicado. Este
igor@493 194 se volverá el último parche aplicado si ejecuta \hgxcmd{mq}{qpop}.
jerojasro@336 195
jerojasro@336 196 \subsection{\hgxcmd{mq}{qpush}---push patches onto the stack}
jerojasro@336 197 \label{sec:mqref:cmd:qpush}
jerojasro@336 198
jerojasro@336 199 The \hgxcmd{mq}{qpush} command adds patches onto the applied stack. By
jerojasro@336 200 default, it adds only one patch.
jerojasro@336 201
jerojasro@336 202 This command creates a new changeset to represent each applied patch,
jerojasro@336 203 and updates the working directory to apply the effects of the patches.
jerojasro@336 204
jerojasro@336 205 The default data used when creating a changeset are as follows:
jerojasro@336 206 \begin{itemize}
jerojasro@336 207 \item The commit date and time zone are the current date and time
jerojasro@336 208 zone. Because these data are used to compute the identity of a
jerojasro@336 209 changeset, this means that if you \hgxcmd{mq}{qpop} a patch and
jerojasro@336 210 \hgxcmd{mq}{qpush} it again, the changeset that you push will have a
jerojasro@336 211 different identity than the changeset you popped.
jerojasro@336 212 \item The author is the same as the default used by the \hgcmd{commit}
jerojasro@336 213 command.
jerojasro@336 214 \item The commit message is any text from the patch file that comes
jerojasro@336 215 before the first diff header. If there is no such text, a default
jerojasro@336 216 commit message is used that identifies the name of the patch.
jerojasro@336 217 \end{itemize}
jerojasro@336 218 If a patch contains a Mercurial patch header (XXX add link), the
jerojasro@336 219 information in the patch header overrides these defaults.
jerojasro@336 220
jerojasro@336 221 Options:
jerojasro@336 222 \begin{itemize}
jerojasro@336 223 \item[\hgxopt{mq}{qpush}{-a}] Push all unapplied patches from the
jerojasro@336 224 \sfilename{series} file until there are none left to push.
jerojasro@336 225 \item[\hgxopt{mq}{qpush}{-l}] Add the name of the patch to the end
jerojasro@336 226 of the commit message.
jerojasro@336 227 \item[\hgxopt{mq}{qpush}{-m}] If a patch fails to apply cleanly, use the
jerojasro@336 228 entry for the patch in another saved queue to compute the parameters
jerojasro@336 229 for a three-way merge, and perform a three-way merge using the
jerojasro@336 230 normal Mercurial merge machinery. Use the resolution of the merge
jerojasro@336 231 as the new patch content.
jerojasro@336 232 \item[\hgxopt{mq}{qpush}{-n}] Use the named queue if merging while pushing.
jerojasro@336 233 \end{itemize}
jerojasro@336 234
jerojasro@336 235 The \hgxcmd{mq}{qpush} command reads, but does not modify, the
jerojasro@336 236 \sfilename{series} file. It appends one line to the \hgcmd{status}
jerojasro@336 237 file for each patch that it pushes.
jerojasro@336 238
jerojasro@336 239 \subsection{\hgxcmd{mq}{qrefresh}---update the topmost applied patch}
jerojasro@336 240
jerojasro@336 241 The \hgxcmd{mq}{qrefresh} command updates the topmost applied patch. It
jerojasro@336 242 modifies the patch, removes the old changeset that represented the
jerojasro@336 243 patch, and creates a new changeset to represent the modified patch.
jerojasro@336 244
jerojasro@336 245 The \hgxcmd{mq}{qrefresh} command looks for the following modifications:
jerojasro@336 246 \begin{itemize}
jerojasro@336 247 \item Changes to the commit message, i.e.~the text before the first
jerojasro@336 248 diff header in the patch file, are reflected in the new changeset
jerojasro@336 249 that represents the patch.
jerojasro@336 250 \item Modifications to tracked files in the working directory are
jerojasro@336 251 added to the patch.
jerojasro@336 252 \item Changes to the files tracked using \hgcmd{add}, \hgcmd{copy},
jerojasro@336 253 \hgcmd{remove}, or \hgcmd{rename}. Added files and copy and rename
jerojasro@336 254 destinations are added to the patch, while removed files and rename
jerojasro@336 255 sources are removed.
jerojasro@336 256 \end{itemize}
jerojasro@336 257
jerojasro@336 258 Even if \hgxcmd{mq}{qrefresh} detects no changes, it still recreates the
jerojasro@336 259 changeset that represents the patch. This causes the identity of the
jerojasro@336 260 changeset to differ from the previous changeset that identified the
jerojasro@336 261 patch.
jerojasro@336 262
jerojasro@336 263 Options:
jerojasro@336 264 \begin{itemize}
jerojasro@336 265 \item[\hgxopt{mq}{qrefresh}{-e}] Modify the commit and patch description,
jerojasro@336 266 using the preferred text editor.
jerojasro@336 267 \item[\hgxopt{mq}{qrefresh}{-m}] Modify the commit message and patch
jerojasro@336 268 description, using the given text.
jerojasro@336 269 \item[\hgxopt{mq}{qrefresh}{-l}] Modify the commit message and patch
jerojasro@336 270 description, using text from the given file.
jerojasro@336 271 \end{itemize}
jerojasro@336 272
jerojasro@336 273 \subsection{\hgxcmd{mq}{qrename}---rename a patch}
jerojasro@336 274
jerojasro@336 275 The \hgxcmd{mq}{qrename} command renames a patch, and changes the entry for
jerojasro@336 276 the patch in the \sfilename{series} file.
jerojasro@336 277
jerojasro@336 278 With a single argument, \hgxcmd{mq}{qrename} renames the topmost applied
jerojasro@336 279 patch. With two arguments, it renames its first argument to its
jerojasro@336 280 second.
jerojasro@336 281
jerojasro@336 282 \subsection{\hgxcmd{mq}{qrestore}---restore saved queue state}
jerojasro@336 283
jerojasro@336 284 XXX No idea what this does.
jerojasro@336 285
jerojasro@336 286 \subsection{\hgxcmd{mq}{qsave}---save current queue state}
jerojasro@336 287
jerojasro@336 288 XXX Likewise.
jerojasro@336 289
jerojasro@336 290 \subsection{\hgxcmd{mq}{qseries}---print the entire patch series}
jerojasro@336 291
jerojasro@336 292 The \hgxcmd{mq}{qseries} command prints the entire patch series from the
jerojasro@336 293 \sfilename{series} file. It prints only patch names, not empty lines
jerojasro@336 294 or comments. It prints in order from first to be applied to last.
jerojasro@336 295
jerojasro@336 296 \subsection{\hgxcmd{mq}{qtop}---print the name of the current patch}
jerojasro@336 297
jerojasro@336 298 The \hgxcmd{mq}{qtop} prints the name of the topmost currently applied
jerojasro@336 299 patch.
jerojasro@336 300
jerojasro@336 301 \subsection{\hgxcmd{mq}{qunapplied}---print patches not yet applied}
jerojasro@336 302
jerojasro@336 303 The \hgxcmd{mq}{qunapplied} command prints the names of patches from the
jerojasro@336 304 \sfilename{series} file that are not yet applied. It prints them in
jerojasro@336 305 order from the next patch that will be pushed to the last.
jerojasro@336 306
jerojasro@336 307 \subsection{\hgcmd{strip}---remove a revision and descendants}
jerojasro@336 308
jerojasro@336 309 The \hgcmd{strip} command removes a revision, and all of its
jerojasro@336 310 descendants, from the repository. It undoes the effects of the
jerojasro@336 311 removed revisions from the repository, and updates the working
jerojasro@336 312 directory to the first parent of the removed revision.
jerojasro@336 313
jerojasro@336 314 The \hgcmd{strip} command saves a backup of the removed changesets in
jerojasro@336 315 a bundle, so that they can be reapplied if removed in error.
jerojasro@336 316
jerojasro@336 317 Options:
jerojasro@336 318 \begin{itemize}
jerojasro@336 319 \item[\hgopt{strip}{-b}] Save unrelated changesets that are intermixed
jerojasro@336 320 with the stripped changesets in the backup bundle.
jerojasro@336 321 \item[\hgopt{strip}{-f}] If a branch has multiple heads, remove all
jerojasro@336 322 heads. XXX This should be renamed, and use \texttt{-f} to strip revs
jerojasro@336 323 when there are pending changes.
jerojasro@336 324 \item[\hgopt{strip}{-n}] Do not save a backup bundle.
jerojasro@336 325 \end{itemize}
jerojasro@336 326
jerojasro@336 327 \section{MQ file reference}
jerojasro@336 328
jerojasro@336 329 \subsection{The \sfilename{series} file}
jerojasro@336 330
jerojasro@336 331 The \sfilename{series} file contains a list of the names of all
jerojasro@336 332 patches that MQ can apply. It is represented as a list of names, with
jerojasro@336 333 one name saved per line. Leading and trailing white space in each
jerojasro@336 334 line are ignored.
jerojasro@336 335
jerojasro@336 336 Lines may contain comments. A comment begins with the ``\texttt{\#}''
jerojasro@336 337 character, and extends to the end of the line. Empty lines, and lines
jerojasro@336 338 that contain only comments, are ignored.
jerojasro@336 339
jerojasro@336 340 You will often need to edit the \sfilename{series} file by hand, hence
jerojasro@336 341 the support for comments and empty lines noted above. For example,
jerojasro@336 342 you can comment out a patch temporarily, and \hgxcmd{mq}{qpush} will skip
jerojasro@336 343 over that patch when applying patches. You can also change the order
jerojasro@336 344 in which patches are applied by reordering their entries in the
jerojasro@336 345 \sfilename{series} file.
jerojasro@336 346
jerojasro@336 347 Placing the \sfilename{series} file under revision control is also
jerojasro@336 348 supported; it is a good idea to place all of the patches that it
jerojasro@336 349 refers to under revision control, as well. If you create a patch
jerojasro@336 350 directory using the \hgxopt{mq}{qinit}{-c} option to \hgxcmd{mq}{qinit}, this
jerojasro@336 351 will be done for you automatically.
jerojasro@336 352
jerojasro@336 353 \subsection{The \sfilename{status} file}
jerojasro@336 354
jerojasro@336 355 The \sfilename{status} file contains the names and changeset hashes of
jerojasro@336 356 all patches that MQ currently has applied. Unlike the
jerojasro@336 357 \sfilename{series} file, this file is not intended for editing. You
jerojasro@336 358 should not place this file under revision control, or modify it in any
jerojasro@336 359 way. It is used by MQ strictly for internal book-keeping.
jerojasro@336 360
jerojasro@336 361 %%% Local Variables:
jerojasro@336 362 %%% mode: latex
jerojasro@336 363 %%% TeX-master: "00book"
jerojasro@336 364 %%% End: