Commits

Bryan O'Sullivan committed 0f70d9b Merge

Merge

Comments (0)

Files changed (787)

 *.mo
 *.orig
 *.out
+*.bb
 *.png
 *.pyc
 *.rej
 en/examples/results
 en/html
 en/svn
+fr/examples/results
+fr/html
+it/examples/results
+it/html
 stylesheets/system-xsl
 tools
 web/hgbook/.database.sqlite3
 18131160f7ee3b81bf39ce2c58f762b8d671cef3 submitted
+94d2205f02e7c47931db382a3a80553ef01b3913 1st-edition-it
+a6b81cd31cfd5da20e0dc629ee65cc4f3b08eb58 french-xdoc-build-fixed
 FORMATS=html html-single pdf epub
 
 PO_LANGUAGES := zh
-DBK_LANGUAGES := en
+DBK_LANGUAGES := en fr it
 LANGUAGES := $(DBK_LANGUAGES) $(PO_LANGUAGES)
 
 UPDATEPO = PERLLIB=$(PO4A_LIB) $(PO4A_HOME)/po4a-updatepo -M UTF-8 \
 #rev_id = $(shell hg parents --template '{node|short} ({date|isodate})')
 rev_id = $(shell hg parents --template '{node|short} ({date|shortdate})')
 
