hgbook

diff en/ch11-template.xml @ 567:8fcd44708f41

Uncomment all the mangled interaction examples.
author Bryan O'Sullivan <bos@serpentine.com>
date Mon Mar 09 23:22:09 2009 -0700 (2009-03-09)
parents 21c62e09b99f
children 13513d2a128d
line diff
     1.1 --- a/en/ch11-template.xml	Thu Mar 05 21:52:23 2009 +0200
     1.2 +++ b/en/ch11-template.xml	Mon Mar 09 23:22:09 2009 -0700
     1.3 @@ -20,21 +20,21 @@
     1.4      <para>Before we take a look at Mercurial's bundled styles, let's
     1.5        review its normal output.</para>
     1.6  
     1.7 -    <para><!-- &interaction.template.simple.normal; --></para>
     1.8 +    &interaction.template.simple.normal;
     1.9  
    1.10      <para>This is somewhat informative, but it takes up a lot of
    1.11        space&emdash;five lines of output per changeset.  The
    1.12        <literal>compact</literal> style reduces this to three lines,
    1.13        presented in a sparse manner.</para>
    1.14  
    1.15 -    <para><!-- &interaction.template.simple.compact; --></para>
    1.16 +    &interaction.template.simple.compact;
    1.17  
    1.18      <para>The <literal>changelog</literal> style hints at the
    1.19        expressive power of Mercurial's templating engine.  This style
    1.20        attempts to follow the GNU Project's changelog
    1.21        guidelines<citation>web:changelog</citation>.</para>
    1.22  
    1.23 -    <para><!-- &interaction.template.simple.changelog; --></para>
    1.24 +    &interaction.template.simple.changelog;
    1.25  
    1.26      <para>You will not be shocked to learn that Mercurial's default
    1.27        output style is named <literal>default</literal>.</para>
    1.28 @@ -85,12 +85,12 @@
    1.29      <para>Before we continue, let's look again at a simple example of
    1.30        Mercurial's normal output.</para>
    1.31  
    1.32 -    <para><!-- &interaction.template.simple.normal; --></para>
    1.33 +    &interaction.template.simple.normal;
    1.34  
    1.35      <para>Now, let's run the same command, but using a template to
    1.36        change its output.</para>
    1.37  
    1.38 -    <para><!-- &interaction.template.simple.simplest; --></para>
    1.39 +    &interaction.template.simple.simplest;
    1.40  
    1.41      <para>The example above illustrates the simplest possible
    1.42        template; it's just a piece of static text, printed once for
    1.43 @@ -112,7 +112,7 @@
    1.44        isn't very useful; let's try something a bit more
    1.45        complex.</para>
    1.46  
    1.47 -    <para><!-- &interaction.template.simple.simplesub; --></para>
    1.48 +    &interaction.template.simple.simplesub;
    1.49  
    1.50      <para>As you can see, the string
    1.51        <quote><literal>{desc}</literal></quote> in the template has
    1.52 @@ -190,7 +190,7 @@
    1.53      <para>A few simple experiments will show us what to expect when we
    1.54        use these keywords; you can see the results below.</para>
    1.55  
    1.56 -<!-- &interaction.template.simple.keywords; -->
    1.57 +&interaction.template.simple.keywords;
    1.58  
    1.59      <para>As we noted above, the date keyword does not produce
    1.60        human-readable output, so we must treat it specially.  This
    1.61 @@ -198,7 +198,7 @@
    1.62        in section <xref
    1.63  	linkend="sec:template:filter"/>.</para>
    1.64  
    1.65 -    <para><!-- &interaction.template.simple.datekeyword; --></para>
    1.66 +    &interaction.template.simple.datekeyword;
    1.67  
    1.68    </sect1>
    1.69    <sect1 id="sec:template:escape">
    1.70 @@ -410,7 +410,7 @@
    1.71  	  <quote><literal>bos</literal></quote>.</para>
    1.72        </listitem></itemizedlist>
    1.73  
    1.74 -<!-- &interaction.template.simple.manyfilters; -->
    1.75 +&interaction.template.simple.manyfilters;
    1.76  
    1.77      <note>
    1.78        <para>  If you try to apply a filter to a piece of data that it
    1.79 @@ -431,7 +431,7 @@
    1.80  	on Unix-like systems, where a tab is conventionally 8
    1.81  	characters wide).</para>
    1.82  
    1.83 -      <para><!-- &interaction.template.simple.combine; --></para>
    1.84 +      &interaction.template.simple.combine;
    1.85  
    1.86        <para>Note the use of <quote><literal>\t</literal></quote> (a
    1.87  	tab character) in the template to force the first line to be
    1.88 @@ -467,7 +467,7 @@
    1.89  
    1.90        <para>Our simple style file contains just one line:</para>
    1.91  
    1.92 -      <para><!-- &interaction.template.simple.rev; --></para>
    1.93 +      &interaction.template.simple.rev;
    1.94  
    1.95        <para>This tells Mercurial, <quote>if you're printing a
    1.96  	  changeset, use the text on the right as the
    1.97 @@ -532,15 +532,14 @@
    1.98  	working on, it prints a terse error message that, once you
    1.99  	figure out what it means, is actually quite useful.</para>
   1.100  
   1.101 -<!-- &interaction.template.svnstyle.syntax.input; -->
   1.102 +&interaction.template.svnstyle.syntax.input;
   1.103  
   1.104        <para>Notice that <filename>broken.style</filename> attempts to
   1.105  	define a <literal>changeset</literal> keyword, but forgets to
   1.106  	give any content for it. When instructed to use this style
   1.107  	file, Mercurial promptly complains.</para>
   1.108  
   1.109 -      <para><!-- &interaction.template.svnstyle.syntax.error;
   1.110 -	--></para>
   1.111 +      &interaction.template.svnstyle.syntax.error;
   1.112  
   1.113        <para>This error message looks intimidating, but it is not too
   1.114  	hard to follow.</para>
   1.115 @@ -580,9 +579,12 @@
   1.116        <para>If you would like to be able to identify a Mercurial
   1.117  	repository <quote>fairly uniquely</quote> using a short string
   1.118  	as an identifier, you can use the first revision in the
   1.119 -	repository. <!-- &interaction.template.svnstyle.id; --> This
   1.120 -	is not guaranteed to be unique, but it is nevertheless useful
   1.121 -	in many cases.</para>
   1.122 +	repository.</para>
   1.123 +
   1.124 +      &interaction.template.svnstyle.id;
   1.125 +
   1.126 +      <para>This is not guaranteed to be unique, but it is
   1.127 +	nevertheless useful in many cases.</para>
   1.128        <itemizedlist>
   1.129  	<listitem><para>It will not work in a completely empty
   1.130  	    repository, because such a repository does not have a
   1.131 @@ -611,14 +613,16 @@
   1.132        <title>Mimicking Subversion's output</title>
   1.133  
   1.134        <para>Let's try to emulate the default output format used by
   1.135 -	another revision control tool, Subversion. <!--
   1.136 -	&interaction.template.svnstyle.short; --></para>
   1.137 +	another revision control tool, Subversion.</para>
   1.138 +
   1.139 +      &interaction.template.svnstyle.short;
   1.140  
   1.141        <para>Since Subversion's output style is fairly simple, it is
   1.142  	easy to copy-and-paste a hunk of its output into a file, and
   1.143  	replace the text produced above by Subversion with the
   1.144 -	template values we'd like to see expanded. <!--
   1.145 -	&interaction.template.svnstyle.template; --></para>
   1.146 +	template values we'd like to see expanded.</para>
   1.147 +
   1.148 +      &interaction.template.svnstyle.template;
   1.149  
   1.150        <para>There are a few small ways in which this template deviates
   1.151  	from the output produced by Subversion.</para>
   1.152 @@ -648,8 +652,9 @@
   1.153        <para>It took me no more than a minute or two of work to replace
   1.154  	literal text from an example of Subversion's output with some
   1.155  	keywords and filters to give the template above.  The style
   1.156 -	file simply refers to the template. <!--
   1.157 -	&interaction.template.svnstyle.style; --></para>
   1.158 +	file simply refers to the template.</para>
   1.159 +
   1.160 +      &interaction.template.svnstyle.style;
   1.161  
   1.162        <para>We could have included the text of the template file
   1.163  	directly in the style file by enclosing it in quotes and