hgbook

changeset 472:6880f9c8e7e7

Automated merge with http://mercurial.intuxication.org/hg/mercurial_book_es
author Igor Támara <igor@tamarapatino.org>
date Sun Dec 28 00:30:26 2008 -0500 (2008-12-28)
parents 339720510480 2449d5d3298e
children 1b8b19825994
files es/Leame.1st
line diff
     1.1 --- a/es/Leame.1st	Sat Dec 27 19:51:53 2008 -0500
     1.2 +++ b/es/Leame.1st	Sun Dec 28 00:30:26 2008 -0500
     1.3 @@ -108,7 +108,7 @@
     1.4  || hook.tex        || Javier Rojas  ||     53%    || 01/12/2008 ||             ||
     1.5  || mq.tex          || Igor Támara   ||    100%    || 06/12/2008 ||  13/12/2008 ||
     1.6  || hgext.tex       || Igor Támara   ||    100%    || 13/12/2008 ||  16/12/2008 ||
     1.7 -|| template.tex    || Igor Támara   ||            ||            ||             ||
     1.8 +|| template.tex    || Igor Támara   ||     40%    || 27/12/2008 ||             ||
     1.9  || mq-collab.tex   || Javier Rojas  ||            ||            ||             ||
    1.10  || mq-ref.tex      || Javier Rojas  ||            ||            ||             ||
    1.11  || cmdref.tex      ||               ||            ||            ||             ||
    1.12 @@ -163,6 +163,7 @@
    1.13   Commit: Consignar
    1.14   Core: alma
    1.15   Directory: Directorio
    1.16 + Escape Sequence: Secuencia de control
    1.17   File: fichero
    1.18   Filelog: fichero de registro
    1.19   Fold: Integrar
    1.20 @@ -172,6 +173,7 @@
    1.21   Merge: Fusión
    1.22   Milestone: Etapa
    1.23   Mistake: Equivocación, cometida por un humano
    1.24 + Output: salida o despliegue
    1.25   Patch: Parche
    1.26   Path: Ruta de archivo
    1.27   Pointer: apuntador
    1.28 @@ -188,6 +190,7 @@
    1.29   Stack: pila
    1.30   Sprint: sprint
    1.31   Tarball: paquete de cambios
    1.32 + Timestamp : marca de tiempo
    1.33   Tip: punta
    1.34   Update: actualización
    1.35   Upstream: principal, mantenedor principal. De acuerdo al contexto.
    1.36 @@ -390,7 +393,7 @@
    1.37       e integridad al devolver un conjunto de acciones que permitan dejar
    1.38       el repositorio en un estado consistente previo.
    1.39  
    1.40 -repository layout -> estructura del repositorio En referencia a cómo
    1.41 +repository layou t-> estructura del repositorio En referencia a cómo
    1.42      están organizados los directorios.
    1.43  
    1.44  schedule -> programa o planifica
     2.1 --- a/es/template.tex	Sat Dec 27 19:51:53 2008 -0500
     2.2 +++ b/es/template.tex	Sun Dec 28 00:30:26 2008 -0500
     2.3 @@ -1,144 +1,153 @@
     2.4 -\chapter{Customising the output of Mercurial}
     2.5 +\chapter{Personalizar los mensajes de Mercurial}
     2.6  \label{chap:template}
     2.7  
     2.8 -Mercurial provides a powerful mechanism to let you control how it
     2.9 -displays information.  The mechanism is based on templates.  You can
    2.10 -use templates to generate specific output for a single command, or to
    2.11 -customise the entire appearance of the built-in web interface.
    2.12 -
    2.13 -\section{Using precanned output styles}
    2.14 +Mercurial provee un poderoso mecanismo que permite controlar como
    2.15 +despliega la información.  El mecanismo se basa en plantillas.  Puede
    2.16 +usar plantillas para generar salida específica para una orden
    2.17 +particular o para especificar la visualización completa de la interfaz
    2.18 +web embebida.
    2.19 +
    2.20 +\section{Usar estilos que vienen con Mercurial}
    2.21  \label{sec:style}
    2.22  
    2.23 -Packaged with Mercurial are some output styles that you can use
    2.24 -immediately.  A style is simply a precanned template that someone
    2.25 -wrote and installed somewhere that Mercurial can find.
    2.26 -
    2.27 -Before we take a look at Mercurial's bundled styles, let's review its
    2.28 -normal output.
    2.29 +Hay ciertos estilos listos que vienen con Mercurial.  Un estilo es
    2.30 +simplemente una plantilla predeterminada que alguien escribió e
    2.31 +instaló en un sitio en el cual Mercurial puede encontrarla.
    2.32 +
    2.33 +Antes de dar un vistazo a los estilos que trae Mercurial, revisemos su
    2.34 +salida usual.
    2.35  
    2.36  \interaction{template.simple.normal}
    2.37  
    2.38 -This is somewhat informative, but it takes up a lot of space---five
    2.39 -lines of output per changeset.  The \texttt{compact} style reduces
    2.40 -this to three lines, presented in a sparse manner.
    2.41 +Es en cierta medida informativa, pero ocupa mucho espacio---cinco
    2.42 +líneas de salida por cada conjunto de cambios.  El estilo
    2.43 +\texttt{compact} lo reduce a tres líneas, presentadas de forma
    2.44 +suscinta.
    2.45  
    2.46  \interaction{template.simple.compact}
    2.47  
    2.48 -The \texttt{changelog} style hints at the expressive power of
    2.49 -Mercurial's templating engine.  This style attempts to follow the GNU
    2.50 -Project's changelog guidelines\cite{web:changelog}.
    2.51 +El estilo de la \texttt{bitácora de cambios} vislumbra el poder
    2.52 +expresivo del sistema de plantillas de Mercurial.  Este estilo busca
    2.53 +seguir los estándares de bitácora de cambios del proyecto
    2.54 +GNU\cite{web:changelog}.
    2.55  
    2.56  \interaction{template.simple.changelog}
    2.57  
    2.58 -You will not be shocked to learn that Mercurial's default output style
    2.59 -is named \texttt{default}.
    2.60 -
    2.61 -\subsection{Setting a default style}
    2.62 -
    2.63 -You can modify the output style that Mercurial will use for every
    2.64 -command by editing your \hgrc\ file, naming the style you would
    2.65 -prefer to use.
    2.66 +No es una sorpresa que el estilo predeterminado de Mercurial se llame
    2.67 +\texttt{default}\ndt{predeterminado}.
    2.68 +
    2.69 +\subsection{Especificar un estilo predeterminado}
    2.70 +
    2.71 +Puede modificar el estilo de presentación que Mercurial usará para
    2.72 +toda orden vía el fichero \hgrc\, indicando el estilo que prefiere
    2.73 +usar.
    2.74  
    2.75  \begin{codesample2}
    2.76    [ui]
    2.77    style = compact
    2.78  \end{codesample2}
    2.79  
    2.80 -If you write a style of your own, you can use it by either providing
    2.81 -the path to your style file, or copying your style file into a
    2.82 -location where Mercurial can find it (typically the \texttt{templates}
    2.83 -subdirectory of your Mercurial install directory).
    2.84 -
    2.85 -\section{Commands that support styles and templates}
    2.86 -
    2.87 -All of Mercurial's ``\texttt{log}-like'' commands let you use styles
    2.88 -and templates: \hgcmd{incoming}, \hgcmd{log}, \hgcmd{outgoing}, and
    2.89 -\hgcmd{tip}.
    2.90 -
    2.91 -As I write this manual, these are so far the only commands that
    2.92 -support styles and templates.  Since these are the most important
    2.93 -commands that need customisable output, there has been little pressure
    2.94 -from the Mercurial user community to add style and template support to
    2.95 -other commands.
    2.96 -
    2.97 -\section{The basics of templating}
    2.98 -
    2.99 -At its simplest, a Mercurial template is a piece of text.  Some of the
   2.100 -text never changes, while other parts are \emph{expanded}, or replaced
   2.101 -with new text, when necessary.
   2.102 -
   2.103 -Before we continue, let's look again at a simple example of
   2.104 -Mercurial's normal output.
   2.105 +Si escribe un estilo, puede usarlo bien sea proveyendo la ruta a su
   2.106 +fichero de estilo o copiando su fichero de estilo a un lugar en el
   2.107 +cual Mercurial pueda encontrarlo(típicamente el subdirectorio
   2.108 +\texttt{templates} de su directorio de instalación de Mercurial).
   2.109 +
   2.110 +\section{Órdenes que soportan estilos y plantillas}
   2.111 +
   2.112 +Todas las órdenes de Mercurial``relacionadas con \texttt{log}'' le
   2.113 +permiten usar estilos y plantillas: \hgcmd{incoming}, \hgcmd{log},
   2.114 +\hgcmd{outgoing} y \hgcmd{tip}.
   2.115 +
   2.116 +Al momento de la escritura del manual estas son las únicas órdenes que
   2.117 +soportan estilos y plantillas.  Dado que son las órdenes más
   2.118 +importantes que necesitan personalización, no ha habido muchas
   2.119 +solicitudes desde la comunidad de usuarios de Mercurial para añadir
   2.120 +soporte de plantillas y estilos a otras órdenes.
   2.121 +
   2.122 +\section{Cuestiones básicas de plantillas}
   2.123 +
   2.124 +Una plantilla de Mercurial es sencillamente una pieza de texto.
   2.125 +Cierta porción nunca cambia, otras partes se \emph{expanden}, o
   2.126 +reemplazan con texto nuevo cuando es necesario.
   2.127 +
   2.128 +Antes de continuar, veamos de nuevo un ejemplo sencillo de la salida
   2.129 +usual de Mercurial:
   2.130  
   2.131  \interaction{template.simple.normal}
   2.132  
   2.133 -Now, let's run the same command, but using a template to change its
   2.134 -output.
   2.135 +Ahora, ejecutemos la misma orden, pero usemos una plantilla para
   2.136 +modificar su salida:
   2.137  
   2.138  \interaction{template.simple.simplest}
   2.139  
   2.140 -The example above illustrates the simplest possible template; it's
   2.141 -just a piece of static text, printed once for each changeset.  The
   2.142 -\hgopt{log}{--template} option to the \hgcmd{log} command tells
   2.143 -Mercurial to use the given text as the template when printing each
   2.144 -changeset.
   2.145 -
   2.146 -Notice that the template string above ends with the text
   2.147 -``\Verb+\n+''.  This is an \emph{escape sequence}, telling Mercurial
   2.148 -to print a newline at the end of each template item.  If you omit this
   2.149 -newline, Mercurial will run each piece of output together.  See
   2.150 -section~\ref{sec:template:escape} for more details of escape sequences.
   2.151 -
   2.152 -A template that prints a fixed string of text all the time isn't very
   2.153 -useful; let's try something a bit more complex.
   2.154 +El ejemplo anterior ilustra la plantilla más sencilla posible;  es
   2.155 +solamente una porción estática de código que se imprime una vez por
   2.156 +cada conjunto de cambios.  La opción \hgopt{log}{--template} de la
   2.157 +orden \hgcmd{log} indica a Mercurial usar el texto dado como la
   2.158 +plantilla cuando se imprime cada conjunto de cambios.
   2.159 +
   2.160 +Observe que la cadena de plantilla anterior termina con el texto
   2.161 +``\Verb+\n+''.  Es una \emph{secuencia de control}, que le indica a
   2.162 +Mercurial imprimira una nueva línea al final de cada objeto de la
   2.163 +plantilla.  Si omite esta nueva línea, Mercurial colocará cada pieza
   2.164 +de salida seguida.  Si desea más detalles acerca de secuencias de
   2.165 +control, vea la sección~\ref{sec:template:escape}.
   2.166 +
   2.167 +Una plantilla que imprime una cadena fija de texto siempre no es muy
   2.168 +útil; intentemos algo un poco más complejo.
   2.169  
   2.170  \interaction{template.simple.simplesub}
   2.171  
   2.172 -As you can see, the string ``\Verb+{desc}+'' in the template has been
   2.173 -replaced in the output with the description of each changeset.  Every
   2.174 -time Mercurial finds text enclosed in curly braces (``\texttt{\{}''
   2.175 -and ``\texttt{\}}''), it will try to replace the braces and text with
   2.176 -the expansion of whatever is inside.  To print a literal curly brace,
   2.177 -you must escape it, as described in section~\ref{sec:template:escape}.
   2.178 -
   2.179 -\section{Common template keywords}
   2.180 +Como puede ver, la cadena ``\Verb+{desc}+'' en la plantilla ha sido
   2.181 +reemplazada en la salida con la descricipción de cada conjunto de
   2.182 +cambios.  Cada vez que Mercurial encuentra texto encerrado entre
   2.183 +corchetes(``\texttt{\{}'' y ``\texttt{\}}''), intentará reemplazar los
   2.184 +corchetes y el texto con la expansión de lo que sea está adentro.
   2.185 +Para imprimir un corchete de forma literal, debe escaparlo, como se
   2.186 +describe en la sección~\ref{sec:template:escape}.
   2.187 +
   2.188 +\section{Palabras claves más comunes en las plantillas}
   2.189  \label{sec:template:keyword}
   2.190  
   2.191 -You can start writing simple templates immediately using the keywords
   2.192 -below.
   2.193 -
   2.194 -\begin{itemize}
   2.195 -\item[\tplkword{author}] String.  The unmodified author of the changeset.
   2.196 -\item[\tplkword{branches}] String.  The name of the branch on which
   2.197 -  the changeset was committed.  Will be empty if the branch name was
   2.198 +Puede empezar a escribir plantillas sencillas rápidamente con las
   2.199 +palabras claves descritas a continuación:
   2.200 +
   2.201 +\begin{itemize}
   2.202 +\item[\tplkword{author}] Cadena.  El autor NO modificado del conjunto
   2.203 +  de cambios.
   2.204 +\item[\tplkword{branches}] Cadena.  El nombre de la rama en la cual se
   2.205 +  consignó el conjunto de cambios.  Será vacía si el nombre de la rama es
   2.206    \texttt{default}.
   2.207 -\item[\tplkword{date}] Date information.  The date when the changeset
   2.208 -  was committed.  This is \emph{not} human-readable; you must pass it
   2.209 -  through a filter that will render it appropriately.  See
   2.210 -  section~\ref{sec:template:filter} for more information on filters.
   2.211 -  The date is expressed as a pair of numbers.  The first number is a
   2.212 -  Unix UTC timestamp (seconds since January 1, 1970); the second is
   2.213 -  the offset of the committer's timezone from UTC, in seconds.
   2.214 -\item[\tplkword{desc}] String.  The text of the changeset description.
   2.215 -\item[\tplkword{files}] List of strings.  All files modified, added, or
   2.216 -  removed by this changeset.
   2.217 -\item[\tplkword{file\_adds}] List of strings.  Files added by this
   2.218 -  changeset.
   2.219 -\item[\tplkword{file\_dels}] List of strings.  Files removed by this
   2.220 -  changeset.
   2.221 -\item[\tplkword{node}] String.  The changeset identification hash, as a
   2.222 -  40-character hexadecimal string.
   2.223 -\item[\tplkword{parents}] List of strings.  The parents of the
   2.224 -  changeset.
   2.225 -\item[\tplkword{rev}] Integer.  The repository-local changeset revision
   2.226 -  number.
   2.227 -\item[\tplkword{tags}] List of strings.  Any tags associated with the
   2.228 -  changeset.
   2.229 -\end{itemize}
   2.230 -
   2.231 -A few simple experiments will show us what to expect when we use these
   2.232 -keywords; you can see the results in
   2.233 -figure~\ref{fig:template:keywords}.
   2.234 +\item[\tplkword{date}] Información de fecha.  La fecha en la cual se
   2.235 +  consignó el conjunto de cambios.  \emph{No} es legible por un
   2.236 +  humano, debe pasarla por un firltro que la desplegará
   2.237 +  apropiadamente.  En la sección~\ref{sec:template:filter} hay más
   2.238 +  detalles acerca de filtros.  La fecha se expresa como un par de
   2.239 +  números.  El primer número corresponde a una marca de tiempo UNIX
   2.240 +  UTC(segundos desde el primero de enero de 1970); la segunda es el
   2.241 +  corrimiento horario de la zona horaria del UTC en la cual se encontraba
   2.242 +  quien hizo la consignación, en segundos.
   2.243 +\item[\tplkword{desc}] Cadena.  La descripción en texto del conjunto
   2.244 +  de cambios.
   2.245 +\item[\tplkword{files}] Lista de cadenas.  Todos los ficheros
   2.246 +  modificados, adicionados o eliminados por este conjunto de cambios.
   2.247 +\item[\tplkword{file\_adds}] Lista de cadenas.  Ficheros adicionados
   2.248 +  por este conjunto de cambios.
   2.249 +\item[\tplkword{file\_dels}] Lista de cadenas.  Ficheros eliminados
   2.250 +  por este conjunto de cambios.
   2.251 +\item[\tplkword{node}] Cadena.  El hash de identificación de este
   2.252 +  conjunto de cambios como una cadena hexadecimal de 40 caracteres.
   2.253 +\item[\tplkword{parents}] Lista de cadenas.  Los ancestros del
   2.254 +  conjunto de cambios.
   2.255 +\item[\tplkword{rev}] Entero.  El número de revisión del repositorio
   2.256 +  local.
   2.257 +\item[\tplkword{tags}] Lista de cadenas.  Todas las etiquetas
   2.258 +  asociadas al conjunto de cambios.
   2.259 +\end{itemize}
   2.260 +
   2.261 +Unos experimentos sencillos nos mostrarán qué esperar cuando usamos
   2.262 +estas palabras claves; puede ver los resultados en la
   2.263 +figura~\ref{fig:template:keywords}.
   2.264  
   2.265  \begin{figure}
   2.266    \interaction{template.simple.keywords}
   2.267 @@ -146,61 +155,63 @@
   2.268    \label{fig:template:keywords}
   2.269  \end{figure}
   2.270  
   2.271 -As we noted above, the date keyword does not produce human-readable
   2.272 -output, so we must treat it specially.  This involves using a
   2.273 -\emph{filter}, about which more in section~\ref{sec:template:filter}.
   2.274 +Como mencionamos anteriormente, la palabra clave de fecha no produce
   2.275 +salida legible por un humano, debemos tratarla de forma especial.
   2.276 +Esto involucra usar un \emph{filtro}, acerca de lo cual hay más en la
   2.277 +sección~\ref{sec:template:filter}.
   2.278  
   2.279  \interaction{template.simple.datekeyword}
   2.280  
   2.281 -\section{Escape sequences}
   2.282 +\section{Secuencias de Control}
   2.283  \label{sec:template:escape}
   2.284  
   2.285 -Mercurial's templating engine recognises the most commonly used escape
   2.286 -sequences in strings.  When it sees a backslash (``\Verb+\+'')
   2.287 -character, it looks at the following character and substitutes the two
   2.288 -characters with a single replacement, as described below.
   2.289 +El motor de plantillas de Mercurial reconoce las secuencias de control
   2.290 +más comunmente usadas dentro de las cadenas.  Cuando ve un backslash
   2.291 +(``\Verb+\+''), ve el caracter siguiente y sustituye los dos
   2.292 +caracteres con un reemplazo sencillo, como se describe a continuación:
   2.293  
   2.294  \begin{itemize}
   2.295  \item[\Verb+\textbackslash\textbackslash+] Backslash, ``\Verb+\+'',
   2.296    ASCII~134.
   2.297 -\item[\Verb+\textbackslash n+] Newline, ASCII~12.
   2.298 -\item[\Verb+\textbackslash r+] Carriage return, ASCII~15.
   2.299 +\item[\Verb+\textbackslash n+] Nueva línea, ASCII~12.
   2.300 +\item[\Verb+\textbackslash r+] Cambio de línea, ASCII~15.
   2.301  \item[\Verb+\textbackslash t+] Tab, ASCII~11.
   2.302 -\item[\Verb+\textbackslash v+] Vertical tab, ASCII~13.
   2.303 -\item[\Verb+\textbackslash \{+] Open curly brace, ``\Verb+{+'', ASCII~173.
   2.304 -\item[\Verb+\textbackslash \}+] Close curly brace, ``\Verb+}+'', ASCII~175.
   2.305 -\end{itemize}
   2.306 -
   2.307 -As indicated above, if you want the expansion of a template to contain
   2.308 -a literal ``\Verb+\+'', ``\Verb+{+'', or ``\Verb+{+'' character, you
   2.309 -must escape it.
   2.310 -
   2.311 -\section{Filtering keywords to change their results}
   2.312 +\item[\Verb+\textbackslash v+] Tab Vertical, ASCII~13.
   2.313 +\item[\Verb+\textbackslash \{+] Corchete abierto, ``\Verb+{+'', ASCII~173.
   2.314 +\item[\Verb+\textbackslash \}+] Corchete cerrado, ``\Verb+}+'', ASCII~175.
   2.315 +\end{itemize}
   2.316 +
   2.317 +Como se indicó arriba, si desea que la expansión en una plantilla
   2.318 +contenga un caracter literal ``\Verb+\+'', ``\Verb+{+'', o
   2.319 +  ``\Verb+{+'', debe escaparlo.
   2.320 +
   2.321 +\section{Uso de filtros con palabras claves}
   2.322  \label{sec:template:filter}
   2.323  
   2.324 -Some of the results of template expansion are not immediately easy to
   2.325 -use.  Mercurial lets you specify an optional chain of \emph{filters}
   2.326 -to modify the result of expanding a keyword.  You have already seen a
   2.327 -common filter, \tplkwfilt{date}{isodate}, in action above, to make a
   2.328 -date readable.
   2.329 -
   2.330 -Below is a list of the most commonly used filters that Mercurial
   2.331 -supports.  While some filters can be applied to any text, others can
   2.332 -only be used in specific circumstances.  The name of each filter is
   2.333 -followed first by an indication of where it can be used, then a
   2.334 -description of its effect.
   2.335 -
   2.336 -\begin{itemize}
   2.337 -\item[\tplfilter{addbreaks}] Any text. Add an XHTML ``\Verb+<br/>+''
   2.338 -  tag before the end of every line except the last.  For example,
   2.339 -  ``\Verb+foo\nbar+'' becomes ``\Verb+foo<br/>\nbar+''.
   2.340 -\item[\tplkwfilt{date}{age}] \tplkword{date} keyword.  Render the
   2.341 -  age of the date, relative to the current time.  Yields a string like
   2.342 +Algunos de los resultados de la expansión de la plantilla no son
   2.343 +fáciles de usar de inmediato.  Mercurial le permite especificar una
   2.344 +cadena de \emph{filtros} opcionales para modificar el resultado de
   2.345 +expandir una palabra clave.  Ya ha visto el filtro usual
   2.346 +\tplkwfilt{date}{isodate} en acción con anterioridad para hacer
   2.347 +legible la fecha.
   2.348 +
   2.349 +A continuación hay una lista de los filtros de Mercurial más
   2.350 +comunmente usados.  Ciertos filtros pueden aplicarse a cualquier
   2.351 +texto, otros pueden usarse únicamente en circunstancias específicas.
   2.352 +El nombre de cada filtro está seguido de la indicación de dónde puede
   2.353 +ser usado y una descripción de su efecto.
   2.354 +
   2.355 +\begin{itemize}
   2.356 +\item[\tplfilter{addbreaks}] Cualquier texto. Añade una etiqueta XHTML
   2.357 +  ``\Verb+<br/>+'' antes del final de cada línea excepto en la final.
   2.358 +  Por ejemplo, ``\Verb+foo\nbar+'' se convierte en ``\Verb+foo<br/>\nbar+''.
   2.359 +\item[\tplkwfilt{date}{age}] palabra clave \tplkword{date}.  Muestra
   2.360 +  la edad de la fecha, relativa al tiempo actual. Ofrece una cadena como
   2.361    ``\Verb+10 minutes+''.
   2.362 -\item[\tplfilter{basename}] Any text, but most useful for the
   2.363 -  \tplkword{files} keyword and its relatives.  Treat the text as a
   2.364 -  path, and return the basename. For example, ``\Verb+foo/bar/baz+''
   2.365 -  becomes ``\Verb+baz+''.
   2.366 +\item[\tplfilter{basename}] Cualquier texto, pero de utilidad sobre
   2.367 +  todo en palabras claves relativas a \tplkword{ficheros}.  Trata el
   2.368 +  texto como una ruta, retornando el nombre base.  Por ejemplo,
   2.369 +  ``\Verb+foo/bar/baz+'', se convierte en ``\Verb+baz+''.
   2.370  \item[\tplkwfilt{date}{date}] \tplkword{date} keyword.  Render a date
   2.371    in a similar format to the Unix \tplkword{date} command, but with
   2.372    timezone included.  Yields a string like