changeset 665:27043f385f3f

Get autogeneration of examples more or less working.
author Bryan O'Sullivan <bos@serpentine.com>
date Mon, 09 Mar 2009 22:55:38 -0700
parents 8a9c66da6fcb
children 8fcd44708f41
files en/00book.xml en/Makefile en/ch02-tour-basic.xml en/examples/auto-snippets.xml en/examples/run-example
diffstat 5 files changed, 268 insertions(+), 35 deletions(-) [+]
line wrap: on
line diff
--- a/en/00book.xml	Mon Mar 09 21:40:12 2009 -0700
+++ b/en/00book.xml	Mon Mar 09 22:55:38 2009 -0700
@@ -30,6 +30,11 @@
 
 <!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">
--- a/en/Makefile	Mon Mar 09 21:40:12 2009 -0700
+++ b/en/Makefile	Mon Mar 09 22:55:38 2009 -0700
@@ -1,12 +1,5 @@
 # This makefile requires GNU make.
 
-sources := \
-	00book.tex \
-	99book.bib \
-	99defs.tex \
-	app*.tex \
-	ch*.tex
-
 image-sources := \
 	feature-branches.dot \
 	filelog.svg \
--- a/en/ch02-tour-basic.xml	Mon Mar 09 21:40:12 2009 -0700
+++ b/en/ch02-tour-basic.xml	Mon Mar 09 22:55:38 2009 -0700
@@ -104,7 +104,7 @@
       that it prints isn't so important; it's whether it prints
       anything at all that we care about.</para>
 
-      <!-- &interaction.tour.version; -->
+    &interaction.tour.version;
 
     <sect2>
       <title>Built-in help</title>
@@ -118,7 +118,7 @@
 	  help on a specific command (as below), it prints more
 	  detailed information.</para>
 
-	<!-- &interaction.tour.help; -->
+	&interaction.tour.help;
 
 	<para>For a more impressive level of detail (which you won't
 	  usually need) run <command role="hg-cmd">hg help <option
@@ -155,13 +155,13 @@
 	called <command role="hg-cmd">hg clone</command>, because it
 	creates an identical copy of an existing repository.</para>
 
-      <!-- &interaction.tour.clone; -->
+      &interaction.tour.clone;
 
       <para>If our clone succeeded, we should now have a local
 	directory called <filename class="directory">hello</filename>.
 	This directory will contain some files.</para>
 
-      <!-- &interaction.tour.ls; -->
+      &interaction.tour.ls;
 
       <para>These files have the same contents and history in our
 	repository as they do in the repository we cloned.</para>
@@ -186,7 +186,7 @@
 	  class="directory">.hg</filename>.  This is where Mercurial
 	keeps all of its metadata for the repository.</para>
 
-      <!-- &interaction.tour.ls-a; -->
+      &interaction.tour.ls-a;
 
       <para>The contents of the <filename
 	  class="directory">.hg</filename> directory and its
@@ -216,7 +216,7 @@
 	role="hg-cmd">hg log</command> command gives us a view of
       history.</para>
 
-    <!-- &interaction.tour.log; -->
+    &interaction.tour.log;
 
     <para>By default, this command prints a brief paragraph of output
       for each change to the project that was recorded.  In Mercurial
@@ -324,7 +324,7 @@
 	either a revision number or a long-form changeset identifier,
 	and you can provide as many revisions as you want.</para>
 
-      <!-- &interaction.tour.log-r; -->
+      &interaction.tour.log-r;
 
       <para>If you want to see the history of several revisions
 	without having to list each one, you can use <emphasis>range
@@ -332,7 +332,7 @@
 	  want all revisions between <literal>abc</literal> and
 	  <literal>def</literal>, inclusive</quote>.</para>
       
-	<!-- &interaction.tour.log.range; -->
+	&interaction.tour.log.range;
 
       <para>Mercurial also honours the order in which you specify
 	revisions, so <command role="hg-cmd">hg log -r 2:4</command>
@@ -353,7 +353,7 @@
 	  role="hg-opt-global">--verbose</option>) option gives you
 	this extra detail.</para>
 
-      <!-- &interaction.tour.log-v; -->
+      &interaction.tour.log-v;
 
       <para>If you want to see both the description and content of a
 	change, add the <option role="hg-opt-log">-p</option> (or
@@ -363,7 +363,7 @@
 	see section <xref linkend="sec:mq:patch"/> for an
 	overview).</para>
 
