igor@487: \chapter{Referencia de las Colas de Mercurial} jerojasro@336: \label{chap:mqref} jerojasro@336: igor@487: \section{Referencia de órdenes MQ} jerojasro@336: \label{sec:mqref:cmdref} jerojasro@336: igor@487: Si desea dar un vistazo a las órdenes que ofrece MQ, use la orden jerojasro@336: \hgcmdargs{help}{mq}. jerojasro@336: igor@487: \subsection{\hgxcmd{mq}{qapplied}---imprimir los parches aplicados} igor@487: igor@487: La orden \hgxcmd{mq}{qapplied} imprime la pila actual de parches igor@487: aplicados. Los parches se imprimen en orden de antigüedad, primero igor@487: los más antiguos y después los más recientes, por lo tanto el último igor@487: parche de la lista es el que está en el ``tope''. igor@487: igor@487: \subsection{\hgxcmd{mq}{qcommit}---consignar cambios en la cola del repositorio} igor@487: igor@487: La orden \hgxcmd{mq}{qcommit} consigna cualquier cambio sobresaliente igor@487: en el repositorio \sdirname{.hg/patches}. Esta orden solamente igor@487: funciona si el directorio \sdirname{.hg/patches} es un repositorio, igor@487: p.e.~usted creó el directorio con igor@487: \hgcmdargs{qinit}{\hgxopt{mq}{qinit}{-c}} o ejecutó igor@487: \hgcmd{init} en el directorio después de correr \hgxcmd{mq}{qinit}. igor@487: igor@487: Esta orden es un atajo para \hgcmdargs{commit}{--cwd .hg/patches}. igor@487: igor@488: \subsection{\hgxcmd{mq}{qdelete}---eliminar un parche del fichero igor@487: \sfilename{series}} igor@487: igor@487: La orden \hgxcmd{mq}{qdelete} elimina la entrada del fichero igor@487: \sfilename{series} para el parche en el directorio igor@487: \sdirname{.hg/patches}. No sca el parche si ha sido aplicado. De igor@487: forma predeterminada no borra el fichero del parche; use la opción igor@487: \hgxopt{mq}{qdel}{-f} para hacerlo. igor@487: igor@487: Opciones: igor@487: \begin{itemize} igor@487: \item[\hgxopt{mq}{qdel}{-f}] Elimina el fichero del parche. igor@487: \end{itemize} igor@487: igor@487: \subsection{\hgxcmd{mq}{qdiff}---imprimir la diferencia del último igor@487: parche aplicado} igor@487: igor@487: La orden \hgxcmd{mq}{qdiff} imprime un diff del parche más igor@487: recientemente aplicado. Es equivalente a \hgcmdargs{diff}{-r-2:-1}. igor@487: igor@488: \subsection{\hgxcmd{mq}{qfold}---fusionar (``integrar'') varios parches en igor@487: uno solo} igor@487: igor@487: La orden \hgxcmd{mq}{qfold} fusiona muchos parches en el último parche igor@487: aplicado, de tal forma que el último parche aplicado es la unión de igor@487: todos los cambios de los parches en cuestión. igor@487: igor@487: Los parches a fusionar no deben haber sido aplicados; igor@487: \hgxcmd{mq}{qfold} saldrá indicando un error si alguno ha sido igor@487: aplicado. El orden en el cual los parches se pliegan es igor@487: significativo; \hgcmdargs{qfold}{a b} significa ``aplique el parche igor@487: más reciente, seguido de \texttt{a}, y seguido de \texttt{b}''. igor@487: igor@488: Los comentarios de los parches integrados se colocan al final de los igor@487: comentarios del parche destino, con cada bloque de comentarios igor@487: separado con tres asteriscos(``\texttt{*}''). Se usa la opción igor@487: \hgxopt{mq}{qfold}{-e} para editar el mensaje de consignación para el igor@487: conjunto de cambios/parches después de completarse el pliegue. igor@487: igor@487: Opciones: igor@487: \begin{itemize} igor@487: \item[\hgxopt{mq}{qfold}{-e}] Edita el mensaje de consignación y la igor@488: descripción del parche del parche que se ha integrado. igor@487: \item[\hgxopt{mq}{qfold}{-l}] Usa los contenidos del fichero dado como igor@487: el nuevo mensaje de consignación y descripción del parche para el igor@488: parche a integrar. igor@487: \item[\hgxopt{mq}{qfold}{-m}] Usa el texto dado como el mensaje de igor@488: consignación y descripción del parche para el parche integrado. igor@488: \end{itemize} igor@488: igor@488: \subsection{\hgxcmd{mq}{qheader}---desplegar el encabezado/descripción igor@488: de un parche} igor@488: igor@488: La orden \hgxcmd{mq}{qheader} imprime el encabezado o descripción de igor@488: un parche. De forma predeterminada, imprime el encabezado del último igor@488: parche aplicado. Si se da un argumento, imprime el encabezado del igor@488: parche referenciado. igor@488: igor@488: \subsection{\hgxcmd{mq}{qimport}---importar el parche de un tercero en igor@488: la cola} igor@488: igor@488: La orden \hgxcmd{mq}{qimport} añade una entrada de un parche externo igor@488: al fichero \sfilename{series} y copia el parche en el directorio igor@488: \sdirname{.hg/patches}. Añade la entrada inmediatamente después del igor@488: último parche aplicado, pero no introduce el parche. igor@488: igor@488: Si el directorio \sdirname{.hg/patches} es un repositorio, igor@488: \hgxcmd{mq}{qimport} automáticamente hace un \hgcmd{add} del parche igor@488: importado. igor@488: igor@488: \subsection{\hgxcmd{mq}{qinit}---preparar un repositorio para trabajar igor@488: con MQ} igor@488: igor@488: La orden \hgxcmd{mq}{qinit} prepara un repositorio para trabajar con igor@488: MQ. Crea un directorio llamado \sdirname{.hg/patches}. igor@488: igor@488: Opciones: igor@488: \begin{itemize} igor@488: \item[\hgxopt{mq}{qinit}{-c}] Crea \sdirname{.hg/patches} como un igor@488: repositorio por sí mismo. También crea un fichero igor@488: \sfilename{.hgignore} que ignorará el fichero \sfilename{status}. igor@488: \end{itemize} igor@488: igor@488: Cuando el directorio \sdirname{.hg/patches} es un repositorio, las órdenes igor@488: \hgxcmd{mq}{qimport} y \hgxcmd{mq}{qnew} hacen \hgcmd{add} igor@488: automáticamente a los parches nuevos. igor@488: igor@488: \subsection{\hgxcmd{mq}{qnew}---crear un parche nuevo} igor@488: igor@488: La orden \hgxcmd{mq}{qnew} crea un parche nuevo. Exige un argumento, igor@488: el nombre que se usará para tal parche. El parche recién creado está igor@488: vacío inicialmente. Se añade al fichero \sfilename{series} después igor@488: del último parche aplicado, y se introduce en el tope de ese parche. igor@488: igor@488: Si \hgxcmd{mq}{qnew} encuentra ficheros modificados en el directorio igor@488: de trabajo, rehusará crear un parche nuevo a meos que se emplee igor@488: \hgxopt{mq}{qnew}{-f} la opción(ver más adelante). Este igor@488: comportamiento le permite hacer \hgxcmd{mq}{qrefresh} al último parche igor@488: aplicado antes de aplicar un parche nuevo encima de este. igor@488: igor@488: Opciones: igor@488: \begin{itemize} igor@488: \item[\hgxopt{mq}{qnew}{-f}] Crea un parche nuevo si los contenidos igor@488: del directorio actual han sido modificados. Cualquier modificación igor@488: significativa se añade al parche recientemente creado, de tal forma igor@488: que al finalizar la orden, el directorio de trabajo no lucirá igor@488: modificado. igor@488: \item[\hgxopt{mq}{qnew}{-m}] Usa el texto dado como el mensaje de igor@488: consignación. Este texto se almacenará al principio del fichero del igor@488: parche, antes de los datos del parche. jerojasro@336: \end{itemize} jerojasro@336: igor@493: \subsection{\hgxcmd{mq}{qnext}---imprimir el nombre del próximo parche} igor@493: igor@493: La orden \hgxcmd{mq}{qnext} imprime el nombre del siguiente parche en igor@493: el fichero \sfilename{series} a continuación del último parche igor@493: aplicado. Este parche sería el próximo parche a aplicar si se igor@493: ejecutara la orden \hgxcmd{mq}{qpush}. igor@493: igor@493: \subsection{\hgxcmd{mq}{qpop}---sustraer parches de la pila} igor@493: igor@493: La orden \hgxcmd{mq}{qpop} elimina los parches aplicados del tope de igor@493: la pila de parches aplicados. De forma predeterminada solamente igor@493: remueve un parche. igor@493: igor@493: Esta orden elimina los conjuntos de cambios que representan los igor@493: parches sustraídos del repositorio, y actualiza el directorio de igor@493: trabajo para deshacer los efectos de los parches. igor@493: igor@493: Esta orden toma un argumento opcional, que usa como el nombre o el igor@493: índice del parche que desea sustraer. Si se da el nombre, sustraerá igor@493: los parches hasta que el parche nombrado sea el último parche igor@493: aplicado. Si se da un número, \hgxcmd{mq}{qpop} lo trata como un igor@493: índice dentro del fichero \sfilename{series}, contando desde igor@493: cero(no cuenta las líneas vacías o aquellas que sean únicamente igor@493: comentarios). Sustrae los parches hasta que el parche identificado igor@493: por el índice sea el último parche aplicado. igor@493: igor@493: La orden \hgxcmd{mq}{qpop} no lee o escribe parches en el fichero igor@493: \sfilename{series}. \hgxcmd{mq}{qpop} se constituye por tanto en una igor@493: forma segura de sustraer un parche del fichero \sfilename{series} o un igor@493: parche que ha eliminado o renombrado completamente. En los dos igor@493: últimos casos, use el nombre del parche tal como lo hizo cuando lo igor@493: aplicó. igor@493: igor@493: De forma predeterminada, la orden \hgxcmd{mq}{qpop} no sustraerá igor@493: parche alguno si el directorio de trabajo ha sido modificado. Puede igor@493: modificar este comportamiento con la opción \hgxopt{mq}{qpop}{-f}, que igor@493: revierte todas las modificaciones del directorio de trabajo. igor@493: igor@493: Opciones: igor@493: \begin{itemize} igor@493: \item[\hgxopt{mq}{qpop}{-a}] Sustrae todos los parches aplicados. igor@493: Restaura el repositorio al estado antes de haber aplicado parche alguno. igor@493: \item[\hgxopt{mq}{qpop}{-f}] Revertir forzadamente cualquier igor@493: modificación del directorio de trabajo cuando se hace sustracciones. igor@493: \item[\hgxopt{mq}{qpop}{-n}] Sustraer un parche de la cola dado un nombre. igor@493: \end{itemize} igor@493: igor@493: La orden \hgxcmd{mq}{qpop} elimina una línea del final del fichero igor@493: \sfilename{status} por cada parche que se sustrae. igor@493: igor@493: \subsection{\hgxcmd{mq}{qprev}---imprimir el nombre del parche anterior} igor@493: igor@493: La orden \hgxcmd{mq}{qprev} imprime el nombre del parche en el fichero igor@493: \sfilename{series} que está antes del último parche aplicado. Este igor@493: se volverá el último parche aplicado si ejecuta \hgxcmd{mq}{qpop}. jerojasro@336: jerojasro@336: \subsection{\hgxcmd{mq}{qpush}---push patches onto the stack} jerojasro@336: \label{sec:mqref:cmd:qpush} jerojasro@336: jerojasro@336: The \hgxcmd{mq}{qpush} command adds patches onto the applied stack. By jerojasro@336: default, it adds only one patch. jerojasro@336: jerojasro@336: This command creates a new changeset to represent each applied patch, jerojasro@336: and updates the working directory to apply the effects of the patches. jerojasro@336: jerojasro@336: The default data used when creating a changeset are as follows: jerojasro@336: \begin{itemize} jerojasro@336: \item The commit date and time zone are the current date and time jerojasro@336: zone. Because these data are used to compute the identity of a jerojasro@336: changeset, this means that if you \hgxcmd{mq}{qpop} a patch and jerojasro@336: \hgxcmd{mq}{qpush} it again, the changeset that you push will have a jerojasro@336: different identity than the changeset you popped. jerojasro@336: \item The author is the same as the default used by the \hgcmd{commit} jerojasro@336: command. jerojasro@336: \item The commit message is any text from the patch file that comes jerojasro@336: before the first diff header. If there is no such text, a default jerojasro@336: commit message is used that identifies the name of the patch. jerojasro@336: \end{itemize} jerojasro@336: If a patch contains a Mercurial patch header (XXX add link), the jerojasro@336: information in the patch header overrides these defaults. jerojasro@336: jerojasro@336: Options: jerojasro@336: \begin{itemize} jerojasro@336: \item[\hgxopt{mq}{qpush}{-a}] Push all unapplied patches from the jerojasro@336: \sfilename{series} file until there are none left to push. jerojasro@336: \item[\hgxopt{mq}{qpush}{-l}] Add the name of the patch to the end jerojasro@336: of the commit message. jerojasro@336: \item[\hgxopt{mq}{qpush}{-m}] If a patch fails to apply cleanly, use the jerojasro@336: entry for the patch in another saved queue to compute the parameters jerojasro@336: for a three-way merge, and perform a three-way merge using the jerojasro@336: normal Mercurial merge machinery. Use the resolution of the merge jerojasro@336: as the new patch content. jerojasro@336: \item[\hgxopt{mq}{qpush}{-n}] Use the named queue if merging while pushing. jerojasro@336: \end{itemize} jerojasro@336: jerojasro@336: The \hgxcmd{mq}{qpush} command reads, but does not modify, the jerojasro@336: \sfilename{series} file. It appends one line to the \hgcmd{status} jerojasro@336: file for each patch that it pushes. jerojasro@336: jerojasro@336: \subsection{\hgxcmd{mq}{qrefresh}---update the topmost applied patch} jerojasro@336: jerojasro@336: The \hgxcmd{mq}{qrefresh} command updates the topmost applied patch. It jerojasro@336: modifies the patch, removes the old changeset that represented the jerojasro@336: patch, and creates a new changeset to represent the modified patch. jerojasro@336: jerojasro@336: The \hgxcmd{mq}{qrefresh} command looks for the following modifications: jerojasro@336: \begin{itemize} jerojasro@336: \item Changes to the commit message, i.e.~the text before the first jerojasro@336: diff header in the patch file, are reflected in the new changeset jerojasro@336: that represents the patch. jerojasro@336: \item Modifications to tracked files in the working directory are jerojasro@336: added to the patch. jerojasro@336: \item Changes to the files tracked using \hgcmd{add}, \hgcmd{copy}, jerojasro@336: \hgcmd{remove}, or \hgcmd{rename}. Added files and copy and rename jerojasro@336: destinations are added to the patch, while removed files and rename jerojasro@336: sources are removed. jerojasro@336: \end{itemize} jerojasro@336: jerojasro@336: Even if \hgxcmd{mq}{qrefresh} detects no changes, it still recreates the jerojasro@336: changeset that represents the patch. This causes the identity of the jerojasro@336: changeset to differ from the previous changeset that identified the jerojasro@336: patch. jerojasro@336: jerojasro@336: Options: jerojasro@336: \begin{itemize} jerojasro@336: \item[\hgxopt{mq}{qrefresh}{-e}] Modify the commit and patch description, jerojasro@336: using the preferred text editor. jerojasro@336: \item[\hgxopt{mq}{qrefresh}{-m}] Modify the commit message and patch jerojasro@336: description, using the given text. jerojasro@336: \item[\hgxopt{mq}{qrefresh}{-l}] Modify the commit message and patch jerojasro@336: description, using text from the given file. jerojasro@336: \end{itemize} jerojasro@336: jerojasro@336: \subsection{\hgxcmd{mq}{qrename}---rename a patch} jerojasro@336: jerojasro@336: The \hgxcmd{mq}{qrename} command renames a patch, and changes the entry for jerojasro@336: the patch in the \sfilename{series} file. jerojasro@336: jerojasro@336: With a single argument, \hgxcmd{mq}{qrename} renames the topmost applied jerojasro@336: patch. With two arguments, it renames its first argument to its jerojasro@336: second. jerojasro@336: jerojasro@336: \subsection{\hgxcmd{mq}{qrestore}---restore saved queue state} jerojasro@336: jerojasro@336: XXX No idea what this does. jerojasro@336: jerojasro@336: \subsection{\hgxcmd{mq}{qsave}---save current queue state} jerojasro@336: jerojasro@336: XXX Likewise. jerojasro@336: jerojasro@336: \subsection{\hgxcmd{mq}{qseries}---print the entire patch series} jerojasro@336: jerojasro@336: The \hgxcmd{mq}{qseries} command prints the entire patch series from the jerojasro@336: \sfilename{series} file. It prints only patch names, not empty lines jerojasro@336: or comments. It prints in order from first to be applied to last. jerojasro@336: jerojasro@336: \subsection{\hgxcmd{mq}{qtop}---print the name of the current patch} jerojasro@336: jerojasro@336: The \hgxcmd{mq}{qtop} prints the name of the topmost currently applied jerojasro@336: patch. jerojasro@336: jerojasro@336: \subsection{\hgxcmd{mq}{qunapplied}---print patches not yet applied} jerojasro@336: jerojasro@336: The \hgxcmd{mq}{qunapplied} command prints the names of patches from the jerojasro@336: \sfilename{series} file that are not yet applied. It prints them in jerojasro@336: order from the next patch that will be pushed to the last. jerojasro@336: jerojasro@336: \subsection{\hgcmd{strip}---remove a revision and descendants} jerojasro@336: jerojasro@336: The \hgcmd{strip} command removes a revision, and all of its jerojasro@336: descendants, from the repository. It undoes the effects of the jerojasro@336: removed revisions from the repository, and updates the working jerojasro@336: directory to the first parent of the removed revision. jerojasro@336: jerojasro@336: The \hgcmd{strip} command saves a backup of the removed changesets in jerojasro@336: a bundle, so that they can be reapplied if removed in error. jerojasro@336: jerojasro@336: Options: jerojasro@336: \begin{itemize} jerojasro@336: \item[\hgopt{strip}{-b}] Save unrelated changesets that are intermixed jerojasro@336: with the stripped changesets in the backup bundle. jerojasro@336: \item[\hgopt{strip}{-f}] If a branch has multiple heads, remove all jerojasro@336: heads. XXX This should be renamed, and use \texttt{-f} to strip revs jerojasro@336: when there are pending changes. jerojasro@336: \item[\hgopt{strip}{-n}] Do not save a backup bundle. jerojasro@336: \end{itemize} jerojasro@336: jerojasro@336: \section{MQ file reference} jerojasro@336: jerojasro@336: \subsection{The \sfilename{series} file} jerojasro@336: jerojasro@336: The \sfilename{series} file contains a list of the names of all jerojasro@336: patches that MQ can apply. It is represented as a list of names, with jerojasro@336: one name saved per line. Leading and trailing white space in each jerojasro@336: line are ignored. jerojasro@336: jerojasro@336: Lines may contain comments. A comment begins with the ``\texttt{\#}'' jerojasro@336: character, and extends to the end of the line. Empty lines, and lines jerojasro@336: that contain only comments, are ignored. jerojasro@336: jerojasro@336: You will often need to edit the \sfilename{series} file by hand, hence jerojasro@336: the support for comments and empty lines noted above. For example, jerojasro@336: you can comment out a patch temporarily, and \hgxcmd{mq}{qpush} will skip jerojasro@336: over that patch when applying patches. You can also change the order jerojasro@336: in which patches are applied by reordering their entries in the jerojasro@336: \sfilename{series} file. jerojasro@336: jerojasro@336: Placing the \sfilename{series} file under revision control is also jerojasro@336: supported; it is a good idea to place all of the patches that it jerojasro@336: refers to under revision control, as well. If you create a patch jerojasro@336: directory using the \hgxopt{mq}{qinit}{-c} option to \hgxcmd{mq}{qinit}, this jerojasro@336: will be done for you automatically. jerojasro@336: jerojasro@336: \subsection{The \sfilename{status} file} jerojasro@336: jerojasro@336: The \sfilename{status} file contains the names and changeset hashes of jerojasro@336: all patches that MQ currently has applied. Unlike the jerojasro@336: \sfilename{series} file, this file is not intended for editing. You jerojasro@336: should not place this file under revision control, or modify it in any jerojasro@336: way. It is used by MQ strictly for internal book-keeping. jerojasro@336: jerojasro@336: %%% Local Variables: jerojasro@336: %%% mode: latex jerojasro@336: %%% TeX-master: "00book" jerojasro@336: %%% End: