Mercurial > hgbook
changeset 7:339e75288632
More progress on MQ chapter and general support.
Added a note environment.
Fixed generated HTML so it wouldn't use huge escaped entities for everything.
Wrote a small amount of actual content.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Mon, 26 Jun 2006 12:25:11 -0700 |
parents | 69d90ab9fd80 |
children | a25335b56825 |
files | en/99defs.tex en/Makefile en/examples/mq.tutorial en/mq.tex |
diffstat | 4 files changed, 75 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/en/99defs.tex Mon Jun 26 10:15:49 2006 -0700 +++ b/en/99defs.tex Mon Jun 26 12:25:11 2006 -0700 @@ -4,6 +4,9 @@ \newcommand{\hgcmd}[1]{``\texttt{hg #1}''} \newcommand{\hgcmdargs}[2]{``\texttt{hg #1 #2}''} +\newsavebox{\notebox} +\newenvironment{note}{\begin{lrbox}{\notebox}\begin{minipage}{\textwidth}\textbf{Note:}\space}{\end{minipage}\end{lrbox}\fbox{\usebox{\notebox}}} + \DefineVerbatimEnvironment{codesample4}{Verbatim}{frame=single,gobble=4,numbers=left,commandchars=\\\{\}} \newcommand{\interaction}[1]{\VerbatimInput[frame=single,numbers=left,commandchars=\\\{\}]{examples/#1.out}}
--- a/en/Makefile Mon Jun 26 10:15:49 2006 -0700 +++ b/en/Makefile Mon Jun 26 12:25:11 2006 -0700 @@ -6,7 +6,8 @@ example-sources := \ examples/run-example \ - examples/mq.qinit-help + examples/mq.qinit-help \ + examples/mq.tutorial latex-options = \ -interaction batchmode \ @@ -29,11 +30,16 @@ define htlatex mkdir -p $(dir $(1)) - head -4 $(shell which htlatex) > $(dir $(1))/htlatex.book + head -2 $(shell which htlatex) > $(dir $(1))/htlatex.book + cp 99book.bib $(dir $@) + echo '(cd $(dir $@) && bibtex $(basename $(notdir $@)))' >> $(dir $(1))/htlatex.book + head -3 $(shell which htlatex) >> $(dir $(1))/htlatex.book + echo 'echo status $$$$' >> $(dir $(1))/htlatex.book chmod 755 $(dir $(1))/htlatex.book $(dir $(1))/htlatex.book $(2) "xhtml,html4-uni,$(3)" " -cunihtf -utf8" "" "$(call latex-options,$(1))" || (rm -f $(1); exit 1) cd $(dir $(1)) && tex4ht -f/$(basename $(notdir $(1))) -cvalidate -cunihtf cd $(dir $(1)) && t4ht -f/$(basename $(notdir $(1))) + perl -pi -e 's/�([0-7][0-9a-f]);/chr(hex($$1))/egi' $(dir $(1))/*.html endef html/onepage/hgbook.html: $(sources) examples @@ -50,4 +56,4 @@ cd examples && ./run-example clean: - rm -rf html pdf *.aux *.dvi *.log *.out + rm -rf html pdf *.aux *.dvi *.log *.out examples/*.out examples/.run
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/en/examples/mq.tutorial Mon Jun 26 12:25:11 2006 -0700 @@ -0,0 +1,20 @@ +echo '[extensions]' >> $HGRC +echo 'hgext.mq =' >> $HGRC + +#$ name: qinit + +hg clone http://hg.serpentine.com/mercurial/hg mq-sandbox + +cd mq-sandbox + +hg qinit + +#$ name: qnew + +hg tip + +hg qnew first.patch + +ls .hg/patches + +hg tip
--- a/en/mq.tex Mon Jun 26 10:15:49 2006 -0700 +++ b/en/mq.tex Mon Jun 26 12:25:11 2006 -0700 @@ -133,7 +133,7 @@ with the standard Mercurial distribution.) To enable MQ, edit your \tildefile{.hgrc} file, and add the lines in figure~\ref{ex:mq:config}. -\begin{figure} +\begin{figure}[h] \begin{codesample4} [extensions] hgext.mq = @@ -143,15 +143,54 @@ \end{figure} Once the extension is enabled, it will make a number of new commands -available. To verify that the extension is working, follow the -example in figure~\ref{ex:mq:enabled}. +available. To verify that the extension is working, you can use +\hgcmd{help} to see if the \hgcmd{qinit} command is now available; see +the example in figure~\ref{ex:mq:enabled}. -\begin{figure} +\begin{figure}[h] \interaction{mq.qinit-help.help} \caption{How to verify that MQ is enabled} \label{ex:mq:enabled} \end{figure} +You can use MQ with \emph{any} Mercurial repository; to start, simply +prepare the repository using the \hgcmd{qinit} command (see +figure~\ref{ex:mq:qinit}). This command creates an empty directory +called \filename{.hg/patches}, where MQ will keep its metadata. As +with many Mercurial commands, the \hgcmd{qinit} command prints nothing +if it succeeds. + +\begin{figure}[h] + \interaction{mq.tutorial.qinit} + \caption{Preparing a repository for use with MQ} + \label{ex:mq:qinit} +\end{figure} + +\begin{figure}[h] + \interaction{mq.tutorial.qnew} + \caption{Creating a new patch} + \label{ex:mq:qnew} +\end{figure} + +To commence work on a new patch, use the \hgcmd{qnew} command. This +command takes one argument, the name of the patch to create. MQ will +use this as the name of an actual file in the \filename{.hg/patches} +directory, as you can see in figure~\ref{ex:mq:qnew}. + +Now also present in the \filename{.hg/patches} directory are two new +files, \filename{series} and \filename{status}. The \filename{series} +file lists all of the patches that MQ knows about for this repository, +with one patch per line. The \filename{status} file lists all of the +patches that MQ has \emph{applied} in this repository. + +\begin{note} + You may sometimes want to edit the \filename{series} file by hand; + for example, to change the sequence in which some patches are + applied. However, manually editing the \filename{status} file is + almost always a bad idea, as it's easy to corrupt MQ's idea of what + is happening. +\end{note} + %%% Local Variables: %%% mode: latex %%% TeX-master: "00book"