hgbook

diff es/mq.tex @ 446:40ba5d8583c7

Translated some more paragraphs of mq to spanish
author Igor TAmara <igor@tamarapatino.org>
date Mon Dec 08 23:53:54 2008 -0500 (2008-12-08)
parents da4d34e0e250
children 93e7700c0322
line diff
     1.1 --- a/es/mq.tex	Mon Dec 08 20:37:58 2008 -0500
     1.2 +++ b/es/mq.tex	Mon Dec 08 23:53:54 2008 -0500
     1.3 @@ -496,95 +496,103 @@
     1.4  modificado estaría al frente de la porción derecha de la ruta del
     1.5  archivo.
     1.6  
     1.7 -Since someone receiving a patch from the Alices of the net would be
     1.8 -unlikely to have unmodified and modified directories with exactly the
     1.9 -same names, the \command{patch} command has a \cmdopt{patch}{-p}
    1.10 -option that indicates the number of leading path name components to
    1.11 -strip when trying to apply a patch.  This number is called the
    1.12 -\emph{strip count}.
    1.13 -
    1.14 -An option of ``\texttt{-p1}'' means ``use a strip count of one''.  If
    1.15 -\command{patch} sees a file name \filename{foo/bar/baz} in a file
    1.16 -header, it will strip \filename{foo} and try to patch a file named
    1.17 -\filename{bar/baz}.  (Strictly speaking, the strip count refers to the
    1.18 -number of \emph{path separators} (and the components that go with them
    1.19 -) to strip.  A strip count of one will turn \filename{foo/bar} into
    1.20 -\filename{bar}, but \filename{/foo/bar} (notice the extra leading
    1.21 -slash) into \filename{foo/bar}.)
    1.22 -
    1.23 -The ``standard'' strip count for patches is one; almost all patches
    1.24 -contain one leading path name component that needs to be stripped.
    1.25 -Mercurial's \hgcmd{diff} command generates path names in this form,
    1.26 -and the \hgcmd{import} command and MQ expect patches to have a strip
    1.27 -count of one.
    1.28 -
    1.29 -If you receive a patch from someone that you want to add to your patch
    1.30 -queue, and the patch needs a strip count other than one, you cannot
    1.31 -just \hgxcmd{mq}{qimport} the patch, because \hgxcmd{mq}{qimport} does not yet
    1.32 -have a \texttt{-p} option (see~\bug{311}).  Your best bet is to
    1.33 -\hgxcmd{mq}{qnew} a patch of your own, then use \cmdargs{patch}{-p\emph{N}}
    1.34 -to apply their patch, followed by \hgcmd{addremove} to pick up any
    1.35 -files added or removed by the patch, followed by \hgxcmd{mq}{qrefresh}.
    1.36 -This complexity may become unnecessary; see~\bug{311} for details.
    1.37 -\subsection{Strategies for applying a patch}
    1.38 -
    1.39 -When \command{patch} applies a hunk, it tries a handful of
    1.40 -successively less accurate strategies to try to make the hunk apply.
    1.41 -This falling-back technique often makes it possible to take a patch
    1.42 -that was generated against an old version of a file, and apply it
    1.43 -against a newer version of that file.
    1.44 -
    1.45 -First, \command{patch} tries an exact match, where the line numbers,
    1.46 -the context, and the text to be modified must apply exactly.  If it
    1.47 -cannot make an exact match, it tries to find an exact match for the
    1.48 -context, without honouring the line numbering information.  If this
    1.49 -succeeds, it prints a line of output saying that the hunk was applied,
    1.50 -but at some \emph{offset} from the original line number.
    1.51 -
    1.52 -If a context-only match fails, \command{patch} removes the first and
    1.53 -last lines of the context, and tries a \emph{reduced} context-only
    1.54 -match.  If the hunk with reduced context succeeds, it prints a message
    1.55 -saying that it applied the hunk with a \emph{fuzz factor} (the number
    1.56 -after the fuzz factor indicates how many lines of context
    1.57 -\command{patch} had to trim before the patch applied).
    1.58 -
    1.59 -When neither of these techniques works, \command{patch} prints a
    1.60 -message saying that the hunk in question was rejected.  It saves
    1.61 -rejected hunks (also simply called ``rejects'') to a file with the
    1.62 -same name, and an added \sfilename{.rej} extension.  It also saves an
    1.63 -unmodified copy of the file with a \sfilename{.orig} extension; the
    1.64 -copy of the file without any extensions will contain any changes made
    1.65 -by hunks that \emph{did} apply cleanly.  If you have a patch that
    1.66 -modifies \filename{foo} with six hunks, and one of them fails to
    1.67 -apply, you will have: an unmodified \filename{foo.orig}, a
    1.68 -\filename{foo.rej} containing one hunk, and \filename{foo}, containing
    1.69 -the changes made by the five successful five hunks.
    1.70 -
    1.71 -\subsection{Some quirks of patch representation}
    1.72 -
    1.73 -There are a few useful things to know about how \command{patch} works
    1.74 -with files.
    1.75 +Como alguien que reciba un parche de Alicia en la red podría obtener
    1.76 +dos directorios, uno original y el otro modificado con exactamente los
    1.77 +mismos nombres, la orden \command{patch} tiene la opción
    1.78 +\cmdopt{patch}{-p} que indica la cantidad de componentes de la ruta
    1.79 +a eliminar cuando se vaya a aplicar el parche.  Este número se
    1.80 +llama la \emph{cantidad de eliminaciones}.
    1.81 +
    1.82 +La opción con ``\texttt{-p1}'' significa ``elimine uno''.  Si
    1.83 +\command{patch} ve un nombre de fichero \filename{foo/bar/baz} en el
    1.84 +encabezado del fichero, eliminará \filename{foo} y tratará de parchar
    1.85 +un fichero llamado \filename{bar/baz}.  (Hablando estrictamente, la
    1.86 +cantidad de eliminaciones se refiere a la cantidad de \emph{separadores de
    1.87 + ruta} (y los componentes que vayan con ellos) a eliminar.  Si el
    1.88 +contador es uno volverá \filename{foo/bar} en \filename{bar}, pero
    1.89 +\filename{/foo/bar} (note la barra extra) en \filename{foo/bar}.)
    1.90 +
    1.91 +La cantidad a eliminar``estándar'' para parches es uno; casi todos los
    1.92 +parches contienen un componente inicial de la ruta que necesita ser
    1.93 +eliminado.  La orden \hgcmd{diff} de Mercurial genera nombres de ruta
    1.94 +de esta forma, y la orden \hgcmd{import} y MQ esperan parches que
    1.95 +tengan a uno como cuenta de eliminaciones.
    1.96 +
    1.97 +Si recibe un parche de alguien de quien desea adicionar adicionar a su
    1.98 +cola de parches, y el parche necesita una cuenta de eliminación que no
    1.99 +sea uno, no podrá aplicar \hgxcmd{mq}{qimport} en primera medida,
   1.100 +porque \hgxcmd{mq}{qimport} no tiene todavía una opción \texttt{-p}
   1.101 +option (ver~\bug{311}).  Lo mejor que puede hacer es aplicar
   1.102 +\hgxcmd{mq}{qnew} por su cuenta, y después usar \cmdargs{patch}{-p\emph{N}}
   1.103 +para aplicar tal parche, seguido de \hgcmd{addremove} para tener en
   1.104 +cuenta cualquier fichero adicionado o eliminado por el parche, seguido
   1.105 +de \hgxcmd{mq}{qrefresh}.  Esta complejidad puede ser innecesaria;
   1.106 +consulte~\bug{311} para más información.
   1.107 +
   1.108 +\subsection{Estrategias para aplicar parches}
   1.109 +
   1.110 +Cuando \command{patch} aplica un trozo, intenta varias estrategias
   1.111 +sucesivas que decrecen en precisión para intentar aplicarlo.  Esta
   1.112 +técnica de pruebas y error aveces permite que un parche que fue
   1.113 +generado contra una versión anterior de un fichero, sea aplicada sobre
   1.114 +una versión más nueva del mismo.
   1.115 +
   1.116 +Primero \command{patch} intenta una correspondencia perfecta donde los
   1.117 +números de línea, el contexto y el texto a modificar deben coincidir
   1.118 +perfectamente.  Si no lo logra, intenta encontrar una correspondencia
   1.119 +exacta del contexto, sin tener en cuenta el número de línea.  Si es
   1.120 +exitoso, imprime una línea indicando que el trozo fue aplicado, pero a
   1.121 +un \emph{corrimiento} del número de línea original.
   1.122 +
   1.123 +Si falla la correspondencia por contexto, \command{patch} elimina la
   1.124 +primera y la última línea del contexto, e intenta una correspondencia
   1.125 +\emph{reducida} del contexto.  Si el trozo con contexto reducido es
   1.126 +exitoso, imprime un mensaje indicando que aplicó el trozo con un
   1.127 +\emph{factor difuso} (el número después del factor difuso indica
   1.128 +cuántas líneas de contexto \command{patch} tuvo que eliminar antes de
   1.129 +aplicar el parche).
   1.130 +
   1.131 +Cuando ninguna de estas técnicas funciona, \command{patch} imprime un
   1.132 +mensaje indicando que el trozo en cuestión se desechó.  Almacena los
   1.133 +trozos desechados(también llamados ``descartados'') en un fichero con
   1.134 +el mismo nombre, y la extensión \sfilename{.rej} añadida.  También
   1.135 +almacena una copia igual al fichero original con la extensión
   1.136 +\sfilename{.orig}; la copia del fichero sin extensión contendrá
   1.137 +cualquier cambio hecho por los trozos que \emph{sí} se aplicaron sin
   1.138 +problema.  Si usted tiene un parche que modifica \filename{foo} con
   1.139 +seis trozos, y uno de ellos falla al aplicarse, tendrá : un fichero
   1.140 +original \filename{foo.orig}, un fichero \filename{foo.rej} que
   1.141 +contiene el trozo, y \filename{foo}, que contiene los cambios que se
   1.142 +aplicaron por los cinco trozos exitosos.
   1.143 +
   1.144 +\subsection{Algunos detalles de la representación de parches}
   1.145 +
   1.146 +Hay ciertas cosas útiles por saber acerca de cómo trabaja
   1.147 +\command{patch} con los ficheros:
   1.148  \begin{itemize}
   1.149 -\item This should already be obvious, but \command{patch} cannot
   1.150 -  handle binary files.
   1.151 -\item Neither does it care about the executable bit; it creates new
   1.152 -  files as readable, but not executable.
   1.153 -\item \command{patch} treats the removal of a file as a diff between
   1.154 -  the file to be removed and the empty file.  So your idea of ``I
   1.155 -  deleted this file'' looks like ``every line of this file was
   1.156 -  deleted'' in a patch.
   1.157 -\item It treats the addition of a file as a diff between the empty
   1.158 -  file and the file to be added.  So in a patch, your idea of ``I
   1.159 -  added this file'' looks like ``every line of this file was added''.
   1.160 -\item It treats a renamed file as the removal of the old name, and the
   1.161 -  addition of the new name.  This means that renamed files have a big
   1.162 -  footprint in patches.  (Note also that Mercurial does not currently
   1.163 -  try to infer when files have been renamed or copied in a patch.)
   1.164 -\item \command{patch} cannot represent empty files, so you cannot use
   1.165 -  a patch to represent the notion ``I added this empty file to the
   1.166 -  tree''.
   1.167 +\item Debería ser obvio que \command{patch} no puede manipular
   1.168 +  ficheros binarios.
   1.169 +\item No se preocupa por el bit ejecutable; crea ficheros nuevos en
   1.170 +  modo lectura, pero no ejecutable.
   1.171 +\item \command{patch} intenta eliminar un fichero como una diferencia
   1.172 +  entre el fichero a eliminar y un fichero vacío.  Y por lo tanto su
   1.173 +  idea de ``Borré este fichero'' debería pensarse como ``toda línea de
   1.174 +  este fichero fue eliminada'' en un parche.
   1.175 +\item Trata la adición de un fichero como un diff entre un fichero
   1.176 +  vacío y el fichero a ser adicionado.  Por lo tanto en un parche su
   1.177 +  idea de ``Añadí este fichero'' se vería como ``toda línea de este
   1.178 +  fichero fue añadida''.
   1.179 +\item Trata el renombramiento de un fichero como la eliminación del
   1.180 +  nombre anterior y la adición del nuevo nombre.  Esto significa que
   1.181 +  los ficheros renombrados dejan un rastro grande en los parches.
   1.182 +  (Tenga en cuenta que Mercurial no trata de inferir cuando los
   1.183 +  archivos han sido renombrados o copiados en un parche en este
   1.184 +  momento.)
   1.185 +\item \command{patch} no puede representar ficheros vacíos, por lo
   1.186 +  tanto no puede usar un parche para representar la noción ``Añadí
   1.187 +  este fichero vacío al árbol''.
   1.188  \end{itemize}
   1.189 -\subsection{Beware the fuzz}
   1.190 +\subsection{Cuidado con los difusos}
   1.191  
   1.192  While applying a hunk at an offset, or with a fuzz factor, will often
   1.193  be completely successful, these inexact techniques naturally leave