hgbook
diff es/tour-basic.tex @ 371:0801d625fabe
translated up to section 1.8
updated also the status of the project
updated also the status of the project
author | Javier Rojas <jerojasro@devnull.li> |
---|---|
date | Sun Oct 26 17:39:41 2008 -0500 (2008-10-26) |
parents | 1d31f4902e62 |
children | b73654de597e |
line diff
1.1 --- a/es/tour-basic.tex Sun Oct 26 12:20:09 2008 -0500 1.2 +++ b/es/tour-basic.tex Sun Oct 26 17:39:41 2008 -0500 1.3 @@ -369,10 +369,10 @@ 1.4 repositorios no consume demasiados recursos, lo que facilita hacerlo 1.5 en cualquier momento. 1.6 1.7 -En nuestro repositorio \dirname{my-hello}, hay un archivo 1.8 +En nuestro repositorio \dirname{my-hello}, hay un fichero 1.9 \filename{hello.c} que contiene el clásico programa ``hello, 1.10 world''\ndt{Hola, mundo.}. Usaremos el clásico y venerado comando 1.11 -\command{sed} para editar este archivo y hacer que imprima una segunda 1.12 +\command{sed} para editar este fichero y hacer que imprima una segunda 1.13 línea de salida. (Estoy usando el comando \command{sed} para hacer 1.14 esto sólo porque es fácil escribir un ejemplo automatizado con él. 1.15 Dado que usted no tiene esta restricción, probablemente no querrá usar 1.16 @@ -380,167 +380,182 @@ 1.17 \interaction{tour.sed} 1.18 1.19 El comando \hgcmd{status} de Mercurial nos dice lo que Mercurial sabe 1.20 -acerca de los archivos en el repositorio. 1.21 +acerca de los ficheros en el repositorio. 1.22 \interaction{tour.status} 1.23 -El comando \hgcmd{status} no imprime nada para algunos archivos, sólo 1.24 +El comando \hgcmd{status} no imprime nada para algunos ficheros, sólo 1.25 una línea empezando con ``\texttt{M}'' para el fichero 1.26 \filename{hello.c}. A menos que usted lo indique explícitamente, 1.27 -\hgcmd{status} no imprimirá nada respecto a los archivos que no han 1.28 +\hgcmd{status} no imprimirá nada respecto a los ficheros que no han 1.29 sido modificados. 1.30 1.31 La ``\texttt{M}'' indica que Mercurial se dio cuenta de que nosotros 1.32 modificamos \filename{hello.c}. No tuvimos que \emph{decirle} a 1.33 -Mercurial que íbamos a modificar ese archivo antes de hacerlo, o que 1.34 +Mercurial que íbamos a modificar ese fichero antes de hacerlo, o que 1.35 lo modificamos una vez terminamos de hacerlo; él fue capaz de darse 1.36 cuenta de esto por sí mismo. 1.37 1.38 -Es algo útil saber que hemos modificado el archivo \filename{hello.c}, 1.39 +Es algo útil saber que hemos modificado el fichero \filename{hello.c}, 1.40 pero preferiríamos saber exactamente \emph{qué} cambios hicimos. 1.41 Para averiguar esto, usamos el comando \hgcmd{diff}. 1.42 \interaction{tour.diff} 1.43 1.44 -\section{Recording changes in a new changeset} 1.45 - 1.46 -We can modify files, build and test our changes, and use 1.47 -\hgcmd{status} and \hgcmd{diff} to review our changes, until we're 1.48 -satisfied with what we've done and arrive at a natural stopping point 1.49 -where we want to record our work in a new changeset. 1.50 - 1.51 -The \hgcmd{commit} command lets us create a new changeset; we'll 1.52 -usually refer to this as ``making a commit'' or ``committing''. 1.53 - 1.54 -\subsection{Setting up a username} 1.55 - 1.56 -When you try to run \hgcmd{commit} for the first time, it is not 1.57 -guaranteed to succeed. Mercurial records your name and address with 1.58 -each change that you commit, so that you and others will later be able 1.59 -to tell who made each change. Mercurial tries to automatically figure 1.60 -out a sensible username to commit the change with. It will attempt 1.61 -each of the following methods, in order: 1.62 +\section{Grabar cambios en un nuevo conjunto de cambios} 1.63 + 1.64 +Podemos modificar, compilar y probar nuestros cambios, y usar 1.65 +\hgcmd{status} y \hgcmd{diff} para revisar los mismos, hasta que 1.66 +estemos satisfechos con los resultados y lleguemos a un momento en el 1.67 +que sea natural que querramos guardar nuestro trabajo en un nuevo 1.68 +conjunto de cambios. 1.69 + 1.70 +El comando \hgcmd{commit} nos permite crear un nuevo conjunto de 1.71 +cambios. Nos referiremos usualmente a esto como ``hacer una consigna'' 1.72 +o consignar. 1.73 + 1.74 +\subsection{Definir un nombre de usuario} 1.75 + 1.76 +Cuando usted trata de ejecutar \hgcmd{commit}\ndt{Hacer una 1.77 +consignación} por primera vez, no está garantizado que lo logre. 1.78 +Mercurial registra su nombre y dirección en cada cambio que usted 1.79 +consigna, para que más adelante otros puedan saber quién es el 1.80 +responsable de cada cambio. Mercurial trata de encontrar un nombre de 1.81 +% TODO consigna o consignación? 1.82 +usuario adecuado con el cual registrar la consignación. Se intenta con 1.83 +cada uno de los siguientes métodos, en el orden presentado. 1.84 \begin{enumerate} 1.85 -\item If you specify a \hgopt{commit}{-u} option to the \hgcmd{commit} 1.86 - command on the command line, followed by a username, this is always 1.87 - given the highest precedence. 1.88 -\item If you have set the \envar{HGUSER} environment variable, this is 1.89 - checked next. 1.90 -\item If you create a file in your home directory called 1.91 - \sfilename{.hgrc}, with a \rcitem{ui}{username} entry, that will be 1.92 - used next. To see what the contents of this file should look like, 1.93 - refer to section~\ref{sec:tour-basic:username} below. 1.94 -\item If you have set the \envar{EMAIL} environment variable, this 1.95 - will be used next. 1.96 -\item Mercurial will query your system to find out your local user 1.97 - name and host name, and construct a username from these components. 1.98 - Since this often results in a username that is not very useful, it 1.99 - will print a warning if it has to do this. 1.100 +\item Si usted pasa la opción \hgopt{commit}{-u} al comando \hgcmd{commit} 1.101 + en la línea de comandos, seguido de un nombre de usuario, se le da a 1.102 + esto la máxima precedencia. 1.103 +\item A continuación se revisa si usted ha definido la variable de 1.104 + entorno \envar{HGUSER}. 1.105 +\item Si usted crea un fichero en su directorio personal llamado 1.106 + \sfilename{.hgrc}, con una entrada \rcitem{ui}{username}, se usa 1.107 + luego. Para revisar cómo debe verse este fichero, refiérase a la 1.108 + sección~\ref{sec:tour-basic:username} más abajo. 1.109 +\item Si usted ha definido la variable de entorno \envar{EMAIL}, será 1.110 + usada a continuación. 1.111 +\item Mercurial le pedirá a su sistema buscar su nombre de usuario 1.112 + % TODO host => máquina 1.113 + local, y el nombre de máquina, y construirá un nombre de usuario a 1.114 + partir de estos componentes. Ya que esto generalmente termina 1.115 + generando un nombre de usuario no muy útil, se imprimirá una 1.116 + advertencia si es necesario hacerlo. 1.117 \end{enumerate} 1.118 -If all of these mechanisms fail, Mercurial will fail, printing an 1.119 -error message. In this case, it will not let you commit until you set 1.120 -up a username. 1.121 - 1.122 -You should think of the \envar{HGUSER} environment variable and the 1.123 -\hgopt{commit}{-u} option to the \hgcmd{commit} command as ways to 1.124 -\emph{override} Mercurial's default selection of username. For normal 1.125 -use, the simplest and most robust way to set a username for yourself 1.126 -is by creating a \sfilename{.hgrc} file; see below for details. 1.127 - 1.128 -\subsubsection{Creating a Mercurial configuration file} 1.129 +Si todos estos procedimientos fallan, Mercurial fallará, e imprimirá 1.130 +un mensaje de error. En este caso, no le permitirá hacer la 1.131 +consignación hasta que usted defina un nombre de usuario. 1.132 + 1.133 +Trate de ver la variable de entorno \envar{HGUSER} y la opción 1.134 +\hgopt{commit}{-u} del comando \hgcmd{commit} como formas de 1.135 +\emph{hacer caso omiso} de la selección de nombre de usuario que 1.136 +Mercurial hace normalmente. Para uso normal, la manera más simple y 1.137 +sencilla de definir un nombre de usuario para usted es crear un 1.138 +fichero \sfilename{.hgrc}; los detalles se encuentran más adelante. 1.139 + 1.140 +\subsubsection{Crear el fichero de configuración de Mercurial} 1.141 \label{sec:tour-basic:username} 1.142 1.143 -To set a user name, use your favourite editor to create a file called 1.144 -\sfilename{.hgrc} in your home directory. Mercurial will use this 1.145 -file to look up your personalised configuration settings. The initial 1.146 -contents of your \sfilename{.hgrc} should look like this. 1.147 +Para definir un nombre de usuario, use su editor de texto favorito 1.148 +para crear un fichero llamado \sfilename{.hgrc} en su directorio 1.149 +personal. Mercurial usará este fichero para obtener las 1.150 +configuraciones personalizadas que usted haya hecho. El contenido 1.151 +inicial de su fichero \sfilename{.hgrc} debería verse así. 1.152 \begin{codesample2} 1.153 - # This is a Mercurial configuration file. 1.154 + # Este es un fichero de configuración de Mercurial. 1.155 [ui] 1.156 - username = Firstname Lastname <email.address@domain.net> 1.157 + username = Primernombre Apellido <correo.electronico@dominio.net> 1.158 \end{codesample2} 1.159 -The ``\texttt{[ui]}'' line begins a \emph{section} of the config file, 1.160 -so you can read the ``\texttt{username = ...}'' line as meaning ``set 1.161 -the value of the \texttt{username} item in the \texttt{ui} section''. 1.162 -A section continues until a new section begins, or the end of the 1.163 -file. Mercurial ignores empty lines and treats any text from 1.164 -``\texttt{\#}'' to the end of a line as a comment. 1.165 - 1.166 -\subsubsection{Choosing a user name} 1.167 - 1.168 -You can use any text you like as the value of the \texttt{username} 1.169 -config item, since this information is for reading by other people, 1.170 -but for interpreting by Mercurial. The convention that most people 1.171 -follow is to use their name and email address, as in the example 1.172 -above. 1.173 +La línea ``\texttt{[ui]}'' define una \emph{section} del fichero de 1.174 +configuración, así que usted puede leer la línea ``\texttt{username = 1.175 +...}'' como ``defina el valor del elemento \texttt{username} en la 1.176 +sección \texttt{ui}''. 1.177 +Una sección continua hasta que empieza otra nueva, o se llega al final 1.178 +del fichero. Mercurial ignora las líneas vacías y considera cualquier 1.179 +texto desde el caracter ``\texttt{\#}'' hasta el final de la línea 1.180 +como un comentario. 1.181 + 1.182 +\subsubsection{Escoger un nombre de usuario} 1.183 + 1.184 +Usted puede usar el texto que desee como el valor del campo de 1.185 +configuración \texttt{username}, ya que esta información será leída 1.186 +por otras personas, e interpretada por Mercurial. La convención que 1.187 +sigue la mayoría de la gente es usar su nombre y dirección de correo, 1.188 +como en el ejemplo anterior. 1.189 1.190 \begin{note} 1.191 - Mercurial's built-in web server obfuscates email addresses, to make 1.192 - it more difficult for the email harvesting tools that spammers use. 1.193 - This reduces the likelihood that you'll start receiving more junk 1.194 - email if you publish a Mercurial repository on the web. 1.195 + % TODO web 1.196 + El servidor web integrado de Mercurial ofusca las direcciones de 1.197 + correo, para dificultar la tarea de las herramientas de 1.198 + recolección de direcciones de correo que usan los 1.199 + spammers\ndt{Personas que envían correo no solicitado, también 1.200 + conocido como correo basura}. Esto reduce la probabilidad de que 1.201 + usted empiece a recibir más correo basura si publica un 1.202 + repositorio en la red. 1.203 \end{note} 1.204 1.205 -\subsection{Writing a commit message} 1.206 - 1.207 -When we commit a change, Mercurial drops us into a text editor, to 1.208 -enter a message that will describe the modifications we've made in 1.209 -this changeset. This is called the \emph{commit message}. It will be 1.210 -a record for readers of what we did and why, and it will be printed by 1.211 -\hgcmd{log} after we've finished committing. 1.212 +\subsection{Escribir un mensaje de consignación} 1.213 + 1.214 +Cuando consignamos un cambio, Mercurial nos ubica dentro de un editor 1.215 +de texto, para ingresar un mensaje que describa las modificaciones que 1.216 +hemos introducido en este conjunto de cambios. Esto es conocido como 1.217 +un \emph{mensaje de consignación}. Será un registro de lo que hicimos 1.218 +y porqué lo hicimos, y será impreso por \hgcmd{log} una vez hayamos 1.219 +hecho la consignación. 1.220 \interaction{tour.commit} 1.221 1.222 -The editor that the \hgcmd{commit} command drops us into will contain 1.223 -an empty line, followed by a number of lines starting with 1.224 -``\texttt{HG:}''. 1.225 +El editor en que \hgcmd{commit} nos ubica contendrá una línea vacía, 1.226 +seguida de varias líneas que empiezan con la cadena ``\texttt{HG:}''. 1.227 \begin{codesample2} 1.228 - \emph{empty line} 1.229 + \emph{línea vacía} 1.230 HG: changed hello.c 1.231 \end{codesample2} 1.232 -Mercurial ignores the lines that start with ``\texttt{HG:}''; it uses 1.233 -them only to tell us which files it's recording changes to. Modifying 1.234 -or deleting these lines has no effect. 1.235 - 1.236 -\subsection{Writing a good commit message} 1.237 - 1.238 -Since \hgcmd{log} only prints the first line of a commit message by 1.239 -default, it's best to write a commit message whose first line stands 1.240 -alone. Here's a real example of a commit message that \emph{doesn't} 1.241 -follow this guideline, and hence has a summary that is not readable. 1.242 +Mercurial ignora las líneas que empiezan con ``\texttt{HG:}''; sólo 1.243 +las usa para indicarnos para cuáles ficheros está registrando los 1.244 +cambios. Modificar o borrar estas líneas no tiene ningún efecto. 1.245 + 1.246 +\subsection{Escribir un buen mensaje de consignación} 1.247 + 1.248 +Ya que por defecto \hgcmd{log} sólo muestra la primera línea de un 1.249 +mensaje de consignación, lo mejor es escribir un mensaje cuya primera 1.250 +línea tenga significado por sí misma. A continuación se encuentra un 1.251 +ejemplo de un mensaje de consignación que \emph{no} sigue esta 1.252 +pauta, y debido a ello tiene un sumario que no es legible. 1.253 \begin{codesample2} 1.254 changeset: 73:584af0e231be 1.255 - user: Censored Person <censored.person@example.org> 1.256 + user: Persona Censurada <persona.censurada@ejemplo.org> 1.257 date: Tue Sep 26 21:37:07 2006 -0700 1.258 - summary: include buildmeister/commondefs. Add an exports and install 1.259 + summary: se incluye buildmeister/commondefs. Añade un módulo 1.260 \end{codesample2} 1.261 1.262 -As far as the remainder of the contents of the commit message are 1.263 -concerned, there are no hard-and-fast rules. Mercurial itself doesn't 1.264 -interpret or care about the contents of the commit message, though 1.265 -your project may have policies that dictate a certain kind of 1.266 -formatting. 1.267 - 1.268 -My personal preference is for short, but informative, commit messages 1.269 -that tell me something that I can't figure out with a quick glance at 1.270 -the output of \hgcmdargs{log}{--patch}. 1.271 - 1.272 -\subsection{Aborting a commit} 1.273 - 1.274 -If you decide that you don't want to commit while in the middle of 1.275 -editing a commit message, simply exit from your editor without saving 1.276 -the file that it's editing. This will cause nothing to happen to 1.277 -either the repository or the working directory. 1.278 - 1.279 -If we run the \hgcmd{commit} command without any arguments, it records 1.280 -all of the changes we've made, as reported by \hgcmd{status} and 1.281 -\hgcmd{diff}. 1.282 - 1.283 -\subsection{Admiring our new handiwork} 1.284 - 1.285 -Once we've finished the commit, we can use the \hgcmd{tip} command to 1.286 -display the changeset we just created. This command produces output 1.287 -that is identical to \hgcmd{log}, but it only displays the newest 1.288 -revision in the repository. 1.289 +Con respecto al resto del contenido del mensaje de consignación, no 1.290 +hay reglas estrictas-y-rápidas. Mercurial no interpreta ni le da 1.291 +importancia a los contenidos del mensaje de consignación, aunque es 1.292 +posible que su proyecto tenga políticas que definan una manera 1.293 +particular de escribirlo. 1.294 + 1.295 +Mi preferencia personal es usar mensajes de consignación cortos pero 1.296 +informativos, que me digan algo que no puedo inferir con una mirada 1.297 +rápida a la salida de \hgcmdargs{log}{--patch}. 1.298 + 1.299 +\subsection{Cancelar una consignación} 1.300 + 1.301 +Si usted decide que no desea hacer la consignación mientras está 1.302 +editando el mensaje de la misma, simplemente cierre su editor sin 1.303 +guardar los cambios al fichero que está editando. Esto hará que no 1.304 +pase nada ni en el repositorio ni en el directorio de trabajo. 1.305 + 1.306 +Si ejecutamos el comando \hgcmd{commit} sin ningún argumento, se 1.307 +registran todos los cambios que hemos hecho, como lo indican 1.308 +\hgcmd{status} y \hgcmd{diff}. 1.309 + 1.310 +\subsection{Admirar nuestro trabajo} 1.311 + 1.312 +Una vez hemos terminado la consignación, podemos usar el comando 1.313 +\hgcmd{tip}\ndt{Punta.} para mostrar el conjunto de cambios que acabamos de crear. 1.314 +La salida de este comando es idéntica a la de \hgcmd{log}, pero sólo 1.315 +muestra la revisión más reciente en el repositorio. 1.316 \interaction{tour.tip} 1.317 -We refer to the newest revision in the repository as the tip revision, 1.318 -or simply the tip. 1.319 +Nos referimos a la revisión más reciente en el repositorio como la 1.320 +revisión de punta, o simplemente la punta. 1.321 1.322 \section{Sharing changes} 1.323