-images := \
-	en/figs/feature-branches.png \
-	en/figs/filelog.png \
-	en/figs/metadata.png \
-	en/figs/mq-stack.png \
-	en/figs/revlog.png \
-	en/figs/snapshot.png \
-	en/figs/tour-history.png \
-	en/figs/tour-merge-conflict.png \
-	en/figs/tour-merge-merge.png \
-	en/figs/tour-merge-pull.png \
-	en/figs/tour-merge-sep-repos.png \
-	en/figs/undo-manual-merge.png \
-	en/figs/undo-manual.png \
-	en/figs/undo-non-tip.png \
-	en/figs/undo-simple.png \
-	en/figs/wdir-after-commit.png \
-	en/figs/wdir-branch.png \
-	en/figs/wdir-merge.png \
-	en/figs/wdir.png \
-	en/figs/wdir-pre-branch.png
+images-dot := $(wildcard en/figs/*.dot)
+
+images-svg := $(wildcard en/figs/*.svg)
+images-svg :=$(filter-out %-tmp.svg, $(images-svg))
+images-svg -= $(images-dot:dot=svg)
+
+images-dst := $(wildcard en/figs/*.png)
+images-dst += $(images-dot:dot=png)
+images-dst += $(images-svg:svg=png)
+
+images-gen := $(images-dot:dot=png)
+images-gen += $(images-svg:svg=png)
+images-gen += $(wildcard en/figs/*-tmp.svg)
 
 help:
-	@echo "  make epub         [LINGUA=en|zh|...]"
-	@echo "  make html         [LINGUA=en|zh|...]"
-	@echo "  make html-single  [LINGUA=en|zh|...]"
-	@echo "  make pdf          [LINGUA=en|zh|...]"
-	@echo "  make validate     [LINGUA=en|zh|...] # always before commit!"
+	@echo "  make epub         [LINGUA=en|fr|it|zh|...]"
+	@echo "  make html         [LINGUA=en|fr|it|zh|...]"
+	@echo "  make html-single  [LINGUA=en|fr|it|zh|...]"
+	@echo "  make pdf          [LINGUA=en|fr|it|zh|...]"
+	@echo "  make validate     [LINGUA=en|fr|it|zh|...] # always before commit!"
 	@echo "  make tidypo       [LINGUA=zh|...]    # always before commit!"
 	@echo "  make updatepo     [LINGUA=zh|...]    # update po files."
-	@echo "  make all          [LINGUA=en|zh|...]"
+	@echo "  make all          [LINGUA=en|fr|it|zh|...]"
 	@echo "  make stat         # print statistics about po files."
 	@echo "  make clean        # Remove the build files."
 
 clean:
-	@rm -fr build po/*.mo hello en/hello en/html en/.validated-00book.xml en/examples/.run en/examples/results \
-          stylesheets/system-xsl en/figs/*-tmp.svg \
-          en/figs/feature-branches.png \
-          en/figs/filelog.png \
-          en/figs/feature-branches.png \
-          en/figs/filelog.png \
-          en/figs/metadata.png \
-          en/figs/mq-stack.png \
-          en/figs/revlog.png \
-          en/figs/snapshot.png \
-          en/figs/tour-history.png \
-          en/figs/tour-merge-conflict.png \
-          en/figs/tour-merge-merge.png \
-          en/figs/tour-merge-pull.png \
-          en/figs/tour-merge-sep-repos.png \
-          en/figs/undo-manual-merge.png \
-          en/figs/undo-manual.png \
-          en/figs/undo-non-tip.png \
-          en/figs/undo-simple.png \
-          en/figs/wdir-after-commit.png \
-          en/figs/wdir-branch.png \
-          en/figs/wdir-merge.png \
-          en/figs/wdir-pre-branch.png \
-          en/figs/wdir.png
+	@rm -fr build hello po/*.mo /tmp/REV*-hello en/examples/results
+
+	@(for l in $(DBK_LANGUAGES); do \
+	  rm -fr $(subst en/figs/, $$l/figs/, $(images-gen))  $$l/examples/.run;\
+	done)
 
 all:
 ifdef LINGUA
 
 tidypo:
 ifdef LINGUA
+  ifneq "$(findstring $(LINGUA),$(PO_LANGUAGES))" ""
 	msgcat --sort-by-file --width=80 po/$(LINGUA).po > po/$(LINGUA).tmp && \
 	    mv po/$(LINGUA).tmp po/$(LINGUA).po;
+  endif
 else
 	for po in $(wildcard po/*.po); do \
 	    msgcat --sort-by-file --width=80 $$po > $$po.tmp && mv $$po.tmp $$po; \
 	    $(MAKE) $@ LINGUA=$$l; \
 	done
 else
-updatepo:
-ifneq "$(findstring $(LINGUA),$(PO_LANGUAGES))" ""
+po/$(LINGUA).po: $(wildcard en/*.xml)
+  ifneq "$(findstring $(LINGUA),$(PO_LANGUAGES))" ""
 	(cd po; \
 	$(UPDATEPO) -m ../en/00book.xml -p $(LINGUA).po; \
 	)
 	$(MAKE) tidypo LINGUA=$(LINGUA)
-endif
+  endif
+
+updatepo: po/$(LINGUA).po
 endif
 
 ifndef LINGUA
 validate: build/$(LINGUA)/source/hgbook.xml
 	xmllint --nonet --noout --postvalid --xinclude $<
 
-ifneq "$(findstring $(LINGUA),$(DBK_LANGUAGES))" ""
+  ifneq "$(findstring $(LINGUA),$(DBK_LANGUAGES))" ""
 $(LINGUA)/examples/.run:
-	(cd $(LINGUA)/examples; ./run-example -v -a)
+	if test -x $(LINGUA)/examples/run-example; then \
+	  (cd $(LINGUA)/examples; ./run-example -a); \
+	else \
+	  touch $@; \
+	fi
 
-build/$(LINGUA)/source/hgbook.xml: $(wildcard $(LINGUA)/*.xml) $(images) $(LINGUA)/examples/.run
+build/$(LINGUA)/source/hgbook.xml: $(wildcard $(LINGUA)/*.xml) $(subst en/figs/, $(LINGUA)/figs/, $(images-dst)) $(LINGUA)/examples/.run
 	mkdir -p build/$(LINGUA)/source/figs
 	cp $(LINGUA)/figs/*.png build/$(LINGUA)/source/figs
 	cp stylesheets/hgbook.css build/$(LINGUA)/source
 	(cd $(LINGUA); xmllint --nonet --noent --xinclude --postvalid --output ../$@.tmp 00book.xml)
 	cat $@.tmp | sed 's/\$$rev_id\$$/${rev_id}/' > $@
-else
+  else
 en/examples/.run:
-	(cd en/examples; ./run-example -v -a)
+	(cd en/examples; ./run-example -a)
 
 build/en/source/hgbook.xml:
 	${MAKE} LINGUA=en $@
 
-build/$(LINGUA)/source/hgbook.xml: $(wildcard en/*.xml) po/$(LINGUA).po $(images)
+build/$(LINGUA)/source/hgbook.xml: $(wildcard en/*.xml) po/$(LINGUA).po $(images-dst) en/examples/.run
 	mkdir -p build/$(LINGUA)/source/figs
 	cp en/figs/*.png build/$(LINGUA)/source/figs
 	cp stylesheets/hgbook.css build/$(LINGUA)/source
 	xmllint --nonet --noent --xinclude --postvalid --output $@.tmp en/hgbook.xml.$(LINGUA)
 	cat $@.tmp | sed 's/\$$rev_id\$$/${rev_id}/' > $@
 	mv en/hgbook.xml.$(LINGUA) build/$(LINGUA)/source
-endif
+  endif
 
 endif
 
 	    stylesheets/$(LINGUA)/fo.xsl \
 	    fop1.extensions=1
 
-	(cd build/$(LINGUA)/source && $(FOP_HOME)/fop.sh -c $(FOP_HOME)/conf/userconfig.xml hgbook.fo ../pdf/hgbook.pdf)
+	if test -r $(FOP_HOME)/conf/userconfig.xml ; then \
+		FOP_CONFIG=" -c $(FOP_HOME)/conf/userconfig.xml"; \
+    else \
+        echo "Waring: file $(FOP_HOME)/conf/userconfig.xml does not exist"; \
+    fi
+
+	(cd build/$(LINGUA)/source && $(FOP_HOME)/fop.sh ${FOP_CONFIG} hgbook.fo ../pdf/hgbook.pdf)
 endif
 
+$(LINGUA)/figs/%.png: $(LINGUA)/figs/%.svg
+	if test -x $(LINGUA)/fixsvg; then \
+	  $(LINGUA)/fixsvg $<; \
+	  inkscape -D -d 120 -e $@ $<-tmp.svg; \
+	else \
+	  inkscape -D -d 120 -e $@ $<; \
+	fi
+
+$(LINGUA)/figs/%.svg: $(LINGUA)/figs/%.dot
+	dot -Tsvg -o $@ $<
+
 en/figs/%.png: en/figs/%.svg en/fixsvg
 	en/fixsvg $<
 	inkscape -D -d 120 -e $@ $<-tmp.svg

Makefile.vars.tmpl

 #
-# Please create your Makefile.vars file from this template file.
+# Please create your Makefile.vars from this template file.
 #
 # Please use absolute path, DO NOT use relative path !
 #
 
-# po4a (>= 0.36.1): Only for PO based Makefile !
+# po4a (>= 0.36.1): Only for PO based translation !
 # po4A_HOME=/usr/bin
 # PO4A_LIB=/usr/share/perl5
-PO4A_HOME=/home/dongsheng/var/svn/i18n-zh/trunk/lib/po4a
+PO4A_HOME=/home/dongsheng/vcs/svn/i18n-zh/trunk/lib/po4a
 PO4A_LIB=$(PO4A_HOME)/lib
 
 # saxon65.jar, saxon65-dbxsl.jar, xml-commons-resolver-1.2.jar: Only for pdf format !
-JAVA_LIB=/home/dongsheng/var/svn/i18n-zh/trunk/lib/share/java
+JAVA_LIB=/home/dongsheng/vcs/svn/i18n-zh/trunk/lib/share/java
 
 # fop (>= 0.9.6): Only for pdf format !
-FOP_HOME=/home/dongsheng/var/svn/i18n-zh/trunk/lib/fop
+FOP_HOME=/home/dongsheng/vcs/svn/i18n-zh/trunk/lib/fop
 
 # docbook-xsl (>= 1.74.3): Only for ePub format !
-DB2EPUB=/home/dongsheng/var/svn/i18n-zh/trunk/lib/docbook/docbook-xsl/epub/bin/dbtoepub
+DB2EPUB=/home/dongsheng/vcs/svn/i18n-zh/trunk/lib/docbook/docbook-xsl/epub/bin/dbtoepub
 
 Here's a top-level tour of interesting directories:
 
-en        English-language content
-es        Spanish-language content
-examples  Miscellaneous example scripts
-tools     Old, largely unused conversion scripts
-web       Content and comment system for http://hgbook.red-bean.com/
-xsl       XSLT scripts for generating HTML
+contrib         Miscellaneous scripts
+en              English-language content (DocBook XML format)
+stylesheets     XSLT scripts for generating HTML
+web             Content and comment system for http://hgbook.red-bean.com/
+
+po              PO based translation    Chinese translation
+
+it              Italian translation     DocBook XML format
+es              Spanish translation     old tex format
+ja              Japanese translation    old tex format
 
 I. PRIMER
 
-  DocBook has a tortured, confusing history.  Before you do anything,
-  take a look at Eric Raymond's excellent "DocBook Demystification HOWTO":
+  DocBook has a tortured, confusing history. Before you do anything,
+  take a look at:
 
-      http://tldp.org/HOWTO/DocBook-Demystification-HOWTO/
-
-  It's very short and clears up many things.
-
+      http://wiki.docbook.org/topic/DocBookTutorials
 
 II. COMPILING THE DOCS
 
-
 1. Install XML DTD and XSL stylesheets for DocBook
 
       % sudo apt-get install docbook-xml docbook-xsl
 
       % sudo apt-get install libxml2-utils
 
-3. Install graph drawing tools
+3. Install graph drawing and patches tools
 
-      % sudo apt-get install graphviz inkscape
+      % sudo apt-get install graphviz inkscape patchutils
 
 4. Install pdf support
 
       % sudo apt-get install openjdk-6-jdk docbook-xsl-saxon libsaxon-java fop
 
-  The Makefile will actually invoke tools/fop/fop.sh, you should do
+  The Makefile will actually invoke $FOP_HOME/fop.sh, you should do
   some trick, let fop's CLASSPATH include saxon.jar and docbook-xsl-saxon.jar .
 
-5. Make
+5. Configure XML Catalogs
+  For non pdf output, we use xsltproc for XSLT process, xsltproc use system
+  catalog files automatically, usually /etc/xml/catalog. Users do not need to
+  care about it.
+
+  For pdf output, we need use the xsl extensions (docbook-xsl-saxon), so we must
+  create file $JAVA_LIB/CatalogManager.properties like this:
+
+      catalogs=/etc/xml/catalog
+      relative-catalogs=true
+      static-catalog=yes
+      catalog-class-name=org.apache.xml.resolver.Resolver
+      verbosity=1
+
+6. Create Makefile.vars
+  Please create your Makefile.vars from Makefile.vars.tmpl .
+
+7. Make
   Run 'make' for more details, for example:
 
-  * make all document(pdf, html and html-single for all languages)
+  * make all document(pdf, epub, html and html-single for all languages)
       % make all
 
-  * make english document(pdf, html and html-single for all languages)
+  * make english document(pdf, epub, html and html-single for all languages)
       % make LINGUA=en all
 
-  * make Chinese document(pdf, html and html-single for all languages)
+  * make Chinese document(pdf, epub, html and html-single for all languages)
       % make LINGUA=zh all
 
   * make Chinese pdf document
 
 In addition to everything in section II:
 
-
-1. Get a nice editing environment for SGML/XML.
+1. Get a nice editing environment for XML
 
   This isn't strictly required, but it's nice when your editor
   colorizes things, understands the DTD, tells you what tags you can
   insert, etc.
 
-  If you use emacs, we recommend the PSGML major-mode.  Most free
+  If you use emacs, we recommend the nxml-mode. Most free
   operating systems package it, or its home page is here:
 
-      http://www.lysator.liu.se/projects/about_psgml.html
+      http://www.emacswiki.org/emacs/NxmlMode
 
   If you use vim, you might check out xmledit, at:
 
       http://www.vim.org/scripts/script.php?script_id=301
 
-
-2. Get a validating parser.
+2. Get a validating parser
 
   Actually, if you have what you need to compile the documentation,
   then you almost certainly have an XML validator installed already -
 
       $ make validate
 
-3. Read about DocBook.
+3. Read about DocBook
 
   You'll want to get real intimate with a DocBook reference, such as
   can be found at:  http://www.docbook.org/tdg/en/html/

contrib/hg-package

 #!/bin/sh
 
+#
+# Package build results & Upload to i18n-zh
+#
+
 build_dir=`dirname "$0"`/../build
-rev_id=`hg parents --template '{date|shortdate}' | sed 's/-//g'`
+rev_id=`hg parents --template '{date|shortdate}' | sed 's/-//g'`-`hg parents --template '{node|short}'`
 
-for l in en zh; do
+for l in en fr it zh; do
   (
   if [ ! -d "${build_dir}/${l}" ] ; then
     continue
 
   if [ -f "epub/hgbook.epub" ] ; then
      cp epub/hgbook.epub ../hgbook-${l}-${rev_id}.epub
+     gzip -f9 ../hgbook-${l}-${rev_id}.epub
   fi
   )
 done
 # echo "upload_pass: ${upload_pass}"
 # echo "upload_user: ${upload_user}"
 
-if [ "${upload_user}x" == "x" ]; then
-  upload_user="dongsheng.song"
-fi
-
-if [ "${upload_pass}x" != "x" ]; then
+if [ "${upload_pass}x" != "x" ] && [ "${upload_user}x" != "x" ]; then
   (
   cd ${build_dir}
   curl -s -O http://support.googlecode.com/svn/trunk/scripts/googlecode_upload.py
     exit 1
   fi
 
-  for l in en zh; do
-    if [ -f "hgbook-${l}-${rev_id}.epub" ] ; then
+  for l in en fr it zh; do
+    if [ -f "hgbook-${l}-${rev_id}.epub.gz" ] ; then
       python googlecode_upload.py --user="${upload_user}" --password="${upload_pass}" \
           -p "i18n-zh" -l "Type-Docs,book,hgbook,hg,mercurial,ebook" \
           -s "Distributed revision control with Mercurial - ${l} - ePub" \
-          hgbook-${l}-${rev_id}.epub
+          hgbook-${l}-${rev_id}.epub.gz
     fi
 
     if [ -f "hgbook-${l}-${rev_id}.pdf.gz" ] ; then

en/appB-mq-ref.xml

 
     </sect2>
     <sect2>
-      <title><command role="hg-ext-mq">qfold</command>&emdash;move
+      <title><command role="hg-ext-mq">qfinish</command>&emdash;move
 	applied patches into repository history</title>
 
       <para id="x_72d">The <command>hg qfinish</command> command converts the

en/ch02-tour-basic.xml

 
       <para id="x_c">The best version of Mercurial for Windows is
 	TortoiseHg, which can be found at <ulink
-	  url="http://bitbucket.org/tortoisehg/stable/wiki/Home">http://bitbucket.org/tortoisehg/stable/wiki/Home</ulink>. 
+	  url="http://tortoisehg.org">http://tortoisehg.org</ulink>. 
 	This package has no external dependencies; it <quote>just
 	  works</quote>.  It provides both command line and graphical
 	user interfaces.</para>
 	<command role="hg-ext-mq">qpop</command> each operate on a
 	single patch at a time by default, you can push and pop many
 	patches in one go.  The <option
-	  role="hg-ext-mq-cmd-qpush-opt">hg -a</option> option to
+	  role="hg-ext-mq-cmd-qpush-opt">-a</option> option to
 	<command role="hg-ext-mq">qpush</command> causes it to push
 	all unapplied patches, while the <option
 	  role="hg-ext-mq-cmd-qpop-opt">-a</option> option to <command
 	named <option>-f</option>.  The exact meaning of
 	<option>-f</option> depends on the command.  For example,
 	<command role="hg-cmd">hg qnew <option
-	    role="hg-ext-mq-cmd-qnew-opt">hg -f</option></command>
+	    role="hg-ext-mq-cmd-qnew-opt">-f</option></command>
 	will incorporate any outstanding changes into the new patch it
 	creates, but <command role="hg-cmd">hg qpop <option
-	    role="hg-ext-mq-cmd-qpop-opt">hg -f</option></command>
+	    role="hg-ext-mq-cmd-qpop-opt">-f</option></command>
 	will revert modifications to any files affected by the patch
 	that it is popping.  Be sure to read the documentation for a
 	command's <option>-f</option> option before you use it!</para>
 
     <para id="x_404">On my old, slow laptop, I was able to <command
 	role="hg-cmd">hg qpush <option
-	  role="hg-ext-mq-cmd-qpush-opt">hg -a</option></command> all
+	  role="hg-ext-mq-cmd-qpush-opt">-a</option></command> all
       1,738 patches in 3.5 minutes, and <command role="hg-cmd">hg qpop
-	<option role="hg-ext-mq-cmd-qpop-opt">hg -a</option></command>
+	<option role="hg-ext-mq-cmd-qpop-opt">-a</option></command>
       them all in 30 seconds.  (On a newer laptop, the time to push
       all patches dropped to two minutes.)  I could <command
 	role="hg-ext-mq">qrefresh</command> one of the biggest patches
 	  -a</option></command> your patches, then <command
 	role="hg-cmd">hg pull</command> changes into the underlying
       repository, and finally <command role="hg-cmd">hg qpush <option
-	  role="hg-ext-mq-cmd-qpop-opt">hg -a</option></command> your
+	  role="hg-ext-mq-cmd-qpop-opt">-a</option></command> your
       patches again.  MQ will stop pushing any time it runs across a
       patch that fails to apply during conflicts, allowing you to fix
       your conflicts, <command role="hg-ext-mq">qrefresh</command> the
 	  update</command> changes to patches or the <filename
 	  role="special">series</filename> file, you will have to
 	<command role="hg-cmd">hg qpop <option
-	    role="hg-ext-mq-cmd-qpop-opt">hg -a</option></command> and
+	    role="hg-ext-mq-cmd-qpop-opt">-a</option></command> and
 	then <command role="hg-cmd">hg qpush <option
-	    role="hg-ext-mq-cmd-qpush-opt">hg -a</option></command> in
+	    role="hg-ext-mq-cmd-qpush-opt">-a</option></command> in
 	the underlying repository to see those changes show up there.
 	If you forget to do this, you can confuse MQ's idea of which
 	patches are applied.</para>

en/ch14-hgext.xml

       </listitem></itemizedlist>
 
     <para id="x_510">The <literal role="hg-ext">inotify</literal> extension is
-      not yet shipped with Mercurial as of May 2007, so it's a little
-      more involved to set up than other extensions.  But the
-      performance improvement is worth it!</para>
-
-    <para id="x_511">The extension currently comes in two parts: a set of patches
-      to the Mercurial source code, and a library of Python bindings
-      to the <literal>inotify</literal> subsystem.</para>
-    <note>
-      <para id="x_512">  There are <emphasis>two</emphasis> Python
-	<literal>inotify</literal> binding libraries.  One of them is
-	called <literal>pyinotify</literal>, and is packaged by some
-	Linux distributions as <literal>python-inotify</literal>.
-	This is <emphasis>not</emphasis> the one you'll need, as it is
-	too buggy and inefficient to be practical.</para>
-    </note>
-    <para id="x_513">To get going, it's best to already have a functioning copy
-      of Mercurial installed.</para>
-    <note>
-      <para id="x_514">  If you follow the instructions below, you'll be
-	<emphasis>replacing</emphasis> and overwriting any existing
-	installation of Mercurial that you might already have, using
-	the latest <quote>bleeding edge</quote> Mercurial code. Don't
-	say you weren't warned!</para>
-    </note>
-    <orderedlist>
-      <listitem><para id="x_515">Clone the Python <literal>inotify</literal>
-	  binding repository.  Build and install it.</para>
-	<programlisting>hg clone http://hg.kublai.com/python/inotify
-cd inotify
-python setup.py build --force
-sudo python setup.py install --skip-build</programlisting>
-      </listitem>
-      <listitem><para id="x_516">Clone the <filename
-	    class="directory">crew</filename> Mercurial repository.
-	  Clone the <literal role="hg-ext">inotify</literal> patch
-	  repository so that Mercurial Queues will be able to apply
-	  patches to your cope of the <filename
-	    class="directory">crew</filename> repository.</para>
-	<programlisting>hg clone http://hg.intevation.org/mercurial/crew
-hg clone crew inotify
-hg clone http://hg.kublai.com/mercurial/patches/inotify inotify/.hg/patches</programlisting>
-      </listitem>
-      <listitem><para id="x_517">Make sure that you have the Mercurial Queues
-	  extension, <literal role="hg-ext">mq</literal>, enabled.  If
-	  you've never used MQ, read <xref
-	    linkend="sec:mq:start"/> to get started
-	  quickly.</para>
-      </listitem>
-      <listitem><para id="x_518">Go into the <filename
-	    class="directory">inotify</filename> repo, and apply all
-	  of the <literal role="hg-ext">inotify</literal> patches
-	  using the <option role="hg-ext-mq-cmd-qpush-opt">hg
-	    -a</option> option to the <command
-	    role="hg-ext-mq">qpush</command> command.</para>
-	<programlisting>cd inotify
-hg qpush -a</programlisting>
-      </listitem>
-      <listitem><para id="x_519">  If you get an error message from <command
-	    role="hg-ext-mq">qpush</command>, you should not continue.
-	  Instead, ask for help.</para>
-      </listitem>
-      <listitem><para id="x_51a">Build and install the patched version of
-	  Mercurial.</para>
-	<programlisting>python setup.py build --force
-sudo python setup.py install --skip-build</programlisting>
-      </listitem>
-    </orderedlist>
-    <para id="x_51b">Once you've build a suitably patched version of Mercurial,
-      all you need to do to enable the <literal
+      shipped with Mercurial since 1.0.
+      All you need to do to enable the <literal
 	role="hg-ext">inotify</literal> extension is add an entry to
       your <filename role="special">~/.hgrc</filename>.</para>
     <programlisting>[extensions] inotify =</programlisting>

en/examples/ch04/resolve

 hg heads
 
 #$ name: export
-export HGMERGE=merge
+export HGMERGE=false
 
 #$ name: merge
 hg merge
Added
New image
 
 for i in 0 1 2 3 4
 do
-  export REV$i=$(hg --cwd hello log -r $i --template '{node|short}' | cut -c1-4)
+  export REV$i=$(hg --cwd hello log -r $i --template '{node|short}' | head  -1 | cut -c1-4)
 done
 export REV_my_hello=$(cat /tmp/REV5.my-hello)
 export REV_my_new_hello=$(cat /tmp/REV5.my-new-hello)

es/99book.bib

-../en/99book.bib

es/bookhtml.cfg

-../en/bookhtml.cfg

es/fixhtml.py

-../en/fixhtml.py

es/hgbook.css

-../en/hgbook.css

es/htlatex.book

-../en/htlatex.book
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vim: set filetype=docbkxml shiftwidth=2 autoindent expandtab tw=77 : -->
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+ "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
+[
+<!-- Below are references to files in this directory. -->
+
+<!-- Chapters. -->
+
+<!ENTITY ch00     SYSTEM "ch00-preface.xml">
+<!ENTITY ch01     SYSTEM "ch01-intro.xml">
+<!ENTITY ch02     SYSTEM "ch02-tour-basic.xml">
+<!ENTITY ch03     SYSTEM "ch03-tour-merge.xml">
+<!ENTITY ch04     SYSTEM "ch04-concepts.xml">
+<!ENTITY ch05     SYSTEM "ch05-daily.xml">
+<!ENTITY ch06     SYSTEM "ch06-collab.xml">
+<!ENTITY ch07     SYSTEM "ch07-filenames.xml">
+<!ENTITY ch08     SYSTEM "ch08-branch.xml">
+<!ENTITY ch09     SYSTEM "ch09-undo.xml">
+<!ENTITY ch10     SYSTEM "ch10-hook.xml">
+<!ENTITY ch11     SYSTEM "ch11-template.xml">
+<!ENTITY ch12     SYSTEM "ch12-mq.xml">
+<!ENTITY ch13     SYSTEM "ch13-mq-collab.xml">
+<!ENTITY ch14     SYSTEM "ch14-hgext.xml">
+<!ENTITY appA     SYSTEM "appA-svn.xml">
+<!ENTITY appB     SYSTEM "appB-mq-ref.xml">
+<!ENTITY appC     SYSTEM "appC-srcinstall.xml">
+<!ENTITY appD     SYSTEM "appD-license.xml">
+
+<!-- Include our standard shortcuts. -->
+
+<!ENTITY % SHORTCUTS SYSTEM "book-shortcuts.xml">
+%SHORTCUTS;
+
+<!-- Include automatically and manually generated code snippets. -->
+
+<!ENTITY % AUTOSNIPPETS SYSTEM "examples/auto-snippets.xml">
+%AUTOSNIPPETS;
+]>
+
+<book id="hg">
+  <title>Mercurial: The Definitive Guide</title>
+  
+  <!-- hg parents &#x2d;&#x2d;template '{node|short} ({date|shortdate})' 
+  <subtitle>Compiled from 8a1d3f1aff17 (2009-03-10)</subtitle>
+  -->
+  <subtitle>Compiled from $rev_id$</subtitle>
+  <bookinfo>
+    <edition>1</edition>
+    <isbn>9780596800673</isbn>
+    <authorgroup>
+      <author>
+        <firstname>Bryan</firstname>
+        <surname>O'Sullivan</surname>
+      </author>
+    </authorgroup>
+
+    <editor>
+      <firstname>Mike</firstname>
+      <surname>Loukides</surname>
+    </editor>
+
+    <copyright>
+      <year>2006</year>
+      <year>2007</year>
+      <year>2008</year>
+      <year>2009</year>
+      <holder>Bryan O'Sullivan</holder>
+    </copyright>
+  </bookinfo>
+
+  <!-- BEGIN ch00 -->
+  &ch00;
+  <!-- BEGIN ch01 -->
+  &ch01;
+  <!-- BEGIN ch02 -->
+  &ch02;
+  <!-- BEGIN ch03 -->
+  &ch03;
+  <!-- BEGIN ch04 -->
+  &ch04;
+  <!-- BEGIN ch05 -->
+  &ch05;
+  <!-- BEGIN ch06 -->
+  &ch06;
+  <!-- BEGIN ch07 -->
+  &ch07;
+  <!-- BEGIN ch08 -->
+  &ch08;
+  <!-- BEGIN ch09 -->
+  &ch09;
+  <!-- BEGIN ch10 -->
+  &ch10;
+  <!-- BEGIN ch11 -->
+  &ch11;
+  <!-- BEGIN ch12 -->
+  &ch12;
+  <!-- BEGIN ch13 -->
+  &ch13;
+  <!-- BEGIN ch14 -->
+  &ch14;
+  <!-- BEGIN appA -->
+  &appA;
+  <!-- BEGIN appB -->
+  &appB;
+  <!-- BEGIN appC -->
+  &appC;
+  <!-- BEGIN appD -->
+  &appD;
+</book>
+# This makefile requires GNU make.
+
+image-sources := $(wildcard figs/*.dot figs/*.gif figs/*.png figs/*.svg)
+
+xml-src-files := \
+	00book.xml \
+	app*.xml \
+	ch*.xml
+
+image-dot := $(filter %.dot,$(image-sources))
+image-svg := $(filter %.svg,$(image-sources))
+image-oth := $(filter %.gif %.png,$(image-sources))
+
+obj-web := html
+obj-websup := $(obj-web)/support
+obj-web-read := $(obj-web)/read
+
+image-web := \
+	$(image-dot:%.dot=$(obj-web-read)/%.png) \
+	$(image-svg:%.svg=$(obj-web-read)/%.png) \
+	$(image-oth:%=$(obj-web-read)/%)
+
+example-sources-by-name := \
+	backout \
+	bisect \
+	branching \
+	branch-named \
+	branch-repo \
+	cmdref \
+	daily.copy \
+	daily.files \
+	daily.rename \
+	daily.revert \
+	extdiff \
+	filenames \
+	hook.msglen \
+	hook.simple \
+	issue29 \
+	mq.guards \
+	mq.qinit-help \
+	mq.dodiff \
+	mq.id \
+	mq.tarball \
+	mq.tools \
+	mq.tutorial \
+	rename.divergent \
+	rollback \
+	tag \
+	template.simple \
+	template.svnstyle \
+	tour \
+	tour-merge-conflict
+
+example-sources := \
+	$(example-sources-by-name:%=examples/%) \
+	$(wildcard examples/ch*/*)
+
+extras-web-base := \
+	$(obj-web)/index.html \
+	$(obj-web)/robots.txt \
+	$(obj-websup)/form-min.js \
+	$(obj-websup)/form.js \
+	$(obj-websup)/hsbook.js \
+	$(obj-websup)/jquery-min.js \
+	$(obj-websup)/jquery.js \
+	$(obj-websup)/styles.css
+
+extras-web := $(extras-web-base) $(extras-web-base:%=%.gz)
+
+xsltproc := xsltproc
+xsltproc-opts := --nonet --xinclude --path '$(xml-path)'
+
+xmllint := xmllint
+xmllint-opts := --noout --nonet --valid
+
+system-xsl-dir := $(firstword $(wildcard \
+	/usr/share/sgml/docbook/xsl-stylesheets \
+	/usr/share/xml/docbook/stylesheet/nwalsh \
+	))
+
+# Bletcherousness.
+
+ifneq ($(wildcard /usr/share/sgml/docbook/xml-dtd-4.4-*),)
+dtd-dir := $(wildcard /usr/share/sgml/docbook/xml-dtd-4.4-*)
+else
+ifneq ($(wildcard /usr/share/xml/docbook/schema/dtd/4.4),)
+dtd-dir := $(wildcard /usr/share/xml/docbook/schema/dtd/4.4)
+else
+$(error Do not know where to look for DocBook XML 4.4 DTD)
+endif
+endif
+
+ifeq ($(system-xsl-dir),)
+$(error add a suitable directory to system-xsl-dir)
+endif
+
+example-prereqs := \
+	/usr/bin/merge
+
+dist-sources := \
+	../html/hgicon.png \
+	../html/index.html.var \
+	../html/index.en.html
+
+hg = $(shell which hg)
+
+hg-id = $(shell hg parents --template '{node|short}, dated {date|isodate},\n')
+
+hg-version = $(shell hg version -q | \
+		     sed 's,.*(version \(unknown\|[a-f0-9+]*\)),\1,')
+
+all: web complete.xml
+
+../stylesheets/system-xsl: $(system-xsl-dir)
+	ln -s $< $@
+
+web: ../stylesheets/system-xsl websup html
+
+html: $(obj-web-read)/index.html
+
+../web/index-read.html.in: ../web/genindex.py $(xml-src-files)
+	cd ../web && ./genindex.py
+
+$(obj-web-read)/index.html: ../stylesheets/system-xsl .validated-00book.xml ../web/index-read.html.in
+	xsltproc $(xsltproc-opts) -o $(obj-web-read)/x ../stylesheets/chunk-stylesheet.xsl 00book.xml
+	python ../web/texpand.py ../web/index-read.html.in html/read/index.html
+	for i in $(obj-web-read)/*.html; do \
+	  gzip -9 -c $$i > $$i.gz; \
+	done
+
+websup: $(extras-web) $(image-web)
+	mkdir -p $(obj-websup)/figs $(obj-web-read)/figs
+	cp ../stylesheets/system-xsl/images/*.png $(obj-websup)/figs
+	cp -f ../web/icons/*.png $(obj-websup)/figs
+
+complete.xml: .validated-00book.xml
+	$(xsltproc) $(xsltproc-opts) -o $@ ../stylesheets/dtd-profile.xsl 00book.xml
+
+all-ids.dat: ../stylesheets/all-ids.xsl $(xml-src-files)
+	$(xsltproc) $(xsltproc-opts) -o $@ ../stylesheets/all-ids.xsl 00book.xml
+
+web: websup
+
+valid: .validated-00book.xml
+
+.validated-00book.xml: $(xml-src-files) examples/.run
+	$(xmllint) --path '$(dtd-dir):$(xml-path)' $(xmllint-opts) $<
+	touch $@
+
+# Produce 90dpi PNGs for the web.
+
+$(obj-web-read)/figs/%.png: $(obj-web-read)/figs/%.svg fixsvg
+	mkdir -p $(dir $@)
+	./fixsvg $<
+	inkscape -D -e $@ $<-tmp.svg
+	rm $<-tmp.svg
+
+$(obj-web-read)/figs/%.png: figs/%.svg fixsvg
+	mkdir -p $(dir $@)
+	./fixsvg $<
+	inkscape -D -e $@ $<-tmp.svg
+	rm $<-tmp.svg
+
+$(obj-web-read)/figs/%.gif: figs/%.gif
+	cp $< $@
+
+$(obj-web-read)/figs/%.png: figs/%.png
+	cp $< $@
+
+$(obj-web-read)/figs/%.svg: figs/%.dot
+	mkdir -p $(dir $@)
+	dot -Tsvg -o $@ $<
+
+examples: $(example-prereqs) examples/.run
+
+examples/.run: $(example-sources)
+	cd examples && ./run-example -a
+
+examples/%.run: examples/% examples/run-example
+
+clean:
+	-rm -rf dist html $(image-dot:%.dot=%.pdf) $(image-dot:%.dot=%.png) \
+	  $(image-svg:%.svg=%.png) examples/*.{lxo,run} examples/.run
+
+install: html $(dist-sources)
+	rm -rf dist
+	mkdir -p dist
+	cp html/*.{css,html,png} dist
+	cp $(dist-sources) dist
+
+rsync: install
+	rsync -avz --delete dist sp.red-bean.com:public_html/hgbook
+
+vpath %.css ../web
+vpath %.html.in ../web
+vpath %.js ../web/javascript
+
+$(obj-websup)/%.css: %.css
+	@mkdir -p $(dir $@)
+	cp $< $@
+
+$(obj-websup)/%.jpg: %.jpg
+	@mkdir -p $(dir $@)
+	cp $< $@
+
+$(obj-websup)/%.js: %.js
+	@mkdir -p $(dir $@)
+	cp $< $@
+
+$(obj-web)/%: ../web/%
+	@mkdir -p $(dir $@)
+	cp $< $@
+
+$(obj-web)/%.html: %.html.in
+	@mkdir -p $(dir $@)
+	python ../web/texpand.py $< $@
+
+%.gz: %
+	gzip -9 -c $< > $@
+
+
+<appendix id="svn">
+  <?dbhtml filename="migrating-to-mercurial.html"?>
+<title>Migrer vers Mercurial</title>
+
+  <para id="x_6e1">Une manière courante de s'essayer à un nouveau
+  gestionnaire de révisions est d'expérimenter en migrant un
+  projet existant, plutôt que le faire avec un nouveau projet.
+  </para>
+
+  <para id="x_6e2">Dans cette annexe, nous discuterons comment importer
+  l'historique d'un projet dans Mercurial, et à quoi faire attention
+  si vous êtes habitués à un autre outil de gestion de révisions.
+   </para>
+
+  <sect1>
+    <title>Importer l'historique depuis un autre système</title>
+
+    <para id="x_6e3">Mercurial est livré avec une extension nommée
+      <literal>convert</literal>, qui permet d'importer un historique
+      depuis les gestionnaire de révisions les plus courants. Au moment de 
+      l'écriture de ce livre, il pouvait importer l'historique depuis:
+      </para>
+    <itemizedlist>
+      <listitem>
+	<para id="x_6e4">Subversion</para>
+      </listitem>
+      <listitem>
+	<para id="x_6e5">CVS</para>
+      </listitem>
+      <listitem>
+	<para id="x_6e6">git</para>
+      </listitem>
+      <listitem>
+	<para id="x_6e7">Darcs</para>
+      </listitem>
+      <listitem>
+	<para id="x_6e8">Bazaar</para>
+      </listitem>
+      <listitem>
+	<para id="x_6e9">Monotone</para>
+      </listitem>
+      <listitem>
+	<para id="x_6ea">GNU Arch</para>
+      </listitem>
+      <listitem>
+	<para id="x_6eb">Mercurial</para>
+      </listitem>
+    </itemizedlist>
+
+    <para id="x_6ec">(Pour savoir pourquoi Mercurial lui même est supporté
+    comme source, voir <xref linkend="svn.filemap"/>.)</para>
+
+    <para id="x_6ed">Vous pouvez activer l'extension de la manière
+    habituelle, en éditant votre fichier <filename>~/.hgrc</filename></para>
+
+    <programlisting>[extensions]
+convert =</programlisting>
+
+    <para id="x_6ee">Ceci rendra la commande <command>hg convert</command>
+    disponible. La commande est facile à utiliser. Par exemple, la 
+    commande suivante va importer l'historique Subversion du <emphasis
+    remap="it">framework</emphasis> de test <quote>Nose Unit</quote> dans Mercurial.
+      </para>
+
+    <screen><prompt>$</prompt> <userinput>hg convert http://python-nose.googlecode.com/svn/trunk</userinput></screen>
+
+    <para id="x_6ef">L'extension <literal>convert</literal> opère de 
+    manière incrémentale. En d'autres mots, après une première exécution de
+    la commande <command>hg convert</command>, les exécutions ultérieures
+    importeront les révisions ultérieures à l'exécution précédente.
+    La conversion incrémentale ne réussira que si
+    vous exécutez <command>hg convert</command> dans le même dépôt que vous
+    aviez utilisé à l'origine, ceci parce que l'extension <literal>convert</literal> 
+    sauvegarde un certain nombre de méta-données privées dans le fichier
+    <filename>.hg/shamap</filename> (non versioné) au sein du dépôt cible.
+    </para>
+
+    <para id="x_707">Lorsque vous voulez faire des modifications en utilisant
+    Mercurial, le mieux est de faire un clone de l'ensemble de l'arborescence 
+    que vous souhaitez convertir, et de laisser l'arborescence d'origine pour
+    de futures conversions incrémentales. C'est la manière la plus sûre pour vous laisser
+    récupérer et fusionner les modifications futures depuis l'outil de gestion
+    de révisions dans votre nouveau dépôt Mercurial.</para>
+
+    <sect2>
+      <title>Convertir plusieurs branches</title>
+
+      <para id="x_708">La commande <command>hg convert</command> citée 
+      ci-dessus convertit seulement l'historique de la <literal>branche
+      principale (trunk)</literal> du dépôt Subversion. Si nous utilisons
+      à la place l'URL <literal>http://python-nose.googlecode.com/svn</literal>,
+      Mercurial va automatiquement détecter la  
+      <literal>branche principale (trunk)</literal>, les <literal>étiquettes 
+      (tags)</literal>, et les <literal>branches</literal>  que les dépôts
+      Subversion utilisent généralement, et les importera chacun dans
+      une branche Mercurial distincte.</para>
+
+      <para id="x_709">Par défaut, chaque branche Subversion importée 
+     dans Mercurial se voit attribuer un nom de branche. Une fois la
+     conversion achevée, vous pouvez obtenir la liste des noms des branches 
+     actives dans le dépôt Mercurial en utilisant la commande
+     <command>hg branches -a</command>. Si vous préférez importer les 
+     branches Subversion sans noms, ajoutez l'option <option>--config
+     convert.hg.usebranches=false</option> à la commande 
+     <command>hg convert</command>.</para>
+
+      <para id="x_70a">Une fois votre arborescence convertie, 
+      si vous souhaitez travailler selon la pratique habituelle sous Mercurial
+      avec une arborescence qui ne contient qu'une seule branche, vous pouvez cloner
+      cette seule branche en utilisant 
+      <command>hg clone -r nomdemabranche</command>.</para>
+    </sect2>
+
+    <sect2>
+      <title>Associer les noms d'utilisateurs</title>
+
+      <para id="x_6f0">Certains outils de gestion de révisions
+      ne sauvegardent, avec les modifications, que les noms 
+      d'utilisateurs raccourcis. Ceux-ci peuvent être difficiles à 
+      interpréter. La norme avec Mercurial est de sauvegarder le