Josef Sipek  committed b8539d9

Begining of concepts chapter

  • Participants
  • Parent commits c0979ed

Comments (0)

Files changed (5)

File en/00book.tex


File en/99defs.tex

+  {\begin{lrbox}{\notebox}\begin{minipage}{0.7\textwidth}\textbf{Caution:}\space}%
+  {\end{minipage}\end{lrbox}\fbox{\usebox{\notebox}}}
 	99book.bib \
 	99defs.tex \
 	build_id.tex \
+	concepts.tex \
 	hook.tex \
 	intro.tex \
 	mq.tex \
 example-sources := \
 	examples/run-example \
 	examples/hook.simple \
+	examples/concepts \
 	examples/mq.qinit-help \
 	examples/mq.diff \
 	examples/mq.tarball \

File en/concepts.tex

+\chapter{Basic Concepts}
+This chapter introduces some of the basic concepts behind distributed
+version control systems such as Mercurial.
+The repository is a directory where Mercurial stores the history for the
+files under revision control.
+% where is this repository you speak of?
+% How are the changes stored?
+% What's the structure of the repository?
+A typical Mercurial repository is a directory which contains a checked out
+working copy (see section~\ref{sec:concepts:workingcopy}) as well as
+\sdirname{.hg} directory.  Figure~\ref{ex:concepts:dirlist} shows the
+contents of a freshly created repository.  This repository does not contain
+any revisions. Let's take a look at a repository that has history for
+several files.
+Figure~\ref{ex:concepts:dirlist2} shows the contents of a repository keeping
+history on two files.  We see the checked out copies of the files
+\filename{foo} and \filename{bar}, as well as the files containing their
+histories \filename{foo.i} and \filename{bar.i}, respectively. Additionally,
+we see the \filename{changelog.i} and \filename{00manifest.i} files. These
+contain the repository-wide revision data, such as the commit message, and
+the list of files in the repository during the commit.
+  \interaction{concepts.dirlist}
+  \caption{Contents of a freshly created repository}
+  \label{ex:concepts:dirlist}
+  \interaction{concepts.dirlist2}
+  \caption{Contents of a repository tracking two files}
+  \label{ex:concepts:dirlist2}
+% .hg/hgrc
+\subsection{Creating a Repository}
+% hg init
+Creating a repository is quick and painless.  One uses the \hgcmd{init}
+command as figure~\ref{ex:concepts:hginit} demonstrates.  The one argument
+passed to the \hgcmd{init} command is the name of the repository. The name
+can be any string usable as a directory name.
+If you do not specify a name of the repository, the current working
+directory will be used instead.
+  \interaction{concepts.hginit}
+  \caption{Creating a new repository}
+  \label{ex:concepts:hginit}
+\subsection{Remote Repositories}
+In addition to repositories stored on the local file system, Mercurial
+supports so called \emph{remote repositories}.  These remote repositories
+can be accessed via several different methods.  See
+section~\ref{sec:XXX:remotesetup} for instructions how to set up remote
+% XXX: reference the proper section!
+Mercurial can use \command{ssh} to send and receive changes. The remote
+repository is identified by an URL. The basic format for the URL is:
+Where \cmdargs{user} is optional, and the \cmdargs{path} is path to the
+repository --- either an absolute or relative to the user's home directory
+--- on the remote host with hostname: \cmdargs{host}.
+If the path for the remote repository is absolute there will be two
+consecutive slashes.  E.g., if the remote path is \dirname{/repos/hgbook},
+the URL would look something like the following:
+Relative paths have only one slash and are relative to the user's home
+\subsubsection{HTTP \& HTTPS}
+The other protocol supported is HTTP as well as HTTPS.  The repository URL
+is very much like that of the \command{ssh}.
+Just as before, the username is optional.
+% XXX: is it optional for both push & pull or just for pull?
+This time however, the path is relative to the HTTP server root.  
+\section{Working Copy}
+%%% Local Variables: 
+%%% mode: latex
+%%% TeX-master: "00book"
+%%% End:

File en/examples/concepts

+#$ name: dirlist
+hg init newrepo
+cd newrepo
+find .
+#$ name:
+echo "a line of text" > foo
+echo "another life of text" > bar
+hg commit -A -m "Some files"
+#$ name: dirlist2
+find .
+#$ name:
+cd ..
+#$ name: hginit
+hg init reponame