hgbook
changeset 87:0995016342f8
More bumf.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Wed Oct 04 17:11:53 2006 -0700 (2006-10-04) |
parents | 796738d75876 |
children | d351032c189c |
files | en/Makefile en/examples/tour en/tour.tex |
line diff
1.1 --- a/en/Makefile Wed Oct 04 15:29:19 2006 -0700 1.2 +++ b/en/Makefile Wed Oct 04 17:11:53 2006 -0700 1.3 @@ -32,7 +32,8 @@ 1.4 mq.tools \ 1.5 mq.tutorial \ 1.6 template.simple \ 1.7 - template.svnstyle 1.8 + template.svnstyle \ 1.9 + tour 1.10 1.11 latex-options = \ 1.12 -interaction batchmode \
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/en/examples/tour Wed Oct 04 17:11:53 2006 -0700 2.3 @@ -0,0 +1,18 @@ 2.4 +#!/bin/bash 2.5 + 2.6 +#$ name: version 2.7 + 2.8 +hg version 2.9 + 2.10 +#$ name: help 2.11 + 2.12 +hg help init 2.13 + 2.14 +#$ name: clone 2.15 + 2.16 +hg clone http://hg.serpentine.com/tutorial/hello 2.17 + 2.18 +#$ name: ls 2.19 + 2.20 +ls -l 2.21 +ls hello
3.1 --- a/en/tour.tex Wed Oct 04 15:29:19 2006 -0700 3.2 +++ b/en/tour.tex Wed Oct 04 17:11:53 2006 -0700 3.3 @@ -75,6 +75,62 @@ 3.4 work. XXX Flesh this out. 3.5 \end{note} 3.6 3.7 +\section{Getting started} 3.8 + 3.9 +To begin, we'll use the \hgcmd{version} command to find out whether 3.10 +Mercurial is actually installed properly. The actual version 3.11 +information that it prints isn't so important; it's whether it prints 3.12 +anything at all that we care about. 3.13 +\interaction{tour.version} 3.14 + 3.15 +\subsection{Built-in help} 3.16 + 3.17 +Mercurial provides a built-in help system. This invaluable for those 3.18 +times when you find yourself stuck trying to remember how to run a 3.19 +command. If you are completely stuck, simply run \hgcmd{help}; it 3.20 +will print a brief list of commands, along with a description of what 3.21 +each does. If you ask for help on a specific command (as below), it 3.22 +prints more detailed information. 3.23 +\interaction{tour.help} 3.24 +For a more impressive level of detail (which you won't usually need) 3.25 +run \hgcmdargs{help}{\hggopt{-v}}. The \hggopt{-v} option is short 3.26 +for \hggopt{--verbose}, and tells Mercurial to print more information 3.27 +than it usually would. 3.28 + 3.29 +\section{Working with a repository} 3.30 + 3.31 +In Mercurial, everything happens inside a \emph{repository}. The 3.32 +repository for a project contains all of the files that ``belong to'' 3.33 +that project, along with a historical record of the project's files. 3.34 + 3.35 +There's nothing particularly magical about a repository; it is simply 3.36 +a directory tree in your filesystem that Mercurial treats as special. 3.37 +You can rename delete a repository any time you like, using either the 3.38 +command line or your file browser. 3.39 + 3.40 +\subsection{Making a copy of a repository} 3.41 + 3.42 +\emph{Copying} a repository is just a little bit special. While you 3.43 +could use a normal file copying command to make a copy of a 3.44 +repository, it's best to use a built-in command that Mercurial 3.45 +provides. This command is called \hgcmd{clone}, because it creates an 3.46 +identical copy of an existing repository. 3.47 +\interaction{tour.clone} 3.48 +If our clone succeeded, we should now have a local directory called 3.49 +\dirname{hello}. This directory will contain some files. 3.50 +\interaction{tour.ls} 3.51 +These files have the same contents and history in our repository as 3.52 +they do in the repository we cloned. 3.53 + 3.54 +Every Mercurial repository is complete, self-contained, and 3.55 +independent. It contains its own private copy of a project's files 3.56 +and history. A cloned repository remembers the location of the 3.57 +repository it was cloned from, but it does not communicate with that 3.58 +repository, or any other, unless you tell it to. 3.59 + 3.60 +What this means for now is that we're free to experiment with our 3.61 +repository, safe in the knowledge that it's a private ``sandbox'' that 3.62 +won't affect anyone else. 3.63 3.64 %%% Local Variables: 3.65 %%% mode: latex