Bryan O'Sullivan  committed 339e752

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.

  • Participants
  • Parent commits 69d90ab

Comments (0)

Files changed (4)

File en/99defs.tex

 \newcommand{\hgcmd}[1]{``\texttt{hg #1}''}
 \newcommand{\hgcmdargs}[2]{``\texttt{hg #1 #2}''}
 example-sources := \
 	examples/run-example \
-	examples/mq.qinit-help
+	examples/mq.qinit-help \
+	examples/mq.tutorial
 latex-options = \
 	-interaction batchmode \
 define htlatex
 	mkdir -p $(dir $(1))
-	head -4 $(shell which htlatex) > $(dir $(1))/
+	head -2 $(shell which htlatex) > $(dir $(1))/
+	cp 99book.bib $(dir $@)
+	echo '(cd $(dir $@) && bibtex $(basename $(notdir $@)))' >> $(dir $(1))/
+	head -3 $(shell which htlatex) >> $(dir $(1))/
+	echo 'echo status $$$$' >>  $(dir $(1))/
 	chmod 755 $(dir $(1))/
 	$(dir $(1))/ $(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/&#x00([0-7][0-9a-f]);/chr(hex($$1))/egi' $(dir $(1))/*.html
 html/onepage/hgbook.html: $(sources) examples
 	cd examples && ./run-example
-	rm -rf html pdf *.aux *.dvi *.log *.out
+	rm -rf html pdf *.aux *.dvi *.log *.out examples/*.out examples/.run

File en/examples/mq.tutorial

+echo '[extensions]' >> $HGRC
+echo ' =' >> $HGRC
+#$ name: qinit
+hg clone mq-sandbox
+cd mq-sandbox
+hg qinit
+#$ name: qnew
+hg tip
+hg qnew first.patch
+ls .hg/patches
+hg tip
 with the standard Mercurial distribution.)  To enable MQ, edit your
 \tildefile{.hgrc} file, and add the lines in figure~\ref{ex:mq:config}.
     [extensions] =
 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}.
   \caption{How to verify that MQ is enabled}
+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.
+  \interaction{mq.tutorial.qinit}
+  \caption{Preparing a repository for use with MQ}
+  \label{ex:mq:qinit}
+  \interaction{mq.tutorial.qnew}
+  \caption{Creating a new patch}
+  \label{ex:mq:qnew}
+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.
+  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.
 %%% Local Variables: 
 %%% mode: latex
 %%% TeX-master: "00book"