hgbook

changeset 580:8366882f67f2

Fix up more formatting goop
author Bryan O'Sullivan <bos@serpentine.com>
date Wed Mar 18 00:00:58 2009 -0700 (2009-03-18)
parents 80928ea6e7ae
children 5bfa0df6aaed
files en/Makefile en/appB-mq-ref.xml en/ch00-preface.xml en/ch06-collab.xml en/ch08-branch.xml en/ch10-hook.xml en/ch11-template.xml en/ch12-mq.xml en/ch13-mq-collab.xml en/ch14-hgext.xml en/examples/auto-snippets.xml en/examples/ch10/bugzilla-config.lst en/examples/ch10/notify-config-mail.lst en/examples/ch10/notify-config.lst en/examples/run-example
line diff
     1.1 --- a/en/Makefile	Tue Mar 17 21:47:12 2009 -0700
     1.2 +++ b/en/Makefile	Wed Mar 18 00:00:58 2009 -0700
     1.3 @@ -35,7 +35,7 @@
     1.4  
     1.5  image-html := $(image-dot:%.dot=%.png) $(image-svg:%.svg=%.png) $(image-png)
     1.6  
     1.7 -example-sources := \
     1.8 +example-sources-by-name := \
     1.9  	backout \
    1.10  	bisect \
    1.11  	branching \
    1.12 @@ -67,6 +67,10 @@
    1.13  	tour \
    1.14  	tour-merge-conflict
    1.15  
    1.16 +example-sources := \
    1.17 +	$(example-sources-by-name:%=examples/%) \
    1.18 +	$(wildcard examples/ch*/*)
    1.19 +
    1.20  obj-web := html
    1.21  obj-websup := html/support
    1.22  
    1.23 @@ -162,11 +166,10 @@
    1.24  
    1.25  examples: $(example-prereqs) examples/.run
    1.26  
    1.27 -examples/.run: $(example-sources:%=examples/%.run)
    1.28 -	touch examples/.run
    1.29 +examples/.run: $(example-sources)
    1.30 +	cd examples && ./run-example
    1.31  
    1.32  examples/%.run: examples/% examples/run-example
    1.33 -	cd examples && ./run-example $(notdir $<)
    1.34  
    1.35  clean:
    1.36  	-rm -rf dist html $(image-dot:%.dot=%.pdf) $(image-dot:%.dot=%.png) \
     2.1 --- a/en/appB-mq-ref.xml	Tue Mar 17 21:47:12 2009 -0700
     2.2 +++ b/en/appB-mq-ref.xml	Wed Mar 18 00:00:58 2009 -0700
     2.3 @@ -38,11 +38,12 @@
     2.4  
     2.5        <para>This command is shorthand for <command role="hg-cmd">hg
     2.6  	  commit --cwd .hg/patches</command>.</para>
     2.7 -
     2.8 -      <para>\subsection{<command
     2.9 +    </sect2>
    2.10 +    <sect2>
    2.11 +	<title><command
    2.12  	  role="hg-ext-mq">qdelete</command>&emdash;delete a patch
    2.13  	from the <filename role="special">series</filename>
    2.14 -	file}</para>
    2.15 +	file}</title>
    2.16  
    2.17        <para>The <command role="hg-ext-mq">qdelete</command> command
    2.18  	removes the entry for a patch from the <filename
     3.1 --- a/en/ch00-preface.xml	Tue Mar 17 21:47:12 2009 -0700
     3.2 +++ b/en/ch00-preface.xml	Wed Mar 18 00:00:58 2009 -0700
     3.3 @@ -64,7 +64,7 @@
     3.4  
     3.5      <para>This book is licensed under the Open Publication License,
     3.6        and is produced entirely using Free Software tools.  It is
     3.7 -      typeset with \LaTeX{}; illustrations are drawn and rendered with
     3.8 +      typeset with DocBook XML.  Illustrations are drawn and rendered with
     3.9        <ulink url="http://www.inkscape.org/">Inkscape</ulink>.</para>
    3.10  
    3.11      <para>The complete source code for this book is published as a
     4.1 --- a/en/ch06-collab.xml	Tue Mar 17 21:47:12 2009 -0700
     4.2 +++ b/en/ch06-collab.xml	Wed Mar 18 00:00:58 2009 -0700
     4.3 @@ -592,7 +592,8 @@
     4.4  	<listitem><para>If you have a high tolerance for pain, you can
     4.5  	    use the Cygwin port of OpenSSH.</para>
     4.6  	</listitem></itemizedlist>
     4.7 -      <para>In either case, you'll need to edit your \hgini\ file to
     4.8 +      <para>In either case, you'll need to edit your <filename
     4.9 +      role="special">hg.ini</filename> file to
    4.10  	tell Mercurial where to find the actual client command.  For
    4.11  	example, if you're using PuTTY, you'll need to use the
    4.12  	<command>plink</command> command as a command-line ssh
    4.13 @@ -604,7 +605,7 @@
    4.14  	<para>  The path to <command>plink</command> shouldn't contain
    4.15  	  any whitespace characters, or Mercurial may not be able to
    4.16  	  run it correctly (so putting it in <filename
    4.17 -	    class="directory">C:\\Program Files</filename> is probably
    4.18 +	    class="directory">C:\Program Files</filename> is probably
    4.19  	  not a good idea).</para>
    4.20        </note>
    4.21  
    4.22 @@ -781,7 +782,9 @@
    4.23  	your server, the next step is to ensure that Mercurial runs on
    4.24  	the server.  The following command should run
    4.25  	successfully:</para>
    4.26 +
    4.27        <programlisting>ssh myserver hg version</programlisting>
    4.28 +
    4.29        <para>If you see an error message instead of normal <command
    4.30  	  role="hg-cmd">hg version</command> output, this is usually
    4.31  	because you haven't installed Mercurial to <filename
    4.32 @@ -838,7 +841,7 @@
    4.33        <para>Both <command>ssh</command> and <command>plink</command>
    4.34  	accept a <option role="cmd-opt-ssh">-C</option> option which
    4.35  	turns on compression.  You can easily edit your <filename
    4.36 -	  role="special"> /.hgrc</filename>\ to enable compression for
    4.37 +	  role="special">~/.hgrc</filename> to enable compression for
    4.38  	all of Mercurial's uses of the ssh protocol.</para>
    4.39        <programlisting>[ui]
    4.40  ssh = ssh -C</programlisting>
    4.41 @@ -925,8 +928,7 @@
    4.42  	directory, from which they can serve up web pages.  A file
    4.43  	named <filename>foo</filename> in this directory will be
    4.44  	accessible at a URL of the form
    4.45 -	<literal>http://www.example.com/\
    4.46 -	  {</literal>username/foo}.</para>
    4.47 +	<literal>http://www.example.com/username/foo</literal>.</para>
    4.48  
    4.49        <para>To get started, find the <filename
    4.50  	  role="special">hgweb.cgi</filename> script that should be
    4.51 @@ -1006,13 +1008,6 @@
    4.52  
    4.53  	&ch06-apache-config.lst;
    4.54  
    4.55 -	<programlisting>&lt;Directory /home/*/public_html&gt;
    4.56 -	  AllowOverride FileInfo AuthConfig Limit Options MultiViews
    4.57 -	  Indexes SymLinksIfOwnerMatch IncludesNoExec &lt;Limit GET
    4.58 -	  POST OPTIONS&gt; Order allow,deny Allow from all
    4.59 -	  &lt;/Limit&gt; &lt;LimitExcept GET POST OPTIONS&gt; Order
    4.60 -	  deny,allow Deny from all &lt;/LimitExcept&gt;
    4.61 -	  &lt;/Directory&gt;</programlisting>
    4.62  	<para>If you find a similar-looking
    4.63  	  <literal>Directory</literal> group in your Apache
    4.64  	  configuration, the directive to look at inside it is
    4.65 @@ -1078,8 +1073,8 @@
    4.66  	  <literal>mod_userdir</literal>, both of which were disabled
    4.67  	  by default on my system.  I then added a few lines to the
    4.68  	  end of the config file, to configure these modules.</para>
    4.69 -	<programlisting>userdir.path = "public_html" cgi.assign = (
    4.70 -	  ".cgi" =&gt; "" )</programlisting>
    4.71 +	<programlisting>userdir.path = "public_html"
    4.72 +cgi.assign = (".cgi" =&gt; "" )</programlisting>
    4.73  	<para>With this done, <literal>lighttpd</literal> ran
    4.74  	  immediately for me.  If I had configured
    4.75  	  <literal>lighttpd</literal> before Apache, I'd almost
    4.76 @@ -1114,8 +1109,8 @@
    4.77        <para>You'll need to copy this script into your <filename
    4.78  	  class="directory">public_html</filename> directory, and
    4.79  	ensure that it's executable.</para>
    4.80 -      <programlisting>cp .../hgwebdir.cgi ~/public_html chmod 755
    4.81 -	~/public_html ~/public_html/hgwebdir.cgi</programlisting>
    4.82 +      <programlisting>cp .../hgwebdir.cgi ~/public_html
    4.83 +chmod 755 ~/public_html ~/public_html/hgwebdir.cgi</programlisting>
    4.84        <para>With basic configuration out of the way, try to visit
    4.85  	<ulink url="http://myhostname/
    4.86  	  myuser/hgwebdir.cgi">http://myhostname/
    4.87 @@ -1141,8 +1136,8 @@
    4.88  	publish <emphasis>every</emphasis> repository under the
    4.89  	directories you name.  The section should look like
    4.90  	this:</para>
    4.91 -      <programlisting>[collections] /my/root =
    4.92 -	/my/root</programlisting>
    4.93 +      <programlisting>[collections]
    4.94 +/my/root = /my/root</programlisting>
    4.95        <para>Mercurial interprets this by looking at the directory name
    4.96  	on the <emphasis>right</emphasis> hand side of the
    4.97  	<quote><literal>=</literal></quote> sign; finding repositories
    4.98 @@ -1201,8 +1196,9 @@
    4.99  	  to publish a specific list of repositories.  To do so,
   4.100  	  create a <literal>paths</literal> section, with contents of
   4.101  	  the following form.</para>
   4.102 -	<programlisting>[paths] repo1 = /my/path/to/some/repo repo2 =
   4.103 -	  /some/path/to/another</programlisting>
   4.104 +	<programlisting>[paths]
   4.105 +repo1 = /my/path/to/some/repo
   4.106 +repo2 = /some/path/to/another</programlisting>
   4.107  	<para>In this case, the virtual path (the component that will
   4.108  	  appear in a URL) is on the left hand side of each
   4.109  	  definition, while the path to the repository is on the
   4.110 @@ -1236,7 +1232,7 @@
   4.111  	you'll need to add an <envar
   4.112  	  role="rc-item-web">allow_archive</envar> item to the
   4.113  	<literal role="rc-web">web</literal> section of your <filename
   4.114 -	  role="special"> /.hgrc</filename>.</para>
   4.115 +	  role="special">~/.hgrc</filename>.</para>
   4.116  
   4.117      </sect2>
   4.118      <sect2>
   4.119 @@ -1279,8 +1275,8 @@
   4.120  	    <envar role="rc-item-web">allow_archive</envar> entry at
   4.121  	    all, this feature will be disabled.  Here is an example of
   4.122  	    how to enable all three supported formats.</para>
   4.123 -	  <programlisting>[web] allow_archive = bz2 gz
   4.124 -	    zip</programlisting>
   4.125 +	  <programlisting>[web]
   4.126 +allow_archive = bz2 gz zip</programlisting>
   4.127  	</listitem>
   4.128  	<listitem><para><envar role="rc-item-web">allowpull</envar>:
   4.129  	    Boolean.  Determines whether the web interface allows
   4.130 @@ -1298,9 +1294,9 @@
   4.131  	    address of a person or mailing list.  It often makes sense
   4.132  	    to place this entry in a repository's own <filename
   4.133  	      role="special">.hg/hgrc</filename> file, but it can make
   4.134 -	    sense to use in a global <filename role="special">
   4.135 -	      /.hgrc</filename>\ if every repository has a single
   4.136 -	    maintainer.</para>
   4.137 +	    sense to use in a global <filename
   4.138 +	      role="special">~/.hgrc</filename> if every repository
   4.139 +	    has a single maintainer.</para>
   4.140  	</listitem>
   4.141  	<listitem><para><envar role="rc-item-web">maxchanges</envar>:
   4.142  	    Integer.  The default maximum number of changesets to
   4.143 @@ -1325,7 +1321,8 @@
   4.144  	    <xref linkend="chap:template"/> for details.
   4.145  	    Here, you can see how to enable the
   4.146  	    <literal>gitweb</literal> style.</para>
   4.147 -	  <programlisting>[web] style = gitweb</programlisting>
   4.148 +	  <programlisting>[web]
   4.149 +style = gitweb</programlisting>
   4.150  	</listitem>
   4.151  	<listitem><para><envar role="rc-item-web">templates</envar>:
   4.152  	    Path.  The directory in which to search for template
   4.153 @@ -1337,7 +1334,7 @@
   4.154  	configuration items in a <literal role="rc-web">web</literal>
   4.155  	section of the <filename
   4.156  	  role="special">hgweb.config</filename> file instead of a
   4.157 -	<filename role="special"> /.hgrc</filename>\ file, for
   4.158 +	<filename role="special">~/.hgrc</filename> file, for
   4.159  	convenience.  These items are <envar
   4.160  	  role="rc-item-web">motd</envar> and <envar
   4.161  	  role="rc-item-web">style</envar>.</para>
   4.162 @@ -1348,8 +1345,7 @@
   4.163  	<para>A few <literal role="rc-web">web</literal> configuration
   4.164  	  items ought to be placed in a repository's local <filename
   4.165  	    role="special">.hg/hgrc</filename>, rather than a user's
   4.166 -	  or global <filename role="special">
   4.167 -	    /.hgrc</filename>.</para>
   4.168 +	  or global <filename role="special">~/.hgrc</filename>.</para>
   4.169  	<itemizedlist>
   4.170  	  <listitem><para><envar
   4.171  		role="rc-item-web">description</envar>: String.  A
   4.172 @@ -1369,7 +1365,7 @@
   4.173  
   4.174  	<para>Some of the items in the <literal
   4.175  	    role="rc-web">web</literal> section of a <filename
   4.176 -	    role="special"> /.hgrc</filename>\ file are only for use
   4.177 +	    role="special">~/.hgrc</filename> file are only for use
   4.178  	  with the <command role="hg-cmd">hg serve</command>
   4.179  	  command.</para>
   4.180  	<itemizedlist>
   4.181 @@ -1403,8 +1399,8 @@
   4.182  
   4.183        </sect3>
   4.184        <sect3>
   4.185 -	<title>Choosing the right <filename role="special">
   4.186 -	    /.hgrc</filename>\ file to add <literal
   4.187 +	<title>Choosing the right <filename
   4.188 +	    role="special">~/.hgrc</filename> file to add <literal
   4.189  	    role="rc-web">web</literal> items to</title>
   4.190  
   4.191  	<para>It is important to remember that a web server like
   4.192 @@ -1415,16 +1411,15 @@
   4.193  	  under that user ID.</para>
   4.194  
   4.195  	<para>If you add <literal role="rc-web">web</literal> items to
   4.196 -	  your own personal <filename role="special">
   4.197 -	    /.hgrc</filename>\ file, CGI scripts won't read that
   4.198 -	  <filename role="special"> /.hgrc</filename>\ file.  Those
   4.199 +	  your own personal <filename role="special">~/.hgrc</filename> file, CGI scripts won't read that
   4.200 +	  <filename role="special">~/.hgrc</filename> file.  Those
   4.201  	  settings will thus only affect the behaviour of the <command
   4.202  	    role="hg-cmd">hg serve</command> command when you run it.
   4.203  	  To cause CGI scripts to see your settings, either create a
   4.204 -	  <filename role="special"> /.hgrc</filename>\ file in the
   4.205 +	  <filename role="special">~/.hgrc</filename> file in the
   4.206  	  home directory of the user ID that runs your web server, or
   4.207  	  add those settings to a system-wide <filename
   4.208 -	    role="special"> /.hgrc</filename>\ file.</para>
   4.209 +	    role="special">~/.hgrc</filename> file.</para>
   4.210  
   4.211  
   4.212        </sect3>
     5.1 --- a/en/ch08-branch.xml	Tue Mar 17 21:47:12 2009 -0700
     5.2 +++ b/en/ch08-branch.xml	Wed Mar 18 00:00:58 2009 -0700
     5.3 @@ -520,8 +520,8 @@
     5.4        <quote>stable</quote> branch.  Such a hook might look like this
     5.5        inside the shared repo's <filename role="special">
     5.6  	/.hgrc</filename>.</para>
     5.7 -    <programlisting>[hooks] pretxnchangegroup.branch = hg heads
     5.8 -      --template '{branches} ' | grep mybranch</programlisting>
     5.9 +    <programlisting>[hooks]
    5.10 +pretxnchangegroup.branch = hg heads --template '{branches} ' | grep mybranch</programlisting>
    5.11  
    5.12    </sect1>
    5.13  </chapter>
     6.1 --- a/en/ch10-hook.xml	Tue Mar 17 21:47:12 2009 -0700
     6.2 +++ b/en/ch10-hook.xml	Wed Mar 18 00:00:58 2009 -0700
     6.3 @@ -115,7 +115,7 @@
     6.4        <para>In some cases, you may be exposed to hooks that you did
     6.5  	not install yourself.  If you work with Mercurial on an
     6.6  	unfamiliar system, Mercurial will run hooks defined in that
     6.7 -	system's global <filename role="special"> /.hgrc</filename>\
     6.8 +	system's global <filename role="special">~/.hgrc</filename>
     6.9  	file.
    6.10        </para>
    6.11  
    6.12 @@ -175,8 +175,7 @@
    6.13        <para>In a corporate intranet, this is somewhat easier to
    6.14  	control, as you can for example provide a
    6.15  	<quote>standard</quote> installation of Mercurial on an NFS
    6.16 -	filesystem, and use a site-wide <filename role="special">
    6.17 -	  /.hgrc</filename>\ file to define hooks that all users will
    6.18 +	filesystem, and use a site-wide <filename role="special">~/.hgrc</filename> file to define hooks that all users will
    6.19  	see.  However, this too has its limits; see below.
    6.20        </para>
    6.21  
    6.22 @@ -190,7 +189,7 @@
    6.23        </para>
    6.24  
    6.25        <para>If you deploy a system- or site-wide <filename
    6.26 -	  role="special"> /.hgrc</filename>\ file that defines some
    6.27 +	  role="special">~/.hgrc</filename> file that defines some
    6.28  	hooks, you should thus understand that your users can disable
    6.29  	or override those hooks.
    6.30        </para>
    6.31 @@ -203,7 +202,7 @@
    6.32  	want others to be able to work around.  For example, you may
    6.33  	have a requirement that every changeset must pass a rigorous
    6.34  	set of tests.  Defining this requirement via a hook in a
    6.35 -	site-wide <filename role="special"> /.hgrc</filename>\ won't
    6.36 +	site-wide <filename role="special">~/.hgrc</filename> won't
    6.37  	work for remote users on laptops, and of course local users
    6.38  	can subvert it at will by overriding the hook.
    6.39        </para>
    6.40 @@ -359,7 +358,7 @@
    6.41  
    6.42      <para>You add an entry to the <literal
    6.43  	role="rc-hooks">hooks</literal> section of your <filename
    6.44 -	role="special"> /.hgrc</filename>.  On the left is the name of
    6.45 +	role="special">~/.hgrc</filename>.  On the left is the name of
    6.46        the event to trigger on; on the right is the action to take.  As
    6.47        you can see, you can run an arbitrary shell command in a hook.
    6.48        Mercurial passes extra information to the hook using environment
    6.49 @@ -533,7 +532,7 @@
    6.50        <title>Writing an external hook</title>
    6.51  
    6.52        <para>When you define an external hook in your <filename
    6.53 -	  role="special"> /.hgrc</filename>\ and the hook is run, its
    6.54 +	  role="special">~/.hgrc</filename> and the hook is run, its
    6.55  	value is passed to your shell, which interprets it.  This
    6.56  	means that you can use normal shell constructs in the body of
    6.57  	the hook.
    6.58 @@ -561,7 +560,7 @@
    6.59      <sect2>
    6.60        <title>Telling Mercurial to use an in-process hook</title>
    6.61  
    6.62 -      <para>The <filename role="special"> /.hgrc</filename>\ syntax
    6.63 +      <para>The <filename role="special">~/.hgrc</filename> syntax
    6.64  	for defining an in-process hook is slightly different than for
    6.65  	an executable hook.  The value of the hook must start with the
    6.66  	text <quote><literal>python:</literal></quote>, and continue
    6.67 @@ -575,12 +574,12 @@
    6.68  	  work</quote>.
    6.69        </para>
    6.70  
    6.71 -      <para>The following <filename role="special"> /.hgrc</filename>\
    6.72 +      <para>The following <filename role="special">~/.hgrc</filename>
    6.73  	example snippet illustrates the syntax and meaning of the
    6.74  	notions we just described.
    6.75        </para>
    6.76 -      <programlisting>[hooks] commit.example =
    6.77 -	python:mymodule.submodule.myhook</programlisting>
    6.78 +      <programlisting>[hooks]
    6.79 +commit.example = python:mymodule.submodule.myhook</programlisting>
    6.80        <para>When Mercurial runs the <literal>commit.example</literal>
    6.81  	hook, it imports <literal>mymodule.submodule</literal>, looks
    6.82  	for the callable object named <literal>myhook</literal>, and
    6.83 @@ -595,7 +594,7 @@
    6.84  	the basic shape of the hook API:
    6.85        </para>
    6.86        <programlisting>def myhook(ui, repo, **kwargs):
    6.87 -	pass</programlisting>
    6.88 +    pass</programlisting>
    6.89        <para>The first argument to a Python hook is always a <literal
    6.90  	  role="py-mod-mercurial.ui">ui</literal> object.  The second
    6.91  	is a repository object; at the moment, it is always an
    6.92 @@ -745,8 +744,8 @@
    6.93  	  changeset, and roll back a group of changesets if they
    6.94  	  modify <quote>forbidden</quote> files.  Example:
    6.95  	</para>
    6.96 -	<programlisting>[hooks] pretxnchangegroup.acl =
    6.97 -	  python:hgext.acl.hook</programlisting>
    6.98 +	<programlisting>[hooks]
    6.99 +pretxnchangegroup.acl = python:hgext.acl.hook</programlisting>
   6.100  
   6.101  	<para>The <literal role="hg-ext">acl</literal> extension is
   6.102  	  configured using three sections.
   6.103 @@ -813,8 +812,10 @@
   6.104  	  to any file or directory except <filename
   6.105  	    class="directory">source/sensitive</filename>.
   6.106  	</para>
   6.107 -	<programlisting>[acl.allow] docs/** = docwriter [acl.deny]
   6.108 -	  source/sensitive/** = intern</programlisting>
   6.109 +	<programlisting>[acl.allow]
   6.110 +docs/** = docwriter
   6.111 +[acl.deny]
   6.112 +source/sensitive/** = intern</programlisting>
   6.113  
   6.114        </sect3>
   6.115        <sect3>
   6.116 @@ -827,9 +828,10 @@
   6.117  	  possible) to pass in the <option
   6.118  	    role="hg-opt-global">--debug</option> option, don't forget
   6.119  	  that you can enable debugging output in your <filename
   6.120 -	    role="special"> /.hgrc</filename>:
   6.121 -	</para>
   6.122 -	<programlisting>[ui] debug = true</programlisting>
   6.123 +	    role="special">~/.hgrc</filename>:
   6.124 +	</para>
   6.125 +	<programlisting>[ui]
   6.126 +debug = true</programlisting>
   6.127  	<para>With this enabled, the <literal
   6.128  	    role="hg-ext">acl</literal> hook will print enough
   6.129  	  information to let you figure out why it is allowing or
   6.130 @@ -893,12 +895,12 @@
   6.131  	  hook</title>
   6.132  
   6.133  	<para>You should configure this hook in your server's
   6.134 -	  <filename role="special"> /.hgrc</filename>\ as an <literal
   6.135 +	  <filename role="special">~/.hgrc</filename> as an <literal
   6.136  	    role="hook">incoming</literal> hook, for example as
   6.137  	  follows:
   6.138  	</para>
   6.139 -	<programlisting>[hooks] incoming.bugzilla =
   6.140 -	  python:hgext.bugzilla.hook</programlisting>
   6.141 +	<programlisting>[hooks]
   6.142 +incoming.bugzilla = python:hgext.bugzilla.hook</programlisting>
   6.143  
   6.144  	<para>Because of the specialised nature of this hook, and
   6.145  	  because Bugzilla was not written with this kind of
   6.146 @@ -915,7 +917,7 @@
   6.147  
   6.148  	<para>Configuration information for this hook lives in the
   6.149  	  <literal role="rc-bugzilla">bugzilla</literal> section of
   6.150 -	  your <filename role="special"> /.hgrc</filename>.
   6.151 +	  your <filename role="special">~/.hgrc</filename>.
   6.152  	</para>
   6.153  	<itemizedlist>
   6.154  	  <listitem><para><envar
   6.155 @@ -950,7 +952,7 @@
   6.156  	      password for the user you configured above.  This is
   6.157  	      stored as plain text, so you should make sure that
   6.158  	      unauthorised users cannot read the <filename
   6.159 -		role="special"> /.hgrc</filename>\ file where you
   6.160 +		role="special">~/.hgrc</filename> file where you
   6.161  	      store this information.
   6.162  	    </para>
   6.163  	  </listitem>
   6.164 @@ -1005,8 +1007,8 @@
   6.165  	  email address on the left, and a Bugzilla user name on the
   6.166  	  right.
   6.167  	</para>
   6.168 -	<programlisting>[usermap] jane.user@example.com =
   6.169 -	  jane</programlisting>
   6.170 +	<programlisting>[usermap]
   6.171 +jane.user@example.com = jane</programlisting>
   6.172  	<para>You can either keep the <literal
   6.173  	    role="rc-usermap">usermap</literal> data in a normal
   6.174  	  <filename role="special">~/.hgrc</filename>, or tell the
   6.175 @@ -1017,18 +1019,17 @@
   6.176  	  a user-modifiable repository.  This makes it possible to let
   6.177  	  your users maintain their own <envar
   6.178  	    role="rc-item-bugzilla">usermap</envar> entries.  The main
   6.179 -	  <filename role="special"> /.hgrc</filename>\ file might look
   6.180 +	  <filename role="special">~/.hgrc</filename> file might look
   6.181  	  like this:
   6.182  	</para>
   6.183 -	<programlisting># regular hgrc file refers to external usermap
   6.184 -	  file [bugzilla] usermap =
   6.185 -	  /home/hg/repos/userdata/bugzilla-usermap.conf</programlisting>
   6.186 +	<programlisting># regular hgrc file refers to external usermap file
   6.187 +[bugzilla]
   6.188 +usermap = /home/hg/repos/userdata/bugzilla-usermap.conf</programlisting>
   6.189  	<para>While the <filename>usermap</filename> file that it
   6.190  	  refers to might look like this:
   6.191  	</para>
   6.192 -	<programlisting># bugzilla-usermap.conf - inside a hg
   6.193 -	  repository [usermap] stephanie@example.com =
   6.194 -	  steph</programlisting>
   6.195 +	<programlisting># bugzilla-usermap.conf - inside a hg repository
   6.196 +[usermap] stephanie@example.com = steph</programlisting>
   6.197  
   6.198        </sect3>
   6.199        <sect3>
   6.200 @@ -1036,7 +1037,7 @@
   6.201  
   6.202  	<para>You can configure the text that this hook adds as a
   6.203  	  comment; you specify it in the form of a Mercurial template.
   6.204 -	  Several <filename role="special"> /.hgrc</filename>\ entries
   6.205 +	  Several <filename role="special">~/.hgrc</filename> entries
   6.206  	  (still in the <literal role="rc-bugzilla">bugzilla</literal>
   6.207  	  section) control this behaviour.
   6.208  	</para>
   6.209 @@ -1068,27 +1069,20 @@
   6.210  	<para>In addition, you can add a <envar
   6.211  	    role="rc-item-web">baseurl</envar> item to the <literal
   6.212  	    role="rc-web">web</literal> section of your <filename
   6.213 -	    role="special"> /.hgrc</filename>.  The <literal
   6.214 +	    role="special">~/.hgrc</filename>.  The <literal
   6.215  	    role="hg-ext">bugzilla</literal> hook will make this
   6.216  	  available when expanding a template, as the base string to
   6.217  	  use when constructing a URL that will let users browse from
   6.218  	  a Bugzilla comment to view a changeset.  Example:
   6.219  	</para>
   6.220 -	<programlisting>[web] baseurl =
   6.221 -	  http://hg.domain.com/</programlisting>
   6.222 +	<programlisting>[web]
   6.223 +baseurl = http://hg.domain.com/</programlisting>
   6.224  
   6.225  	<para>Here is an example set of <literal
   6.226  	    role="hg-ext">bugzilla</literal> hook config information.
   6.227  	</para>
   6.228 -	<programlisting>[bugzilla] host = bugzilla.example.com
   6.229 -	  password = mypassword version = 2.16 # server-side repos
   6.230 -	  live in /home/hg/repos, so strip 4 leading # separators
   6.231 -	  strip = 4 hgweb = http://hg.example.com/ usermap =
   6.232 -	  /home/hg/repos/notify/bugzilla.conf template = Changeset
   6.233 -	  {node|short}, made by {author} in the {webroot} repo, refers
   6.234 -	  to this bug.\\nFor complete details, see
   6.235 -	  {hgweb}{webroot}?cmd=changeset;node={node|short}\\nChangeset
   6.236 -	  description:\\n\\t{desc|tabindent}</programlisting>
   6.237 +
   6.238 +	&ch10-bugzilla-config.lst;
   6.239  
   6.240        </sect3>
   6.241        <sect3>
   6.242 @@ -1116,9 +1110,8 @@
   6.243  	  <command>sudo</command> command.  Here is an example entry
   6.244  	  for a <filename>sudoers</filename> file.
   6.245  	</para>
   6.246 -	<programlisting>hg_user = (httpd_user) NOPASSWD:
   6.247 -	  /var/www/html/bugzilla/processmail-wrapper
   6.248 -	  %s</programlisting>
   6.249 +	<programlisting>hg_user = (httpd_user)
   6.250 +NOPASSWD: /var/www/html/bugzilla/processmail-wrapper %s</programlisting>
   6.251  	<para>This allows the <literal>hg_user</literal> user to run a
   6.252  	  <filename>processmail-wrapper</filename> program under the
   6.253  	  identity of <literal>httpd_user</literal>.
   6.254 @@ -1131,8 +1124,8 @@
   6.255  	  <filename>sudoers</filename> file.  The contents of the
   6.256  	  wrapper script are simple:
   6.257  	</para>
   6.258 -	<programlisting>#!/bin/sh cd `dirname $0` &amp;&amp;
   6.259 -	  ./processmail "$1" nobody@example.com</programlisting>
   6.260 +	<programlisting>#!/bin/sh
   6.261 +cd `dirname $0` &amp;&amp; ./processmail "$1" nobody@example.com</programlisting>
   6.262  	<para>It doesn't seem to matter what email address you pass to
   6.263  	  <filename>processmail</filename>.
   6.264  	</para>
   6.265 @@ -1143,8 +1136,7 @@
   6.266  	  push changes to the server.  The error message will look
   6.267  	  like this:
   6.268  	</para>
   6.269 -	<programlisting>cannot find bugzilla user id for
   6.270 -	  john.q.public@example.com</programlisting>
   6.271 +	<programlisting>cannot find bugzilla user id for john.q.public@example.com</programlisting>
   6.272  	<para>What this means is that the committer's address,
   6.273  	  <literal>john.q.public@example.com</literal>, is not a valid
   6.274  	  Bugzilla user name, nor does it have an entry in your
   6.275 @@ -1189,14 +1181,15 @@
   6.276  	  changesets (all those that arrived in a single pull or
   6.277  	  push).
   6.278  	</para>
   6.279 -	<programlisting>[hooks] # send one email per group of changes
   6.280 -	  changegroup.notify = python:hgext.notify.hook # send one
   6.281 -	  email per change incoming.notify =
   6.282 -	  python:hgext.notify.hook</programlisting>
   6.283 +	<programlisting>[hooks]
   6.284 +# send one email per group of changes
   6.285 +changegroup.notify = python:hgext.notify.hook
   6.286 +# send one email per change
   6.287 +incoming.notify = python:hgext.notify.hook</programlisting>
   6.288  
   6.289  	<para>Configuration information for this hook lives in the
   6.290  	  <literal role="rc-notify">notify</literal> section of a
   6.291 -	  <filename role="special"> /.hgrc</filename>\ file.
   6.292 +	  <filename role="special">~/.hgrc</filename> file.
   6.293  	</para>
   6.294  	<itemizedlist>
   6.295  	  <listitem><para><envar role="rc-item-notify">test</envar>:
   6.296 @@ -1214,7 +1207,7 @@
   6.297  	  <listitem><para><envar role="rc-item-notify">config</envar>:
   6.298  	      The path to a configuration file that contains
   6.299  	      subscription information.  This is kept separate from
   6.300 -	      the main <filename role="special"> /.hgrc</filename>\ so
   6.301 +	      the main <filename role="special">~/.hgrc</filename> so
   6.302  	      that you can maintain it in a repository of its own.
   6.303  	      People can then clone that repository, update their
   6.304  	      subscriptions, and push the changes back to your server.
   6.305 @@ -1273,35 +1266,14 @@
   6.306  	<para>Here is an example set of <literal
   6.307  	    role="hg-ext">notify</literal> configuration information.
   6.308  	</para>
   6.309 -	<programlisting>
   6.310 -	  [notify] # really send email test = false # subscriber data
   6.311 -	  lives in the notify repo config =
   6.312 -	  /home/hg/repos/notify/notify.conf # repos live in
   6.313 -	  /home/hg/repos on server, so strip 4 "/" chars strip = 4
   6.314 -	  template = X-Hg-Repo: {webroot} Subject: {webroot}:
   6.315 -	  {desc|firstline|strip} From: {author} changeset {node|short}
   6.316 -	  in {root} details:
   6.317 -	  {baseurl}{webroot}?cmd=changeset;node={node|short}
   6.318 -	  description: {desc|tabindent|strip} [web] baseurl =
   6.319 -	  http://hg.example.com/
   6.320 -	</programlisting>
   6.321 +
   6.322 +	&ch10-notify-config.lst;
   6.323  
   6.324  	<para>This will produce a message that looks like the
   6.325  	  following:
   6.326  	</para>
   6.327 -	<programlisting>
   6.328 -	  X-Hg-Repo: tests/slave Subject: tests/slave: Handle error
   6.329 -	  case when slave has no buffers Date: Wed,  2 Aug 2006
   6.330 -	  15:25:46 -0700 (PDT) changeset 3cba9bfe74b5 in
   6.331 -	  /home/hg/repos/tests/slave details:
   6.332 -	  http://hg.example.com/tests/slave?cmd=changeset;node=3cba9bfe74b5 
   6.333 -	  description: Handle error case when slave has no buffers
   6.334 -	  diffs (54 lines): diff -r 9d95df7cf2ad -r 3cba9bfe74b5
   6.335 -	  include/tests.h --- a/include/tests.h      Wed Aug 02
   6.336 -	  15:19:52 2006 -0700 +++ b/include/tests.h      Wed Aug 02
   6.337 -	  15:25:26 2006 -0700 @@ -212,6 +212,15 @@ static __inline__
   6.338 -	  void test_headers(void *h) [...snip...]
   6.339 -	</programlisting>
   6.340 +
   6.341 +	&ch10-notify-config-mail.lst;
   6.342  
   6.343        </sect3>
   6.344        <sect3>
   6.345 @@ -1327,9 +1299,7 @@
   6.346        <para>An in-process hook is called with arguments of the
   6.347  	following form:
   6.348        </para>
   6.349 -      <programlisting>
   6.350 -	def myhook(ui, repo, **kwargs): pass
   6.351 -      </programlisting>
   6.352 +      <programlisting>def myhook(ui, repo, **kwargs): pass</programlisting>
   6.353        <para>The <literal>ui</literal> parameter is a <literal
   6.354  	  role="py-mod-mercurial.ui">ui</literal> object. The
   6.355  	<literal>repo</literal> parameter is a <literal
   6.356 @@ -1373,7 +1343,7 @@
   6.357        <para>Note that changeset IDs are passed into Python hooks as
   6.358  	hexadecimal strings, not the binary hashes that Mercurial's
   6.359  	APIs normally use.  To convert a hash from hex to binary, use
   6.360 -	the \pymodfunc{mercurial.node}{bin} function.
   6.361 +	the <literal>bin</literal> function.
   6.362        </para>
   6.363  
   6.364      </sect2>
   6.365 @@ -1526,9 +1496,8 @@
   6.366  	<listitem><para><literal>node</literal>: A changeset ID.  The
   6.367  	    changeset ID of the first changeset in the group that was
   6.368  	    added.  All changesets between this and
   6.369 -	    \index{tags!<literal>tip</literal>}<literal>tip</literal>,
   6.370 -	    inclusive, were added by a single <command
   6.371 -	      role="hg-cmd">hg pull</command>, <command
   6.372 +	    <literal role="tag">tip</literal>, inclusive, were added by a single
   6.373 +	    <command role="hg-cmd">hg pull</command>, <command
   6.374  	      role="hg-cmd">hg push</command> or <command
   6.375  	      role="hg-cmd">hg unbundle</command>.
   6.376  	  </para>
   6.377 @@ -1880,7 +1849,7 @@
   6.378  	<listitem><para><literal>node</literal>: A changeset ID.  The
   6.379  	    changeset ID of the first changeset in the group that was
   6.380  	    added.  All changesets between this and
   6.381 -	    \index{tags!<literal>tip</literal>}<literal>tip</literal>,
   6.382 +	    <literal role="tag">tip</literal>,
   6.383  	    inclusive, were added by a single <command
   6.384  	      role="hg-cmd">hg pull</command>, <command
   6.385  	      role="hg-cmd">hg push</command> or <command
     7.1 --- a/en/ch11-template.xml	Tue Mar 17 21:47:12 2009 -0700
     7.2 +++ b/en/ch11-template.xml	Wed Mar 18 00:00:58 2009 -0700
     7.3 @@ -44,11 +44,12 @@
     7.4        <title>Setting a default style</title>
     7.5  
     7.6        <para>You can modify the output style that Mercurial will use
     7.7 -	for every command by editing your <filename role="special">
     7.8 -	  /.hgrc</filename>\ file, naming the style you would prefer
     7.9 -	to use.</para>
    7.10 -
    7.11 -      <programlisting>[ui] style = compact</programlisting>
    7.12 +	for every command by editing your <filename
    7.13 +	  role="special">~/.hgrc</filename> file, naming the style
    7.14 +	you would prefer to use.</para>
    7.15 +
    7.16 +      <programlisting>[ui]
    7.17 +style = compact</programlisting>
    7.18  
    7.19        <para>If you write a style of your own, you can use it by either
    7.20  	providing the path to your style file, or copying your style
    7.21 @@ -212,27 +213,27 @@
    7.22        single replacement, as described below.</para>
    7.23  
    7.24      <itemizedlist>
    7.25 -      <listitem><para><literal>\textbackslash\textbackslash</literal>:
    7.26 +      <listitem><para><literal>\</literal>:
    7.27  	  Backslash, <quote><literal>\</literal></quote>, ASCII
    7.28  	  134.</para>
    7.29        </listitem>
    7.30 -      <listitem><para><literal>\textbackslash n</literal>: Newline,
    7.31 +      <listitem><para><literal>\n</literal>: Newline,
    7.32  	  ASCII 12.</para>
    7.33        </listitem>
    7.34 -      <listitem><para><literal>\textbackslash r</literal>: Carriage
    7.35 +      <listitem><para><literal>\r</literal>: Carriage
    7.36  	  return, ASCII 15.</para>
    7.37        </listitem>
    7.38 -      <listitem><para><literal>\textbackslash t</literal>: Tab, ASCII
    7.39 +      <listitem><para><literal>\t</literal>: Tab, ASCII
    7.40  	  11.</para>
    7.41        </listitem>
    7.42 -      <listitem><para><literal>\textbackslash v</literal>: Vertical
    7.43 +      <listitem><para><literal>\v</literal>: Vertical
    7.44  	  tab, ASCII 13.</para>
    7.45        </listitem>
    7.46 -      <listitem><para><literal>\textbackslash {</literal>: Open curly
    7.47 +      <listitem><para><literal>{</literal>: Open curly
    7.48  	  brace, <quote><literal>{</literal></quote>, ASCII
    7.49  	  173.</para>
    7.50        </listitem>
    7.51 -      <listitem><para><literal>\textbackslash }</literal>: Close curly
    7.52 +      <listitem><para><literal>}</literal>: Close curly
    7.53  	  brace, <quote><literal>}</literal></quote>, ASCII
    7.54  	  175.</para>
    7.55        </listitem></itemizedlist>
    7.56 @@ -548,24 +549,19 @@
    7.57        <itemizedlist>
    7.58  	<listitem><para>The first component is simply Mercurial's way
    7.59  	    of saying <quote>I am giving up</quote>.</para>
    7.60 -	  <programlisting>___abort___: broken.style:1: parse
    7.61 -	    error</programlisting>
    7.62 +	  <programlisting>___abort___: broken.style:1: parse error</programlisting>
    7.63  	</listitem>
    7.64  	<listitem><para>Next comes the name of the style file that
    7.65  	    contains the error.</para>
    7.66 -	  <programlisting>
    7.67 -	    abort: ___broken.style___:1: parse error
    7.68 -	  </programlisting>
    7.69 +	  <programlisting>abort: ___broken.style___:1: parse error</programlisting>
    7.70  	</listitem>
    7.71  	<listitem><para>Following the file name is the line number
    7.72  	    where the error was encountered.</para>
    7.73 -	  <programlisting>abort: broken.style:___1___: parse
    7.74 -	    error</programlisting>
    7.75 +	  <programlisting>abort: broken.style:___1___: parse error</programlisting>
    7.76  	</listitem>
    7.77  	<listitem><para>Finally, a description of what went
    7.78  	    wrong.</para>
    7.79 -	  <programlisting>abort: broken.style:1: ___parse
    7.80 -	    error___</programlisting>
    7.81 +	  <programlisting>abort: broken.style:1: ___parse error___</programlisting>
    7.82  	</listitem>
    7.83  	<listitem><para>The description of the problem is not always
    7.84  	    clear (as in this case), but even when it is cryptic, it
     8.1 --- a/en/ch12-mq.xml	Tue Mar 17 21:47:12 2009 -0700
     8.2 +++ b/en/ch12-mq.xml	Wed Mar 18 00:00:58 2009 -0700
     8.3 @@ -256,7 +256,8 @@
     8.4  	role="home">~/.hgrc</filename> file, and add the lines
     8.5        below.</para>
     8.6  
     8.7 -    <programlisting>[extensions] hgext.mq =</programlisting>
     8.8 +    <programlisting>[extensions]
     8.9 +hgext.mq =</programlisting>
    8.10  
    8.11      <para>Once the extension is enabled, it will make a number of new
    8.12        commands available.  To verify that the extension is working,
    8.13 @@ -869,11 +870,9 @@
    8.14  	      role="hg-opt-update">-C</option></command> to override
    8.15  	  the patches you have pushed.</para>
    8.16        </listitem>
    8.17 -      <listitem><para>Merge all patches using
    8.18 -	  \hgcmdargs{qpush}{<option role="hg-ext-mq-cmd-qpush-opt">hg
    8.19 -	    -m</option> <option role="hg-ext-mq-cmd-qpush-opt">hg
    8.20 -	    -a</option>}.  The <option
    8.21 -	    role="hg-ext-mq-cmd-qpush-opt">hg -m</option> option to
    8.22 +      <listitem><para>Merge all patches using <command>hg qpush -m
    8.23 +	    -a</command>.  The <option
    8.24 +	    role="hg-ext-mq-cmd-qpush-opt">-m</option> option to
    8.25  	  <command role="hg-ext-mq">qpush</command> tells MQ to
    8.26  	  perform a three-way merge if the patch fails to
    8.27  	  apply.</para>
    8.28 @@ -930,10 +929,8 @@
    8.29        changeset ID will also accept the name of an applied patch.  MQ
    8.30        augments the tags normally in the repository with an eponymous
    8.31        one for each applied patch.  In addition, the special tags
    8.32 -      \index{tags!special tag
    8.33 -      names!<literal>qbase</literal>}<literal>qbase</literal> and
    8.34 -      \index{tags!special tag
    8.35 -      names!<literal>qtip</literal>}<literal>qtip</literal> identify
    8.36 +      <literal role="tag">qbase</literal> and
    8.37 +      <literal role="tag">qtip</literal> identify
    8.38        the <quote>bottom-most</quote> and topmost applied patches,
    8.39        respectively.</para>
    8.40  
    8.41 @@ -942,17 +939,14 @@
    8.42      <itemizedlist>
    8.43        <listitem><para>Want to patchbomb a mailing list with your
    8.44  	  latest series of changes?</para>
    8.45 -	<programlisting>hg email qbase:qtip
    8.46 -	</programlisting>
    8.47 +	<programlisting>hg email qbase:qtip</programlisting>
    8.48  	<para>  (Don't know what <quote>patchbombing</quote> is?  See
    8.49  	  section <xref linkend="sec:hgext:patchbomb"/>.)</para>
    8.50        </listitem>
    8.51        <listitem><para>Need to see all of the patches since
    8.52  	  <literal>foo.patch</literal> that have touched files in a
    8.53  	  subdirectory of your tree?</para>
    8.54 -	<programlisting>
    8.55 -	  hg log -r foo.patch:qtip <emphasis>subdir</emphasis>
    8.56 -	</programlisting>
    8.57 +	<programlisting>hg log -r foo.patch:qtip subdir</programlisting>
    8.58        </listitem>
    8.59      </itemizedlist>
    8.60  
    8.61 @@ -1080,8 +1074,7 @@
    8.62  	snippet in your <filename
    8.63  	  role="home">~/.bashrc</filename>.</para>
    8.64  
    8.65 -      <programlisting>alias mq=`hg -R $(hg
    8.66 -	root)/.hg/patches'</programlisting>
    8.67 +      <programlisting>alias mq=`hg -R $(hg root)/.hg/patches'</programlisting>
    8.68  
    8.69        <para>You can then issue commands of the form <command>mq
    8.70  	  pull</command> from the main repository.</para>
     9.1 --- a/en/ch13-mq-collab.xml	Tue Mar 17 21:47:12 2009 -0700
     9.2 +++ b/en/ch13-mq-collab.xml	Wed Mar 18 00:00:58 2009 -0700
     9.3 @@ -460,8 +460,9 @@
     9.4  	  role="hg-ext">extdiff</literal> extension in the usual way,
     9.5  	by adding a line to the <literal
     9.6  	  role="rc-extensions">extensions</literal> section of your
     9.7 -	<filename role="special"> /.hgrc</filename>.</para>
     9.8 -      <programlisting>[extensions] extdiff =</programlisting>
     9.9 +	<filename role="special">~/.hgrc</filename>.</para>
    9.10 +      <programlisting>[extensions]
    9.11 +extdiff =</programlisting>
    9.12        <para>The <command>interdiff</command> command expects to be
    9.13  	passed the names of two files, but the <literal
    9.14  	  role="hg-ext">extdiff</literal> extension passes the program
    9.15 @@ -477,22 +478,20 @@
    9.16        <para>With the <filename role="special">hg-interdiff</filename>
    9.17  	program in your shell's search path, you can run it as
    9.18  	follows, from inside an MQ patch directory:</para>
    9.19 -      <programlisting>hg extdiff -p hg-interdiff -r A:B
    9.20 -	my-change.patch</programlisting>
    9.21 +      <programlisting>hg extdiff -p hg-interdiff -r A:B my-change.patch</programlisting>
    9.22        <para>Since you'll probably want to use this long-winded command
    9.23  	a lot, you can get <literal role="hg-ext">hgext</literal> to
    9.24  	make it available as a normal Mercurial command, again by
    9.25 -	editing your <filename role="special">
    9.26 -	  /.hgrc</filename>.</para>
    9.27 -      <programlisting>[extdiff] cmd.interdiff =
    9.28 -	hg-interdiff</programlisting>
    9.29 +	editing your <filename
    9.30 +	  role="special">~/.hgrc</filename>.</para>
    9.31 +      <programlisting>[extdiff]
    9.32 +cmd.interdiff = hg-interdiff</programlisting>
    9.33        <para>This directs <literal role="hg-ext">hgext</literal> to
    9.34  	make an <literal>interdiff</literal> command available, so you
    9.35  	can now shorten the previous invocation of <command
    9.36  	  role="hg-ext-extdiff">extdiff</command> to something a
    9.37  	little more wieldy.</para>
    9.38 -      <programlisting>hg interdiff -r A:B
    9.39 -	my-change.patch</programlisting>
    9.40 +      <programlisting>hg interdiff -r A:B my-change.patch</programlisting>
    9.41  
    9.42        <note>
    9.43  	<para>  The <command>interdiff</command> command works well
    10.1 --- a/en/ch14-hgext.xml	Tue Mar 17 21:47:12 2009 -0700
    10.2 +++ b/en/ch14-hgext.xml	Wed Mar 18 00:00:58 2009 -0700
    10.3 @@ -166,11 +166,10 @@
    10.4      <orderedlist>
    10.5        <listitem><para>Clone the Python <literal>inotify</literal>
    10.6  	  binding repository.  Build and install it.</para>
    10.7 -	<programlisting>
    10.8 -	  hg clone http://hg.kublai.com/python/inotify cd inotify
    10.9 -	  python setup.py build --force sudo python setup.py install
   10.10 -	  --skip-build
   10.11 -	</programlisting>
   10.12 +	<programlisting>hg clone http://hg.kublai.com/python/inotify
   10.13 +cd inotify
   10.14 +python setup.py build --force
   10.15 +sudo python setup.py install --skip-build</programlisting>
   10.16        </listitem>
   10.17        <listitem><para>Clone the <filename
   10.18  	    class="directory">crew</filename> Mercurial repository.
   10.19 @@ -178,12 +177,9 @@
   10.20  	  repository so that Mercurial Queues will be able to apply
   10.21  	  patches to your cope of the <filename
   10.22  	    class="directory">crew</filename> repository.</para>
   10.23 -	<programlisting>
   10.24 -	  hg clone http://hg.intevation.org/mercurial/crew hg clone
   10.25 -	  crew inotify hg clone
   10.26 -	  http://hg.kublai.com/mercurial/patches/inotify
   10.27 -	  inotify/.hg/patches
   10.28 -	</programlisting>
   10.29 +	<programlisting>hg clone http://hg.intevation.org/mercurial/crew
   10.30 +hg clone crew inotify
   10.31 +hg clone http://hg.kublai.com/mercurial/patches/inotify inotify/.hg/patches</programlisting>
   10.32        </listitem>
   10.33        <listitem><para>Make sure that you have the Mercurial Queues
   10.34  	  extension, <literal role="hg-ext">mq</literal>, enabled.  If
   10.35 @@ -197,9 +193,8 @@
   10.36  	  using the <option role="hg-ext-mq-cmd-qpush-opt">hg
   10.37  	    -a</option> option to the <command
   10.38  	    role="hg-ext-mq">qpush</command> command.</para>
   10.39 -	<programlisting>
   10.40 -	  cd inotify hg qpush -a
   10.41 -	</programlisting>
   10.42 +	<programlisting>cd inotify
   10.43 +hg qpush -a</programlisting>
   10.44        </listitem>
   10.45        <listitem><para>  If you get an error message from <command
   10.46  	    role="hg-ext-mq">qpush</command>, you should not continue.
   10.47 @@ -207,16 +202,14 @@
   10.48        </listitem>
   10.49        <listitem><para>Build and install the patched version of
   10.50  	  Mercurial.</para>
   10.51 -	<programlisting>
   10.52 -	  python setup.py build --force sudo python setup.py install
   10.53 -	  --skip-build
   10.54 -	</programlisting>
   10.55 +	<programlisting>python setup.py build --force
   10.56 +sudo python setup.py install --skip-build</programlisting>
   10.57        </listitem>
   10.58      </orderedlist>
   10.59      <para>Once you've build a suitably patched version of Mercurial,
   10.60        all you need to do to enable the <literal
   10.61  	role="hg-ext">inotify</literal> extension is add an entry to
   10.62 -      your <filename role="special"> /.hgrc</filename>.</para>
   10.63 +      your <filename role="special">~/.hgrc</filename>.</para>
   10.64      <programlisting>[extensions] inotify =</programlisting>
   10.65      <para>When the <literal role="hg-ext">inotify</literal> extension
   10.66        is enabled, Mercurial will automatically and transparently start
   10.67 @@ -280,9 +273,10 @@
   10.68      <para>The <literal role="hg-ext">extdiff</literal> extension is
   10.69        bundled with Mercurial, so it's easy to set up.  In the <literal
   10.70  	role="rc-extensions">extensions</literal> section of your
   10.71 -      <filename role="special"> /.hgrc</filename>, simply add a
   10.72 +      <filename role="special">~/.hgrc</filename>, simply add a
   10.73        one-line entry to enable the extension.</para>
   10.74 -    <programlisting>[extensions] extdiff =</programlisting>
   10.75 +    <programlisting>[extensions]
   10.76 +extdiff =</programlisting>
   10.77      <para>This introduces a command named <command
   10.78  	role="hg-ext-extdiff">extdiff</command>, which by default uses
   10.79        your system's <command>diff</command> command to generate a
   10.80 @@ -372,15 +366,16 @@
   10.81  	<emphasis>new</emphasis> commands that will invoke your diff
   10.82  	viewer with exactly the right options.</para>
   10.83  
   10.84 -      <para>All you need to do is edit your <filename role="special">
   10.85 -	  /.hgrc</filename>, and add a section named <literal
   10.86 -	  role="rc-extdiff">extdiff</literal>.  Inside this section,
   10.87 -	you can define multiple commands.  Here's how to add a
   10.88 -	<literal>kdiff3</literal> command.  Once you've defined this,
   10.89 -	you can type <quote><literal>hg kdiff3</literal></quote> and
   10.90 -	the <literal role="hg-ext">extdiff</literal> extension will
   10.91 -	run <command>kdiff3</command> for you.</para>
   10.92 -      <programlisting>[extdiff] cmd.kdiff3 =</programlisting>
   10.93 +      <para>All you need to do is edit your <filename
   10.94 +	  role="special">~/.hgrc</filename>, and add a section named
   10.95 +	<literal role="rc-extdiff">extdiff</literal>.  Inside this
   10.96 +	section, you can define multiple commands.  Here's how to add
   10.97 +	a <literal>kdiff3</literal> command.  Once you've defined
   10.98 +	this, you can type <quote><literal>hg kdiff3</literal></quote>
   10.99 +	and the <literal role="hg-ext">extdiff</literal> extension
  10.100 +	will run <command>kdiff3</command> for you.</para>
  10.101 +      <programlisting>[extdiff]
  10.102 +cmd.kdiff3 =</programlisting>
  10.103        <para>If you leave the right hand side of the definition empty,
  10.104  	as above, the <literal role="hg-ext">extdiff</literal>
  10.105  	extension uses the name of the command you defined as the name
  10.106 @@ -388,7 +383,8 @@
  10.107  	be the same.  Here, we define a command named
  10.108  	<quote><literal>hg wibble</literal></quote>, which runs
  10.109  	<command>kdiff3</command>.</para>
  10.110 -      <programlisting>[extdiff] cmd.wibble = kdiff3</programlisting>
  10.111 +      <programlisting>[extdiff]
  10.112 + cmd.wibble = kdiff3</programlisting>
  10.113  
  10.114        <para>You can also specify the default options that you want to
  10.115  	invoke your diff viewing program with.  The prefix to use is
  10.116 @@ -397,8 +393,9 @@
  10.117  	defines a <quote><literal>hg vimdiff</literal></quote> command
  10.118  	that runs the <command>vim</command> editor's
  10.119  	<literal>DirDiff</literal> extension.</para>
  10.120 -      <programlisting>[extdiff] cmd.vimdiff = vim opts.vimdiff = -f
  10.121 -	'+next' '+execute "DirDiff" argv(0) argv(1)'</programlisting>
  10.122 +      <programlisting>[extdiff]
  10.123 + cmd.vimdiff = vim
  10.124 +opts.vimdiff = -f '+next' '+execute "DirDiff" argv(0) argv(1)'</programlisting>
  10.125  
  10.126      </sect2>
  10.127    </sect1>
  10.128 @@ -433,7 +430,8 @@
  10.129  	role="hg-ext">patchbomb</literal> extension takes just one or
  10.130        two lines in your <filename role="special">
  10.131  	/.hgrc</filename>.</para>
  10.132 -    <programlisting>[extensions] patchbomb =</programlisting>
  10.133 +    <programlisting>[extensions]
  10.134 +patchbomb =</programlisting>
  10.135      <para>Once you've enabled the extension, you will have a new
  10.136        command available, named <command
  10.137  	role="hg-ext-patchbomb">email</command>.</para>
    11.1 --- a/en/examples/auto-snippets.xml	Tue Mar 17 21:47:12 2009 -0700
    11.2 +++ b/en/examples/auto-snippets.xml	Wed Mar 18 00:00:58 2009 -0700
    11.3 @@ -1,4 +1,7 @@
    11.4  <!ENTITY ch06-apache-config.lst SYSTEM "results/ch06-apache-config.lst.out">
    11.5 +<!ENTITY ch10-bugzilla-config.lst SYSTEM "results/ch10-bugzilla-config.lst.out">
    11.6 +<!ENTITY ch10-notify-config-mail.lst SYSTEM "results/ch10-notify-config-mail.lst.out">
    11.7 +<!ENTITY ch10-notify-config.lst SYSTEM "results/ch10-notify-config.lst.out">
    11.8  <!ENTITY interaction.backout.init SYSTEM "results/backout.init.out">
    11.9  <!ENTITY interaction.backout.manual.backout SYSTEM "results/backout.manual.backout.out">
   11.10  <!ENTITY interaction.backout.manual.cat SYSTEM "results/backout.manual.cat.out">
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/en/examples/ch10/bugzilla-config.lst	Wed Mar 18 00:00:58 2009 -0700
    12.3 @@ -0,0 +1,14 @@
    12.4 +[bugzilla]
    12.5 +host = bugzilla.example.com
    12.6 +password = mypassword version = 2.16
    12.7 +# server-side repos live in /home/hg/repos, so strip 4 leading
    12.8 +# separators
    12.9 +strip = 4
   12.10 +hgweb = http://hg.example.com/
   12.11 +usermap = /home/hg/repos/notify/bugzilla.conf
   12.12 +template = Changeset {node|short}, made by {author} in the {webroot}
   12.13 +  repo, refers to this bug.\n
   12.14 +  For complete details, see
   12.15 +  {hgweb}{webroot}?cmd=changeset;node={node|short}\n
   12.16 +  Changeset description:\n
   12.17 +  \t{desc|tabindent}
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/en/examples/ch10/notify-config-mail.lst	Wed Mar 18 00:00:58 2009 -0700
    13.3 @@ -0,0 +1,18 @@
    13.4 +X-Hg-Repo: tests/slave
    13.5 +Subject: tests/slave: Handle error case when slave has no buffers
    13.6 +Date: Wed,  2 Aug 2006 15:25:46 -0700 (PDT)
    13.7 +
    13.8 +changeset 3cba9bfe74b5 in /home/hg/repos/tests/slave
    13.9 +
   13.10 +details:
   13.11 +http://hg.example.com/tests/slave?cmd=changeset;node=3cba9bfe74b5 
   13.12 +
   13.13 +description: Handle error case when slave has no buffers
   13.14 +
   13.15 +diffs (54 lines):
   13.16 +diff -r 9d95df7cf2ad -r 3cba9bfe74b5 include/tests.h
   13.17 +--- a/include/tests.h      Wed Aug 02 15:19:52 2006 -0700
   13.18 ++++ b/include/tests.h      Wed Aug 02 15:25:26 2006 -0700
   13.19 +@@ -212,6 +212,15 @@ static __inline__
   13.20 +void test_headers(void *h)
   13.21 +[...snip...]
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/en/examples/ch10/notify-config.lst	Wed Mar 18 00:00:58 2009 -0700
    14.3 @@ -0,0 +1,19 @@
    14.4 +[notify]
    14.5 +# really send email
    14.6 +test = false
    14.7 +# subscriber data lives in the notify repo
    14.8 +config = /home/hg/repos/notify/notify.conf
    14.9 +# repos live in /home/hg/repos on server, so strip 4 "/" chars
   14.10 +strip = 4
   14.11 +template = X-Hg-Repo: {webroot}\n
   14.12 +  Subject: {webroot}: {desc|firstline|strip}\n
   14.13 +  From: {author}
   14.14 +  \n\n
   14.15 +  changeset {node|short} in {root}
   14.16 +  \n\ndetails:
   14.17 +  {baseurl}{webroot}?cmd=changeset;node={node|short}
   14.18 +  description: {desc|tabindent|strip}
   14.19 +
   14.20 +[web]
   14.21 +baseurl =
   14.22 +http://hg.example.com/
    15.1 --- a/en/examples/run-example	Tue Mar 17 21:47:12 2009 -0700
    15.2 +++ b/en/examples/run-example	Wed Mar 18 00:00:58 2009 -0700
    15.3 @@ -7,6 +7,7 @@
    15.4  import cStringIO
    15.5  import errno
    15.6  import getopt
    15.7 +import glob
    15.8  import os
    15.9  import pty
   15.10  import re
   15.11 @@ -54,15 +55,30 @@
   15.12      return None
   15.13          
   15.14  def result_name(name):
   15.15 -    return os.path.join('results', name.replace(os.sep, '-'))
   15.16 +    return os.path.normpath(os.path.join('results', name.replace(os.sep, '-')))
   15.17 +
   15.18 +def wopen(name):
   15.19 +    path = os.path.dirname(name)
   15.20 +    if path:
   15.21 +        try:
   15.22 +            os.makedirs(path)
   15.23 +        except OSError, err:
   15.24 +            if err.errno != errno.EEXIST:
   15.25 +                raise
   15.26 +    return open(name, 'w')
   15.27  
   15.28  class example:
   15.29      entities = dict.fromkeys(l.rstrip() for l in open('auto-snippets.xml'))
   15.30  
   15.31      def __init__(self, name, verbose, keep_change):
   15.32 -        self.name = name
   15.33 +        self.name = os.path.normpath(name)
   15.34          self.verbose = verbose
   15.35          self.keep_change = keep_change
   15.36 +        
   15.37 +    def status(self, s):
   15.38 +        sys.stdout.write(s)
   15.39 +        if not s.endswith('\n'):
   15.40 +            sys.stdout.flush()
   15.41  
   15.42      def rename_output(self, base, ignore=[]):
   15.43          mangle_re = re.compile('(?:' + '|'.join(ignore) + ')')
   15.44 @@ -97,7 +113,7 @@
   15.45              os.unlink(errname)
   15.46              return False
   15.47          else:
   15.48 -            print >> sys.stderr, '\nOutput of %s has changed!' % baseq
   15.49 +            print >> sys.stderr, '\nOutput of %s has changed!' % base
   15.50              if self.keep_change:
   15.51                  os.rename(errname, oldname)
   15.52                  return False
   15.53 @@ -105,18 +121,9 @@
   15.54                  os.system('diff -u %s %s 1>&2' % (oldname, errname))
   15.55              return True
   15.56  
   15.57 -def wopen(name):
   15.58 -    path = os.path.dirname(name)
   15.59 -    if path:
   15.60 -        try:
   15.61 -            os.makedirs(path)
   15.62 -        except OSError, err:
   15.63 -            if err.errno != errno.EEXIST:
   15.64 -                raise
   15.65 -    return open(name, 'w')
   15.66 -
   15.67  class static_example(example):
   15.68      def run(self):
   15.69 +        self.status('running %s\n' % self.name)
   15.70          s = open(self.name).read().rstrip()
   15.71          s = s.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;')
   15.72          ofp = wopen(result_name(self.name + '.tmp'))
   15.73 @@ -152,11 +159,6 @@
   15.74                  yield cfp.getvalue()
   15.75                  cfp.seek(0)
   15.76                  cfp.truncate()
   15.77 -        
   15.78 -    def status(self, s):
   15.79 -        sys.stdout.write(s)
   15.80 -        if not s.endswith('\n'):
   15.81 -            sys.stdout.flush()
   15.82  
   15.83      def send(self, s):
   15.84          if self.verbose: