hgbook
diff en/tour-basic.tex @ 112:2fcead053b7a
More. Concept. Fun.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Mon Nov 13 13:21:29 2006 -0800 (2006-11-13) |
parents | 321732566ac1 |
children | d3f8aec5beff |
line diff
1.1 --- a/en/tour-basic.tex Wed Oct 18 14:11:51 2006 -0700 1.2 +++ b/en/tour-basic.tex Mon Nov 13 13:21:29 2006 -0800 1.3 @@ -356,6 +356,55 @@ 1.4 The \hgcmd{commit} command lets us create a new changeset; we'll 1.5 usually refer to this as ``making a commit'' or ``committing''. 1.6 1.7 +\subsection{Setting up a username} 1.8 + 1.9 +When you try to run \hgcmd{commit} for the first time, it may succeed 1.10 +immediately, or it may fail with an error message that looks like 1.11 +this. 1.12 +\interaction{tour.commit-no-user} 1.13 +If it succeeds for you, the chances are that either you already have a 1.14 +file called \sfilename{.hgrc} in your home directory, or an 1.15 +environment variable set named \envar{EMAIL}. 1.16 + 1.17 +When you commit, Mercurial wants to know what your name is, so that it 1.18 +can record it. If you have created a \sfilename{.hgrc} file, it will 1.19 +look in there. If it doesn't find something suitable, it will see if 1.20 +your \envar{EMAIL} address is set. If neither of these is present, it 1.21 +will produce the error message you can see above. 1.22 + 1.23 +\subsubsection{Creating a Mercurial configuration file} 1.24 + 1.25 +To set a user name, use your favourite editor to create a file called 1.26 +\sfilename{.hgrc} in your home directory. Mercurial will use this 1.27 +file to look up your personalised configuration settings. The initial 1.28 +contents of your \sfilename{.hgrc} should look like this. 1.29 +\begin{codesample2} 1.30 + # This is a Mercurial configuration file. 1.31 + [ui] 1.32 + username = Firstname Lastname <email.address@domain.net> 1.33 +\end{codesample2} 1.34 +The ``\texttt{[ui]}'' line begins a \emph{section} of the config file, 1.35 +so you can read the ``\texttt{username = ...}'' line as meaning ``set 1.36 +the value of the \texttt{username} item in the \texttt{ui} section''. 1.37 +A section continues until a new section begins, or the end of the 1.38 +file. Mercurial ignores empty lines and treats any text from 1.39 +``\texttt{\#}'' to the end of a line as a comment. 1.40 + 1.41 +\subsubsection{Choosing a user name} 1.42 + 1.43 +You can use any text you like as the value of the \texttt{username} 1.44 +config item, since this information is for reading by other people, 1.45 +but for interpreting by Mercurial. The convention that most people 1.46 +follow is to use their name and email address, as in the example 1.47 +above. 1.48 + 1.49 +\begin{note} 1.50 + Mercurial's built-in web server obfuscates email addresses, to make 1.51 + it more difficult for the email harvesting tools that spammers use. 1.52 + This reduces the likelihood that you'll start receiving more junk 1.53 + email if you publish a Mercurial repository on the web. 1.54 +\end{note} 1.55 + 1.56 \subsection{Writing a commit message} 1.57 1.58 When we commit a change, Mercurial drops us into a text editor, to 1.59 @@ -410,7 +459,7 @@ 1.60 all of the changes we've made, as reported by \hgcmd{status} and 1.61 \hgcmd{diff}. 1.62 1.63 -\subsection{Admiring our new handywork} 1.64 +\subsection{Admiring our new handiwork} 1.65 1.66 Once we've finished the commit, we can use the \hgcmd{tip} command to 1.67 display the changeset we just created. This command produces output