-      <!-- &interaction.tour.log-vp; -->
+      &interaction.tour.log-vp;
 
     </sect2>
   </sect1>
@@ -424,7 +424,7 @@
       than cloning over the network, and cloning a local repository
       uses less disk space in most cases, too.</para>
 
-    <!-- &interaction.tour.reclone; -->
+    &interaction.tour.reclone;
 
     <para>As an aside, it's often good practice to keep a
       <quote>pristine</quote> copy of a remote repository around,
@@ -446,13 +446,13 @@
       <command>sed</command>; simply use your preferred text editor to
       do the same thing.)</para>
 
-    <!-- &interaction.tour.sed; -->
+    &interaction.tour.sed;
 
     <para>Mercurial's <command role="hg-cmd">hg status</command>
       command will tell us what Mercurial knows about the files in the
       repository.</para>
 
-    <!-- &interaction.tour.status; -->
+    &interaction.tour.status;
 
     <para>The <command role="hg-cmd">hg status</command> command
       prints no output for some files, but a line starting with
@@ -475,7 +475,7 @@
       do this, we use the <command role="hg-cmd">hg diff</command>
       command.</para>
 
-    <!-- &interaction.tour.diff; -->
+    &interaction.tour.diff;
 
   </sect1>
   <sect1>
@@ -598,7 +598,7 @@
 	  printed by <command role="hg-cmd">hg log</command> after
 	  we've finished committing.</para>
 
-       <!-- &interaction.tour.commit; -->
+       &interaction.tour.commit;
 
       <para>The editor that the <command role="hg-cmd">hg
 	    commit</command> command drops us into will contain an
@@ -665,7 +665,7 @@
 	    log</command>, but it only displays the newest revision in
 	  the repository.</para>
 
-      <!-- &interaction.tour.tip; -->
+      &interaction.tour.tip;
 
       <para>We refer to
 	  the newest revision in the repository as the tip revision,
@@ -691,7 +691,7 @@
 	  call our temporary repository <filename
 	    class="directory">hello-pull</filename>.</para>
 
-      <!-- &interaction.tour.clone-pull; -->
+      &interaction.tour.clone-pull;
 
       <para>We'll use the <command role="hg-cmd">hg
 	    pull</command> command to bring changes from <filename
@@ -704,7 +704,7 @@
 	  command <emphasis>would</emphasis> pull into the repository,
 	  without actually pulling the changes in.</para>
 
-      <!-- &interaction.tour.incoming; -->
+      &interaction.tour.incoming;
 
       <para>(Of course, someone could
 	  cause more changesets to appear in the repository that we
@@ -718,7 +718,7 @@
 	    pull</command> command, and telling it which repository to
 	  pull from.</para>
 
-      <!-- &interaction.tour.pull; -->
+      &interaction.tour.pull;
 
       <para>As you can see
 	  from the before-and-after output of <command
@@ -740,7 +740,7 @@
 	the working directory.  Instead, we use the <command
 	  role="hg-cmd">hg update</command> command to do this.</para>
 
-      <!-- &interaction.tour.update; -->
+      &interaction.tour.update;
 
       <para>It might seem a bit strange that <command role="hg-cmd">hg
 	  pull</command> doesn't update the working directory
@@ -771,7 +771,7 @@
 	the <command role="hg-cmd">hg parents</command>
 	command.</para>
 
-      <!-- &interaction.tour.parents; -->
+      &interaction.tour.parents;
 
       <para>If you look back at figure <xref
 	  linkend="fig:tour-basic:history"/>,
@@ -787,7 +787,7 @@
 	give a revision number or changeset ID to the <command
 	  role="hg-cmd">hg update</command> command.</para>
 
-      <!-- &interaction.tour.older; -->
+      &interaction.tour.older;
 
       <para>If you omit an explicit revision, <command
 	  role="hg-cmd">hg update</command> will update to the tip
@@ -805,19 +805,19 @@
 	    pull</command> above, we'll create a temporary repository
 	  to push our changes into.</para>
 
-      <!-- &interaction.tour.clone-push; -->
+      &interaction.tour.clone-push;
 
       <para>The <command role="hg-cmd">hg outgoing</command> command
 	  tells us what changes would be pushed into another
 	  repository.</para>
 
-      <!-- &interaction.tour.outgoing; -->
+      &interaction.tour.outgoing;
 
       <para>And the
 	  <command role="hg-cmd">hg push</command> command does the
 	  actual push.</para>
 
-      <!-- &interaction.tour.push; -->
+      &interaction.tour.push;
 
       <para>As with
 	  <command role="hg-cmd">hg pull</command>, the <command
@@ -832,7 +832,7 @@
 	  and the receiving repository already has those changes?
 	  Nothing too exciting.</para>
 
-      <!-- &interaction.tour.push.nothing; -->
+      &interaction.tour.push.nothing;
     </sect2>
     <sect2>
       <title>Sharing changes over a network</title>
@@ -843,14 +843,14 @@
 	  connection; simply pass in a URL instead of a local
 	  path.</para>
 	
-      <!-- &interaction.tour.outgoing.net; -->
+      &interaction.tour.outgoing.net;
 
       <para>In this example, we
 	  can see what changes we could push to the remote repository,
 	  but the repository is understandably not set up to let
 	  anonymous users push to it.</para>
 
-      <!-- &interaction.tour.push.net; -->
+      &interaction.tour.push.net;
     </sect2>
   </sect1>
 </chapter>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/en/examples/auto-snippets.xml	Mon Mar 09 22:55:38 2009 -0700
@@ -0,0 +1,218 @@
+<!ENTITY interaction.backout.init SYSTEM "results/backout.init.out">
+<!ENTITY interaction.backout.manual.backout SYSTEM "results/backout.manual.backout.out">
+<!ENTITY interaction.backout.manual.cat SYSTEM "results/backout.manual.cat.out">
+<!ENTITY interaction.backout.manual.clone SYSTEM "results/backout.manual.clone.out">
+<!ENTITY interaction.backout.manual.heads SYSTEM "results/backout.manual.heads.out">
+<!ENTITY interaction.backout.manual.log SYSTEM "results/backout.manual.log.out">
+<!ENTITY interaction.backout.manual.merge SYSTEM "results/backout.manual.merge.out">
+<!ENTITY interaction.backout.manual.parents SYSTEM "results/backout.manual.parents.out">
+<!ENTITY interaction.backout.non-tip.backout SYSTEM "results/backout.non-tip.backout.out">
+<!ENTITY interaction.backout.non-tip.cat SYSTEM "results/backout.non-tip.cat.out">
+<!ENTITY interaction.backout.non-tip.clone SYSTEM "results/backout.non-tip.clone.out">
+<!ENTITY interaction.backout.simple SYSTEM "results/backout.simple.out">
+<!ENTITY interaction.backout.simple.log SYSTEM "results/backout.simple.log.out">
+<!ENTITY interaction.bisect.commits SYSTEM "results/bisect.commits.out">
+<!ENTITY interaction.bisect.help SYSTEM "results/bisect.help.out">
+<!ENTITY interaction.bisect.init SYSTEM "results/bisect.init.out">
+<!ENTITY interaction.bisect.search.bad-init SYSTEM "results/bisect.search.bad-init.out">
+<!ENTITY interaction.bisect.search.good-init SYSTEM "results/bisect.search.good-init.out">
+<!ENTITY interaction.bisect.search.init SYSTEM "results/bisect.search.init.out">
+<!ENTITY interaction.bisect.search.mytest SYSTEM "results/bisect.search.mytest.out">
+<!ENTITY interaction.bisect.search.reset SYSTEM "results/bisect.search.reset.out">
+<!ENTITY interaction.bisect.search.rest SYSTEM "results/bisect.search.rest.out">
+<!ENTITY interaction.bisect.search.step1 SYSTEM "results/bisect.search.step1.out">
+<!ENTITY interaction.bisect.search.step2 SYSTEM "results/bisect.search.step2.out">
+<!ENTITY interaction.branch-named.branch SYSTEM "results/branch-named.branch.out">
+<!ENTITY interaction.branch-named.branches SYSTEM "results/branch-named.branches.out">
+<!ENTITY interaction.branch-named.commit SYSTEM "results/branch-named.commit.out">
+<!ENTITY interaction.branch-named.create SYSTEM "results/branch-named.create.out">
+<!ENTITY interaction.branch-named.foo-commit SYSTEM "results/branch-named.foo-commit.out">
+<!ENTITY interaction.branch-named.merge SYSTEM "results/branch-named.merge.out">
+<!ENTITY interaction.branch-named.parents SYSTEM "results/branch-named.parents.out">
+<!ENTITY interaction.branch-named.rebranch SYSTEM "results/branch-named.rebranch.out">
+<!ENTITY interaction.branch-named.status SYSTEM "results/branch-named.status.out">
+<!ENTITY interaction.branch-named.update-bar SYSTEM "results/branch-named.update-bar.out">
+<!ENTITY interaction.branch-named.update-nothing SYSTEM "results/branch-named.update-nothing.out">
+<!ENTITY interaction.branch-named.update-switchy SYSTEM "results/branch-named.update-switchy.out">
+<!ENTITY interaction.branch-repo.bugfix SYSTEM "results/branch-repo.bugfix.out">
+<!ENTITY interaction.branch-repo.clone SYSTEM "results/branch-repo.clone.out">
+<!ENTITY interaction.branch-repo.merge SYSTEM "results/branch-repo.merge.out">
+<!ENTITY interaction.branch-repo.new SYSTEM "results/branch-repo.new.out">
+<!ENTITY interaction.branch-repo.pull SYSTEM "results/branch-repo.pull.out">
+<!ENTITY interaction.branch-repo.tag SYSTEM "results/branch-repo.tag.out">
+<!ENTITY interaction.branching.clone SYSTEM "results/branching.clone.out">
+<!ENTITY interaction.branching.init SYSTEM "results/branching.init.out">
+<!ENTITY interaction.branching.main SYSTEM "results/branching.main.out">
+<!ENTITY interaction.branching.merge SYSTEM "results/branching.merge.out">
+<!ENTITY interaction.branching.stable SYSTEM "results/branching.stable.out">
+<!ENTITY interaction.branching.tag SYSTEM "results/branching.tag.out">
+<!ENTITY interaction.branching.update SYSTEM "results/branching.update.out">
+<!ENTITY interaction.cmdref.diff-p SYSTEM "results/cmdref.diff-p.out">
+<!ENTITY interaction.daily.copy.after SYSTEM "results/daily.copy.after.out">
+<!ENTITY interaction.daily.copy.cat SYSTEM "results/daily.copy.cat.out">
+<!ENTITY interaction.daily.copy.clone SYSTEM "results/daily.copy.clone.out">
+<!ENTITY interaction.daily.copy.copy SYSTEM "results/daily.copy.copy.out">
+<!ENTITY interaction.daily.copy.dir-dest SYSTEM "results/daily.copy.dir-dest.out">
+<!ENTITY interaction.daily.copy.dir-src SYSTEM "results/daily.copy.dir-src.out">
+<!ENTITY interaction.daily.copy.dir-src-dest SYSTEM "results/daily.copy.dir-src-dest.out">
+<!ENTITY interaction.daily.copy.init SYSTEM "results/daily.copy.init.out">
+<!ENTITY interaction.daily.copy.merge SYSTEM "results/daily.copy.merge.out">
+<!ENTITY interaction.daily.copy.other SYSTEM "results/daily.copy.other.out">
+<!ENTITY interaction.daily.copy.simple SYSTEM "results/daily.copy.simple.out">
+<!ENTITY interaction.daily.copy.status SYSTEM "results/daily.copy.status.out">
+<!ENTITY interaction.daily.copy.status-copy SYSTEM "results/daily.copy.status-copy.out">
+<!ENTITY interaction.daily.files.add SYSTEM "results/daily.files.add.out">
+<!ENTITY interaction.daily.files.add-dir SYSTEM "results/daily.files.add-dir.out">
+<!ENTITY interaction.daily.files.addremove SYSTEM "results/daily.files.addremove.out">
+<!ENTITY interaction.daily.files.commit-addremove SYSTEM "results/daily.files.commit-addremove.out">
+<!ENTITY interaction.daily.files.hidden SYSTEM "results/daily.files.hidden.out">
+<!ENTITY interaction.daily.files.missing SYSTEM "results/daily.files.missing.out">
+<!ENTITY interaction.daily.files.recover-missing SYSTEM "results/daily.files.recover-missing.out">
+<!ENTITY interaction.daily.files.remove SYSTEM "results/daily.files.remove.out">
+<!ENTITY interaction.daily.files.remove-after SYSTEM "results/daily.files.remove-after.out">
+<!ENTITY interaction.daily.rename.rename SYSTEM "results/daily.rename.rename.out">
+<!ENTITY interaction.daily.rename.status SYSTEM "results/daily.rename.status.out">
+<!ENTITY interaction.daily.rename.status-copy SYSTEM "results/daily.rename.status-copy.out">
+<!ENTITY interaction.daily.revert.add SYSTEM "results/daily.revert.add.out">
+<!ENTITY interaction.daily.revert.copy SYSTEM "results/daily.revert.copy.out">
+<!ENTITY interaction.daily.revert.missing SYSTEM "results/daily.revert.missing.out">
+<!ENTITY interaction.daily.revert.modify SYSTEM "results/daily.revert.modify.out">
+<!ENTITY interaction.daily.revert.remove SYSTEM "results/daily.revert.remove.out">
+<!ENTITY interaction.daily.revert.rename SYSTEM "results/daily.revert.rename.out">
+<!ENTITY interaction.daily.revert.rename-orig SYSTEM "results/daily.revert.rename-orig.out">
+<!ENTITY interaction.daily.revert.status SYSTEM "results/daily.revert.status.out">
+<!ENTITY interaction.daily.revert.unmodify SYSTEM "results/daily.revert.unmodify.out">
+<!ENTITY interaction.extdiff.diff SYSTEM "results/extdiff.diff.out">
+<!ENTITY interaction.extdiff.extdiff SYSTEM "results/extdiff.extdiff.out">
+<!ENTITY interaction.extdiff.extdiff-ctx SYSTEM "results/extdiff.extdiff-ctx.out">
+<!ENTITY interaction.filenames.dirs SYSTEM "results/filenames.dirs.out">
+<!ENTITY interaction.filenames.files SYSTEM "results/filenames.files.out">
+<!ENTITY interaction.filenames.filter.exclude SYSTEM "results/filenames.filter.exclude.out">
+<!ENTITY interaction.filenames.filter.include SYSTEM "results/filenames.filter.include.out">
+<!ENTITY interaction.filenames.glob.group SYSTEM "results/filenames.glob.group.out">
+<!ENTITY interaction.filenames.glob.question SYSTEM "results/filenames.glob.question.out">
+<!ENTITY interaction.filenames.glob.range SYSTEM "results/filenames.glob.range.out">
+<!ENTITY interaction.filenames.glob.star SYSTEM "results/filenames.glob.star.out">
+<!ENTITY interaction.filenames.glob.star-starstar SYSTEM "results/filenames.glob.star-starstar.out">
+<!ENTITY interaction.filenames.glob.starstar SYSTEM "results/filenames.glob.starstar.out">
+<!ENTITY interaction.filenames.wdir-relname SYSTEM "results/filenames.wdir-relname.out">
+<!ENTITY interaction.filenames.wdir-subdir SYSTEM "results/filenames.wdir-subdir.out">
+<!ENTITY interaction.hook.msglen.go SYSTEM "results/hook.msglen.go.out">
+<!ENTITY interaction.hook.simple.ext SYSTEM "results/hook.simple.ext.out">
+<!ENTITY interaction.hook.simple.init SYSTEM "results/hook.simple.init.out">
+<!ENTITY interaction.hook.simple.pretxncommit SYSTEM "results/hook.simple.pretxncommit.out">
+<!ENTITY interaction.hook.ws.better SYSTEM "results/hook.ws.better.out">
+<!ENTITY interaction.hook.ws.simple SYSTEM "results/hook.ws.simple.out">
+<!ENTITY interaction.issue29.go SYSTEM "results/issue29.go.out">
+<!ENTITY interaction.mq.dodiff.diff SYSTEM "results/mq.dodiff.diff.out">
+<!ENTITY interaction.mq.guards.init SYSTEM "results/mq.guards.init.out">
+<!ENTITY interaction.mq.guards.qguard SYSTEM "results/mq.guards.qguard.out">
+<!ENTITY interaction.mq.guards.qguard.neg SYSTEM "results/mq.guards.qguard.neg.out">
+<!ENTITY interaction.mq.guards.qguard.pos SYSTEM "results/mq.guards.qguard.pos.out">
+<!ENTITY interaction.mq.guards.qselect.cat SYSTEM "results/mq.guards.qselect.cat.out">
+<!ENTITY interaction.mq.guards.qselect.error SYSTEM "results/mq.guards.qselect.error.out">
+<!ENTITY interaction.mq.guards.qselect.foo SYSTEM "results/mq.guards.qselect.foo.out">
+<!ENTITY interaction.mq.guards.qselect.foobar SYSTEM "results/mq.guards.qselect.foobar.out">
+<!ENTITY interaction.mq.guards.qselect.qpush SYSTEM "results/mq.guards.qselect.qpush.out">
+<!ENTITY interaction.mq.guards.qselect.quux SYSTEM "results/mq.guards.qselect.quux.out">
+<!ENTITY interaction.mq.guards.series SYSTEM "results/mq.guards.series.out">
+<!ENTITY interaction.mq.id.output SYSTEM "results/mq.id.output.out">
+<!ENTITY interaction.mq.qinit-help.help SYSTEM "results/mq.qinit-help.help.out">
+<!ENTITY interaction.mq.tarball.download SYSTEM "results/mq.tarball.download.out">
+<!ENTITY interaction.mq.tarball.newsource SYSTEM "results/mq.tarball.newsource.out">
+<!ENTITY interaction.mq.tarball.qinit SYSTEM "results/mq.tarball.qinit.out">
+<!ENTITY interaction.mq.tarball.repush SYSTEM "results/mq.tarball.repush.out">
+<!ENTITY interaction.mq.tools.lsdiff SYSTEM "results/mq.tools.lsdiff.out">
+<!ENTITY interaction.mq.tools.tools SYSTEM "results/mq.tools.tools.out">
+<!ENTITY interaction.mq.tutorial.add SYSTEM "results/mq.tutorial.add.out">
+<!ENTITY interaction.mq.tutorial.qinit SYSTEM "results/mq.tutorial.qinit.out">
+<!ENTITY interaction.mq.tutorial.qnew SYSTEM "results/mq.tutorial.qnew.out">
+<!ENTITY interaction.mq.tutorial.qnew2 SYSTEM "results/mq.tutorial.qnew2.out">
+<!ENTITY interaction.mq.tutorial.qpop SYSTEM "results/mq.tutorial.qpop.out">
+<!ENTITY interaction.mq.tutorial.qpush-a SYSTEM "results/mq.tutorial.qpush-a.out">
+<!ENTITY interaction.mq.tutorial.qrefresh SYSTEM "results/mq.tutorial.qrefresh.out">
+<!ENTITY interaction.mq.tutorial.qrefresh2 SYSTEM "results/mq.tutorial.qrefresh2.out">
+<!ENTITY interaction.mq.tutorial.qseries SYSTEM "results/mq.tutorial.qseries.out">
+<!ENTITY interaction.rename.divergent.clone SYSTEM "results/rename.divergent.clone.out">
+<!ENTITY interaction.rename.divergent.merge SYSTEM "results/rename.divergent.merge.out">
+<!ENTITY interaction.rename.divergent.rename.anne SYSTEM "results/rename.divergent.rename.anne.out">
+<!ENTITY interaction.rename.divergent.rename.bob SYSTEM "results/rename.divergent.rename.bob.out">
+<!ENTITY interaction.rollback.add SYSTEM "results/rollback.add.out">
+<!ENTITY interaction.rollback.commit SYSTEM "results/rollback.commit.out">
+<!ENTITY interaction.rollback.rollback SYSTEM "results/rollback.rollback.out">
+<!ENTITY interaction.rollback.status SYSTEM "results/rollback.status.out">
+<!ENTITY interaction.rollback.tip SYSTEM "results/rollback.tip.out">
+<!ENTITY interaction.rollback.twice SYSTEM "results/rollback.twice.out">
+<!ENTITY interaction.tag.init SYSTEM "results/tag.init.out">
+<!ENTITY interaction.tag.log SYSTEM "results/tag.log.out">
+<!ENTITY interaction.tag.log.v1.0 SYSTEM "results/tag.log.v1.0.out">
+<!ENTITY interaction.tag.remove SYSTEM "results/tag.remove.out">
+<!ENTITY interaction.tag.replace SYSTEM "results/tag.replace.out">
+<!ENTITY interaction.tag.tag SYSTEM "results/tag.tag.out">
+<!ENTITY interaction.tag.tags SYSTEM "results/tag.tags.out">
+<!ENTITY interaction.tag.tip SYSTEM "results/tag.tip.out">
+<!ENTITY interaction.template.simple.changelog SYSTEM "results/template.simple.changelog.out">
+<!ENTITY interaction.template.simple.combine SYSTEM "results/template.simple.combine.out">
+<!ENTITY interaction.template.simple.compact SYSTEM "results/template.simple.compact.out">
+<!ENTITY interaction.template.simple.datekeyword SYSTEM "results/template.simple.datekeyword.out">
+<!ENTITY interaction.template.simple.keywords SYSTEM "results/template.simple.keywords.out">
+<!ENTITY interaction.template.simple.manyfilters SYSTEM "results/template.simple.manyfilters.out">
+<!ENTITY interaction.template.simple.normal SYSTEM "results/template.simple.normal.out">
+<!ENTITY interaction.template.simple.rev SYSTEM "results/template.simple.rev.out">
+<!ENTITY interaction.template.simple.simplest SYSTEM "results/template.simple.simplest.out">
+<!ENTITY interaction.template.simple.simplesub SYSTEM "results/template.simple.simplesub.out">
+<!ENTITY interaction.template.svnstyle.id SYSTEM "results/template.svnstyle.id.out">
+<!ENTITY interaction.template.svnstyle.result SYSTEM "results/template.svnstyle.result.out">
+<!ENTITY interaction.template.svnstyle.short SYSTEM "results/template.svnstyle.short.out">
+<!ENTITY interaction.template.svnstyle.simplest SYSTEM "results/template.svnstyle.simplest.out">
+<!ENTITY interaction.template.svnstyle.style SYSTEM "results/template.svnstyle.style.out">
+<!ENTITY interaction.template.svnstyle.syntax.error SYSTEM "results/template.svnstyle.syntax.error.out">
+<!ENTITY interaction.template.svnstyle.syntax.input SYSTEM "results/template.svnstyle.syntax.input.out">
+<!ENTITY interaction.template.svnstyle.template SYSTEM "results/template.svnstyle.template.out">
+<!ENTITY interaction.tour-merge-conflict.commit SYSTEM "results/tour-merge-conflict.commit.out">
+<!ENTITY interaction.tour-merge-conflict.cousin SYSTEM "results/tour-merge-conflict.cousin.out">
+<!ENTITY interaction.tour-merge-conflict.merge SYSTEM "results/tour-merge-conflict.merge.out">
+<!ENTITY interaction.tour-merge-conflict.pull SYSTEM "results/tour-merge-conflict.pull.out">
+<!ENTITY interaction.tour-merge-conflict.son SYSTEM "results/tour-merge-conflict.son.out">
+<!ENTITY interaction.tour-merge-conflict.wife SYSTEM "results/tour-merge-conflict.wife.out">
+<!ENTITY interaction.tour.clone SYSTEM "results/tour.clone.out">
+<!ENTITY interaction.tour.clone-pull SYSTEM "results/tour.clone-pull.out">
+<!ENTITY interaction.tour.clone-push SYSTEM "results/tour.clone-push.out">
+<!ENTITY interaction.tour.commit SYSTEM "results/tour.commit.out">
+<!ENTITY interaction.tour.diff SYSTEM "results/tour.diff.out">
+<!ENTITY interaction.tour.help SYSTEM "results/tour.help.out">
+<!ENTITY interaction.tour.incoming SYSTEM "results/tour.incoming.out">
+<!ENTITY interaction.tour.log SYSTEM "results/tour.log.out">
+<!ENTITY interaction.tour.log-r SYSTEM "results/tour.log-r.out">
+<!ENTITY interaction.tour.log-v SYSTEM "results/tour.log-v.out">
+<!ENTITY interaction.tour.log-vp SYSTEM "results/tour.log-vp.out">
+<!ENTITY interaction.tour.log.range SYSTEM "results/tour.log.range.out">
+<!ENTITY interaction.tour.ls SYSTEM "results/tour.ls.out">
+<!ENTITY interaction.tour.ls-a SYSTEM "results/tour.ls-a.out">
+<!ENTITY interaction.tour.merge.cat SYSTEM "results/tour.merge.cat.out">
+<!ENTITY interaction.tour.merge.clone SYSTEM "results/tour.merge.clone.out">
+<!ENTITY interaction.tour.merge.commit SYSTEM "results/tour.merge.commit.out">
+<!ENTITY interaction.tour.merge.dummy1 SYSTEM "results/tour.merge.dummy1.out">
+<!ENTITY interaction.tour.merge.dummy2 SYSTEM "results/tour.merge.dummy2.out">
+<!ENTITY interaction.tour.merge.dummy3 SYSTEM "results/tour.merge.dummy3.out">
+<!ENTITY interaction.tour.merge.dummy4 SYSTEM "results/tour.merge.dummy4.out">
+<!ENTITY interaction.tour.merge.heads SYSTEM "results/tour.merge.heads.out">
+<!ENTITY interaction.tour.merge.merge SYSTEM "results/tour.merge.merge.out">
+<!ENTITY interaction.tour.merge.parents SYSTEM "results/tour.merge.parents.out">
+<!ENTITY interaction.tour.merge.pull SYSTEM "results/tour.merge.pull.out">
+<!ENTITY interaction.tour.merge.tip SYSTEM "results/tour.merge.tip.out">
+<!ENTITY interaction.tour.merge.update SYSTEM "results/tour.merge.update.out">
+<!ENTITY interaction.tour.older SYSTEM "results/tour.older.out">
+<!ENTITY interaction.tour.outgoing SYSTEM "results/tour.outgoing.out">
+<!ENTITY interaction.tour.outgoing.net SYSTEM "results/tour.outgoing.net.out">
+<!ENTITY interaction.tour.parents SYSTEM "results/tour.parents.out">
+<!ENTITY interaction.tour.pull SYSTEM "results/tour.pull.out">
+<!ENTITY interaction.tour.push SYSTEM "results/tour.push.out">
+<!ENTITY interaction.tour.push.net SYSTEM "results/tour.push.net.out">
+<!ENTITY interaction.tour.push.nothing SYSTEM "results/tour.push.nothing.out">
+<!ENTITY interaction.tour.reclone SYSTEM "results/tour.reclone.out">
+<!ENTITY interaction.tour.sed SYSTEM "results/tour.sed.out">
+<!ENTITY interaction.tour.status SYSTEM "results/tour.status.out">
+<!ENTITY interaction.tour.tip SYSTEM "results/tour.tip.out">
+<!ENTITY interaction.tour.update SYSTEM "results/tour.update.out">
+<!ENTITY interaction.tour.version SYSTEM "results/tour.version.out">
--- a/en/examples/run-example	Mon Mar 09 21:40:12 2009 -0700
+++ b/en/examples/run-example	Mon Mar 09 22:55:38 2009 -0700
@@ -65,6 +65,8 @@
     
     timeout = 10
 
+    entities = dict.fromkeys(l.rstrip() for l in open('auto-snippets.xml'))
+
     def __init__(self, name, verbose, keep_change):
         self.name = name
         self.verbose = verbose
@@ -240,6 +242,11 @@
                                 err |= self.rename_output(ofp_basename, ignore)
                             if out:
                                 ofp_basename = '%s.%s' % (self.name, out)
+                                norm = os.path.normpath(ofp_basename)
+                                example.entities[
+                                    '<!ENTITY "interaction.%s" '
+                                    'SYSTEM "results/%s.out">'
+                                    % (norm, norm)] = 1
                                 read_hint = ofp_basename + ' '
                                 ofp = open(result_name(ofp_basename + '.tmp'),
                                            'w')
@@ -348,11 +355,16 @@
     sys.exit(exit)
 
 def main(path='.'):
+    if os.path.realpath(path).split(os.sep)[-1] != 'examples':
+        print >> sys.stderr, 'Not being run from the examples directory!'
+        sys.exit(1)
+
     opts, args = getopt.getopt(sys.argv[1:], '?ahv',
                                ['all', 'help', 'keep', 'verbose'])
     verbose = False
     run_all = False
     keep_change = False
+
     for o, a in opts:
         if o in ('-h', '-?', '--help'):
             print_help(0)
@@ -397,6 +409,11 @@
         print >> open(os.path.join(path, '.run'), 'w'), time.asctime()
     else:
         print_help(1, msg='no test names given, and --all not provided')
+
+    fp = open('auto-snippets.xml', 'w')
+    for key in sorted(example.entities.iterkeys()):
+        print >> fp, key
+    fp.close()
     return errs
 
 if __name__ == '__main__':