Commits

Dan Villiom Podlaski Christiansen  committed 6c5c1d6

Better.

  • Participants
  • Parent commits 511acec

Comments (0)

Files changed (5)

File highlight-docutils.diff

 # HG changeset patch
+# Parent a4110af4e22cbb30736ec0a0ac16ab6437d50d13
 # User Dan Villiom Podlaski Christiansen  <danchr@gmail.com>
 highlight: use docutils for generating help if possible
 
 -from mercurial import extensions, encoding
 +from mercurial import extensions, encoding, minirst
 +
-+import traceback
++import cgi, traceback
 +
  testedwith = 'internal'
  
  def filerevision_highlight(orig, web, tmpl, fctx):
-@@ -48,6 +52,21 @@ def annotate_highlight(orig, web, req, t
+@@ -48,6 +52,23 @@ def annotate_highlight(orig, web, req, t
          highlight.pygmentize('annotateline', fctx, style, tmpl)
      return orig(web, req, tmpl)
  
 +                              '-->',
 +                              '',
 +                              orig(*args, **opts)])
++    else:
++        return orig(*args, **opts)
 +
  def generate_css(web, req, tmpl):
      pg_style = web.config('web', 'pygments_style', 'colorful')
      fmter = highlight.HtmlFormatter(style = pg_style)
-@@ -60,5 +79,6 @@ def extsetup():
+@@ -60,5 +81,6 @@ def extsetup():
      extensions.wrapfunction(webcommands, '_filerevision',
                              filerevision_highlight)
      extensions.wrapfunction(webcommands, 'annotate', annotate_highlight)
 +                               enable_exit_status=True, **opts)
 +
 +    return parts['body']
+diff --git a/tests/test-hgweb-help.t b/tests/test-highlight-help.t
+copy from tests/test-hgweb-help.t
+copy to tests/test-highlight-help.t
+--- a/tests/test-hgweb-help.t
++++ b/tests/test-highlight-help.t
+@@ -1,11 +1,11 @@
+-  $ "$TESTDIR/hghave" serve || exit 80
+-
+-Test the help pages in hgweb.
+-
+-Dish up an empty repo; serve it cold.
+-
++  $ "$TESTDIR/hghave" docutils serve || exit 80
++  $ cat <<EOF >> $HGRCPATH
++  > [extensions]
++  > highlight =
++  > EOF
+   $ hg init test
+   $ cd test
++
+   $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid
+   $ cat hg.pid >> $DAEMON_PIDS
+ 
+@@ -53,102 +53,114 @@ Dish up an empty repo; serve it cold.
+   files, or words in the commit message</div>
+   </form>
+   <div id="doc">
+-  <p>
+-  hg add [OPTION]... [FILE]...
+-  </p>
+-  <p>
+-  add the specified files on the next commit
+-  </p>
+-  <p>
+-  Schedule files to be version controlled and added to the
+-  repository.
+-  </p>
+-  <p>
+-  The files will be added to the repository at the next commit. To
+-  undo an add before that, see "hg forget".
+-  </p>
+-  <p>
+-  If no names are given, add all files to the repository.
+-  </p>
+-  <p>
+-  Returns 0 if all files are successfully added.
+-  </p>
+-  <p>
+-  options:
+-  </p>
+-  <table>
+-   <tr><td>-I</td>
++  <p>hg add [OPTION]... [FILE]...</p>
++  <p>add the specified files on the next commit</p>
++  <blockquote>
++  <p>Schedule files to be version controlled and added to the
++  repository.</p>
++  <p>The files will be added to the repository at the next commit. To
++  undo an add before that, see <a class="reference external" href="forget"><tt class="docutils literal">hg forget</tt></a>.</p>
++  <p>If no names are given, add all files to the repository.</p>
++  <div class="verbose container">
++  <p>An example showing how new (unknown) files are added
++  automatically by <a class="reference external" href="add"><tt class="docutils literal">hg add</tt></a>:</p>
++  <pre class="literal-block">
++  $ ls
++  foo.c
++  $ hg status
++  ? foo.c
++  $ hg add
++  adding foo.c
++  $ hg status
++  A foo.c
++  </pre>
++  </div>
++  <p>Returns 0 if all files are successfully added.</p>
++  </blockquote>
++  <p>options:</p>
++  <blockquote>
++  <table border="1" class="docutils">
++  <colgroup>
++  <col width="3%" />
++  <col width="33%" />
++  <col width="64%" />
++  </colgroup>
++  <tbody valign="top">
++  <tr><td>-I</td>
+   <td>--include PATTERN [+]</td>
+-  <td>include names matching the given patterns</td></tr>
+-   <tr><td>-X</td>
++  <td>include names matching the given patterns</td>
++  </tr>
++  <tr><td>-X</td>
+   <td>--exclude PATTERN [+]</td>
+-  <td>exclude names matching the given patterns</td></tr>
+-   <tr><td>-S</td>
++  <td>exclude names matching the given patterns</td>
++  </tr>
++  <tr><td>-S</td>
+   <td>--subrepos</td>
+-  <td>recurse into subrepositories</td></tr>
+-   <tr><td>-n</td>
++  <td>recurse into subrepositories</td>
++  </tr>
++  <tr><td>-n</td>
+   <td>--dry-run</td>
+-  <td>do not perform actions, just print output</td></tr>
++  <td>do not perform actions, just print output</td>
++  </tr>
++  </tbody>
+   </table>
+-  <p>
+-  [+] marked option can be specified multiple times
+-  </p>
+-  <p>
+-  global options:
+-  </p>
+-  <table>
+-   <tr><td>-R</td>
+-  <td>--repository REPO</td>
+-  <td>repository root directory or name of overlay bundle file</td></tr>
+-   <tr><td></td>
+-  <td>--cwd DIR</td>
+-  <td>change working directory</td></tr>
+-   <tr><td>-y</td>
++  </blockquote>
++  <p>[+] marked option can be specified multiple times</p>
++  <p>global options:</p>
++  <blockquote>
++  <table border="1" class="docutils">
++  <colgroup>
++  <col width="2%" />
++  <col width="22%" />
++  <col width="76%" />
++  </colgroup>
++  <tbody valign="top">
++  <tr><td>-R</td>
++  <td>--repository REPO
++  --cwd DIR</td>
++  <td>repository root directory or name of overlay bundle file
++  change working directory</td>
++  </tr>
++  <tr><td>-y</td>
+   <td>--noninteractive</td>
+-  <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
+-   <tr><td>-q</td>
++  <td>do not prompt, automatically pick the first choice for all prompts</td>
++  </tr>
++  <tr><td>-q</td>
+   <td>--quiet</td>
+-  <td>suppress output</td></tr>
+-   <tr><td>-v</td>
+-  <td>--verbose</td>
+-  <td>enable additional output</td></tr>
+-   <tr><td></td>
+-  <td>--config CONFIG [+]</td>
+-  <td>set/override config option (use 'section.name=value')</td></tr>
+-   <tr><td></td>
+-  <td>--debug</td>
+-  <td>enable debugging output</td></tr>
+-   <tr><td></td>
+-  <td>--debugger</td>
+-  <td>start debugger</td></tr>
+-   <tr><td></td>
+-  <td>--encoding ENCODE</td>
+-  <td>set the charset encoding (default: ascii)</td></tr>
+-   <tr><td></td>
+-  <td>--encodingmode MODE</td>
+-  <td>set the charset encoding mode (default: strict)</td></tr>
+-   <tr><td></td>
+-  <td>--traceback</td>
+-  <td>always print a traceback on exception</td></tr>
+-   <tr><td></td>
+-  <td>--time</td>
+-  <td>time how long the command takes</td></tr>
+-   <tr><td></td>
+-  <td>--profile</td>
+-  <td>print command execution profile</td></tr>
+-   <tr><td></td>
+-  <td>--version</td>
+-  <td>output version information and exit</td></tr>
+-   <tr><td>-h</td>
+-  <td>--help</td>
+-  <td>display help and exit</td></tr>
+-   <tr><td></td>
+-  <td>--hidden</td>
+-  <td>consider hidden changesets</td></tr>
++  <td>suppress output</td>
++  </tr>
++  <tr><td>-v</td>
++  <td>--verbose
++  --config CONFIG [+]
++  --debug
++  --debugger
++  --encoding ENCODE
++  --encodingmode MODE
++  --traceback
++  --time
++  --profile
++  --version</td>
++  <td>enable additional output
++  set/override config option (use 'section.name=value')
++  enable debugging output
++  start debugger
++  set the charset encoding (default: ascii)
++  set the charset encoding mode (default: strict)
++  always print a traceback on exception
++  time how long the command takes
++  print command execution profile
++  output version information and exit</td>
++  </tr>
++  <tr><td>-h</td>
++  <td>--help
++  --hidden</td>
++  <td>display help and exit
++  consider hidden changesets</td>
++  </tr>
++  </tbody>
+   </table>
+-  <p>
+-  [+] marked option can be specified multiple times
+-  </p>
++  </blockquote>
++  <p>[+] marked option can be specified multiple times</p>
+   
+   </div>
+   </div>
+@@ -205,102 +217,156 @@ Dish up an empty repo; serve it cold.
+   files, or words in the commit message</div>
+   </form>
+   <div id="doc">
+-  <p>
+-  hg remove [OPTION]... FILE...
+-  </p>
+-  <p>
+-  aliases: rm
+-  </p>
+-  <p>
+-  remove the specified files on the next commit
+-  </p>
+-  <p>
+-  Schedule the indicated files for removal from the current branch.
+-  </p>
+-  <p>
+-  This command schedules the files to be removed at the next commit.
+-  To undo a remove before that, see "hg revert". To undo added
+-  files, see "hg forget".
+-  </p>
+-  <p>
+-  Returns 0 on success, 1 if any warnings encountered.
+-  </p>
+-  <p>
+-  options:
+-  </p>
+-  <table>
+-   <tr><td>-A</td>
++  <p>hg remove [OPTION]... FILE...</p>
++  <p>aliases: rm</p>
++  <p>remove the specified files on the next commit</p>
++  <blockquote>
++  <p>Schedule the indicated files for removal from the current branch.</p>
++  <p>This command schedules the files to be removed at the next commit.
++  To undo a remove before that, see <a class="reference external" href="revert"><tt class="docutils literal">hg revert</tt></a>. To undo added
++  files, see <a class="reference external" href="forget"><tt class="docutils literal">hg forget</tt></a>.</p>
++  <div class="verbose container">
++  <p>-A/--after can be used to remove only files that have already
++  been deleted, -f/--force can be used to force deletion, and -Af
++  can be used to remove files from the next revision without
++  deleting them from the working directory.</p>
++  <p>The following table details the behavior of remove for different
++  file states (columns) and option combinations (rows). The file
++  states are Added [A], Clean [C], Modified [M] and Missing [!]
++  (as reported by <a class="reference external" href="status"><tt class="docutils literal">hg status</tt></a>). The actions are Warn, Remove
++  (from branch) and Delete (from disk):</p>
++  <table border="1" class="docutils">
++  <colgroup>
++  <col width="47%" />
++  <col width="13%" />
++  <col width="13%" />
++  <col width="13%" />
++  <col width="13%" />
++  </colgroup>
++  <thead valign="bottom">
++  <tr><th class="head">&nbsp;</th>
++  <th class="head">&nbsp;</th>
++  <th class="head">&nbsp;</th>
++  <th class="head">&nbsp;</th>
++  <th class="head">&nbsp;</th>
++  </tr>
++  </thead>
++  <tbody valign="top">
++  <tr><td>none</td>
++  <td>W</td>
++  <td>RD</td>
++  <td>W</td>
++  <td>R</td>
++  </tr>
++  <tr><td>-f</td>
++  <td>R</td>
++  <td>RD</td>
++  <td>RD</td>
++  <td>R</td>
++  </tr>
++  <tr><td>-A</td>
++  <td>W</td>
++  <td>W</td>
++  <td>W</td>
++  <td>R</td>
++  </tr>
++  <tr><td>-Af</td>
++  <td>R</td>
++  <td>R</td>
++  <td>R</td>
++  <td>R</td>
++  </tr>
++  </tbody>
++  </table>
++  <p>Note that remove never deletes files in Added [A] state from the
++  working directory, not even if option --force is specified.</p>
++  </div>
++  <p>Returns 0 on success, 1 if any warnings encountered.</p>
++  </blockquote>
++  <p>options:</p>
++  <blockquote>
++  <table border="1" class="docutils">
++  <colgroup>
++  <col width="3%" />
++  <col width="29%" />
++  <col width="68%" />
++  </colgroup>
++  <tbody valign="top">
++  <tr><td>-A</td>
+   <td>--after</td>
+-  <td>record delete for missing files</td></tr>
+-   <tr><td>-f</td>
++  <td>record delete for missing files</td>
++  </tr>
++  <tr><td>-f</td>
+   <td>--force</td>
+-  <td>remove (and delete) file even if added or modified</td></tr>
+-   <tr><td>-I</td>
++  <td>remove (and delete) file even if added or modified</td>
++  </tr>
++  <tr><td>-I</td>
+   <td>--include PATTERN [+]</td>
+-  <td>include names matching the given patterns</td></tr>
+-   <tr><td>-X</td>
++  <td>include names matching the given patterns</td>
++  </tr>
++  <tr><td>-X</td>
+   <td>--exclude PATTERN [+]</td>
+-  <td>exclude names matching the given patterns</td></tr>
++  <td>exclude names matching the given patterns</td>
++  </tr>
++  </tbody>
+   </table>
+-  <p>
+-  [+] marked option can be specified multiple times
+-  </p>
+-  <p>
+-  global options:
+-  </p>
+-  <table>
+-   <tr><td>-R</td>
+-  <td>--repository REPO</td>
+-  <td>repository root directory or name of overlay bundle file</td></tr>
+-   <tr><td></td>
+-  <td>--cwd DIR</td>
+-  <td>change working directory</td></tr>
+-   <tr><td>-y</td>
++  </blockquote>
++  <p>[+] marked option can be specified multiple times</p>
++  <p>global options:</p>
++  <blockquote>
++  <table border="1" class="docutils">
++  <colgroup>
++  <col width="2%" />
++  <col width="22%" />
++  <col width="76%" />
++  </colgroup>
++  <tbody valign="top">
++  <tr><td>-R</td>
++  <td>--repository REPO
++  --cwd DIR</td>
++  <td>repository root directory or name of overlay bundle file
++  change working directory</td>
++  </tr>
++  <tr><td>-y</td>
+   <td>--noninteractive</td>
+-  <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
+-   <tr><td>-q</td>
++  <td>do not prompt, automatically pick the first choice for all prompts</td>
++  </tr>
++  <tr><td>-q</td>
+   <td>--quiet</td>
+-  <td>suppress output</td></tr>
+-   <tr><td>-v</td>
+-  <td>--verbose</td>
+-  <td>enable additional output</td></tr>
+-   <tr><td></td>
+-  <td>--config CONFIG [+]</td>
+-  <td>set/override config option (use 'section.name=value')</td></tr>
+-   <tr><td></td>
+-  <td>--debug</td>
+-  <td>enable debugging output</td></tr>
+-   <tr><td></td>
+-  <td>--debugger</td>
+-  <td>start debugger</td></tr>
+-   <tr><td></td>
+-  <td>--encoding ENCODE</td>
+-  <td>set the charset encoding (default: ascii)</td></tr>
+-   <tr><td></td>
+-  <td>--encodingmode MODE</td>
+-  <td>set the charset encoding mode (default: strict)</td></tr>
+-   <tr><td></td>
+-  <td>--traceback</td>
+-  <td>always print a traceback on exception</td></tr>
+-   <tr><td></td>
+-  <td>--time</td>
+-  <td>time how long the command takes</td></tr>
+-   <tr><td></td>
+-  <td>--profile</td>
+-  <td>print command execution profile</td></tr>
+-   <tr><td></td>
+-  <td>--version</td>
+-  <td>output version information and exit</td></tr>
+-   <tr><td>-h</td>
+-  <td>--help</td>
+-  <td>display help and exit</td></tr>
+-   <tr><td></td>
+-  <td>--hidden</td>
+-  <td>consider hidden changesets</td></tr>
++  <td>suppress output</td>
++  </tr>
++  <tr><td>-v</td>
++  <td>--verbose
++  --config CONFIG [+]
++  --debug
++  --debugger
++  --encoding ENCODE
++  --encodingmode MODE
++  --traceback
++  --time
++  --profile
++  --version</td>
++  <td>enable additional output
++  set/override config option (use 'section.name=value')
++  enable debugging output
++  start debugger
++  set the charset encoding (default: ascii)
++  set the charset encoding mode (default: strict)
++  always print a traceback on exception
++  time how long the command takes
++  print command execution profile
++  output version information and exit</td>
++  </tr>
++  <tr><td>-h</td>
++  <td>--help
++  --hidden</td>
++  <td>display help and exit
++  consider hidden changesets</td>
++  </tr>
++  </tbody>
+   </table>
+-  <p>
+-  [+] marked option can be specified multiple times
+-  </p>
++  </blockquote>
++  <p>[+] marked option can be specified multiple times</p>
+   
+   </div>
+   </div>
+@@ -357,47 +423,28 @@ Dish up an empty repo; serve it cold.
+   files, or words in the commit message</div>
+   </form>
+   <div id="doc">
+-  <table>
+-   <tr><td>Specifying Single Revisions</td></tr>
+-  </table>
+-  <p>
+-  Mercurial supports several ways to specify individual revisions.
+-  </p>
+-  <p>
+-  A plain integer is treated as a revision number. Negative integers are
++  <p>Mercurial supports several ways to specify individual revisions.</p>
++  <p>A plain integer is treated as a revision number. Negative integers are
+   treated as sequential offsets from the tip, with -1 denoting the tip,
+-  -2 denoting the revision prior to the tip, and so forth.
+-  </p>
+-  <p>
+-  A 40-digit hexadecimal string is treated as a unique revision
+-  identifier.
+-  </p>
+-  <p>
+-  A hexadecimal string less than 40 characters long is treated as a
++  -2 denoting the revision prior to the tip, and so forth.</p>
++  <p>A 40-digit hexadecimal string is treated as a unique revision
++  identifier.</p>
++  <p>A hexadecimal string less than 40 characters long is treated as a
+   unique revision identifier and is referred to as a short-form
+   identifier. A short-form identifier is only valid if it is the prefix
+-  of exactly one full-length identifier.
+-  </p>
+-  <p>
+-  Any other string is treated as a bookmark, tag, or branch name. A
++  of exactly one full-length identifier.</p>
++  <p>Any other string is treated as a bookmark, tag, or branch name. A
+   bookmark is a movable pointer to a revision. A tag is a permanent name
+   associated with a revision. A branch name denotes the tipmost revision
+-  of that branch. Bookmark, tag, and branch names must not contain the ":"
+-  character.
+-  </p>
+-  <p>
+-  The reserved name "tip" always identifies the most recent revision.
+-  </p>
+-  <p>
+-  The reserved name "null" indicates the null revision. This is the
+-  revision of an empty repository, and the parent of revision 0.
+-  </p>
+-  <p>
+-  The reserved name "." indicates the working directory parent. If no
++  of that branch. Bookmark, tag, and branch names must not contain the &quot;:&quot;
++  character.</p>
++  <p>The reserved name &quot;tip&quot; always identifies the most recent revision.</p>
++  <p>The reserved name &quot;null&quot; indicates the null revision. This is the
++  revision of an empty repository, and the parent of revision 0.</p>
++  <p>The reserved name &quot;.&quot; indicates the working directory parent. If no
+   working directory is checked out, it is equivalent to null. If an
+-  uncommitted merge is in progress, "." is the revision of the first
+-  parent.
+-  </p>
++  uncommitted merge is in progress, &quot;.&quot; is the revision of the first
++  parent.</p>
+   
+   </div>
+   </div>

File minirst-html.diff

+# HG changeset patch
+# Parent 82217b76f1e31b752568b6388542271154c7e342
+# User Dan Villiom Podlaski Christiansen  <danchr@gmail.com>
+minirst: HTML formatter tweaks
+
+- output table rows on distinct lines
+- don't make the first row a table header
+
+
+diff --git a/mercurial/minirst.py b/mercurial/minirst.py
+--- a/mercurial/minirst.py
++++ b/mercurial/minirst.py
+@@ -546,11 +546,8 @@ def formathtml(blocks):
+             for row in table:
+                 l = []
+                 for v in zip(row):
+-                    if not t:
+-                        l.append('<th>%s</th>' % v)
+-                    else:
+-                        l.append('<td>%s</td>' % v)
+-                t.append(' <tr>%s</tr>\n' % ''.join(l))
++                    l.append('<td>%s</td>' % v)
++                t.append(' <tr>%s</tr>\n' % '\n'.join(l))
+             out.append('<table>\n%s</table>\n' % ''.join(t))
+         elif btype == 'definition':
+             openlist('dl', level)
 # HG changeset patch
+# Parent 202b2970c707114d5915b42443be35897dba5bc0
 # User Dan Villiom Podlaski Christiansen  <danchr@gmail.com>
 hgweb: generate HTML documentation
 
  </div>
  </div>
  
+diff --git a/tests/test-hgweb-help.t b/tests/test-hgweb-help.t
+--- a/tests/test-hgweb-help.t
++++ b/tests/test-hgweb-help.t
+@@ -52,65 +52,105 @@ Dish up an empty repo; serve it cold.
+   <div id="hint">find changesets by author, revision,
+   files, or words in the commit message</div>
+   </form>
+-  <pre>
++  <div id="doc">
++  <p>
+   hg add [OPTION]... [FILE]...
++  </p>
++  <p>
++  add the specified files on the next commit
++  </p>
++  <p>
++  Schedule files to be version controlled and added to the
++  repository.
++  </p>
++  <p>
++  The files will be added to the repository at the next commit. To
++  undo an add before that, see "hg forget".
++  </p>
++  <p>
++  If no names are given, add all files to the repository.
++  </p>
++  <p>
++  Returns 0 if all files are successfully added.
++  </p>
++  <p>
++  options:
++  </p>
++  <table>
++   <tr><td>-I</td>
++  <td>--include PATTERN [+]</td>
++  <td>include names matching the given patterns</td></tr>
++   <tr><td>-X</td>
++  <td>--exclude PATTERN [+]</td>
++  <td>exclude names matching the given patterns</td></tr>
++   <tr><td>-S</td>
++  <td>--subrepos</td>
++  <td>recurse into subrepositories</td></tr>
++   <tr><td>-n</td>
++  <td>--dry-run</td>
++  <td>do not perform actions, just print output</td></tr>
++  </table>
++  <p>
++  [+] marked option can be specified multiple times
++  </p>
++  <p>
++  global options:
++  </p>
++  <table>
++   <tr><td>-R</td>
++  <td>--repository REPO</td>
++  <td>repository root directory or name of overlay bundle file</td></tr>
++   <tr><td></td>
++  <td>--cwd DIR</td>
++  <td>change working directory</td></tr>
++   <tr><td>-y</td>
++  <td>--noninteractive</td>
++  <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
++   <tr><td>-q</td>
++  <td>--quiet</td>
++  <td>suppress output</td></tr>
++   <tr><td>-v</td>
++  <td>--verbose</td>
++  <td>enable additional output</td></tr>
++   <tr><td></td>
++  <td>--config CONFIG [+]</td>
++  <td>set/override config option (use 'section.name=value')</td></tr>
++   <tr><td></td>
++  <td>--debug</td>
++  <td>enable debugging output</td></tr>
++   <tr><td></td>
++  <td>--debugger</td>
++  <td>start debugger</td></tr>
++   <tr><td></td>
++  <td>--encoding ENCODE</td>
++  <td>set the charset encoding (default: ascii)</td></tr>
++   <tr><td></td>
++  <td>--encodingmode MODE</td>
++  <td>set the charset encoding mode (default: strict)</td></tr>
++   <tr><td></td>
++  <td>--traceback</td>
++  <td>always print a traceback on exception</td></tr>
++   <tr><td></td>
++  <td>--time</td>
++  <td>time how long the command takes</td></tr>
++   <tr><td></td>
++  <td>--profile</td>
++  <td>print command execution profile</td></tr>
++   <tr><td></td>
++  <td>--version</td>
++  <td>output version information and exit</td></tr>
++   <tr><td>-h</td>
++  <td>--help</td>
++  <td>display help and exit</td></tr>
++   <tr><td></td>
++  <td>--hidden</td>
++  <td>consider hidden changesets</td></tr>
++  </table>
++  <p>
++  [+] marked option can be specified multiple times
++  </p>
+   
+-  add the specified files on the next commit
+-  
+-      Schedule files to be version controlled and added to the repository.
+-  
+-      The files will be added to the repository at the next commit. To undo an
+-      add before that, see &quot;hg forget&quot;.
+-  
+-      If no names are given, add all files to the repository.
+-  
+-      An example showing how new (unknown) files are added automatically by &quot;hg
+-      add&quot;:
+-  
+-        $ ls
+-        foo.c
+-        $ hg status
+-        ? foo.c
+-        $ hg add
+-        adding foo.c
+-        $ hg status
+-        A foo.c
+-  
+-      Returns 0 if all files are successfully added.
+-  
+-  options:
+-  
+-   -I --include PATTERN [+] include names matching the given patterns
+-   -X --exclude PATTERN [+] exclude names matching the given patterns
+-   -S --subrepos            recurse into subrepositories
+-   -n --dry-run             do not perform actions, just print output
+-  
+-  [+] marked option can be specified multiple times
+-  
+-  global options:
+-  
+-   -R --repository REPO   repository root directory or name of overlay bundle
+-                          file
+-      --cwd DIR           change working directory
+-   -y --noninteractive    do not prompt, automatically pick the first choice for
+-                          all prompts
+-   -q --quiet             suppress output
+-   -v --verbose           enable additional output
+-      --config CONFIG [+] set/override config option (use 'section.name=value')
+-      --debug             enable debugging output
+-      --debugger          start debugger
+-      --encoding ENCODE   set the charset encoding (default: ascii)
+-      --encodingmode MODE set the charset encoding mode (default: strict)
+-      --traceback         always print a traceback on exception
+-      --time              time how long the command takes
+-      --profile           print command execution profile
+-      --version           output version information and exit
+-   -h --help              display help and exit
+-      --hidden            consider hidden changesets
+-  
+-  [+] marked option can be specified multiple times
+-  
+-  </pre>
++  </div>
+   </div>
+   </div>
+   
+@@ -164,74 +204,105 @@ Dish up an empty repo; serve it cold.
+   <div id="hint">find changesets by author, revision,
+   files, or words in the commit message</div>
+   </form>
+-  <pre>
++  <div id="doc">
++  <p>
+   hg remove [OPTION]... FILE...
++  </p>
++  <p>
++  aliases: rm
++  </p>
++  <p>
++  remove the specified files on the next commit
++  </p>
++  <p>
++  Schedule the indicated files for removal from the current branch.
++  </p>
++  <p>
++  This command schedules the files to be removed at the next commit.
++  To undo a remove before that, see "hg revert". To undo added
++  files, see "hg forget".
++  </p>
++  <p>
++  Returns 0 on success, 1 if any warnings encountered.
++  </p>
++  <p>
++  options:
++  </p>
++  <table>
++   <tr><td>-A</td>
++  <td>--after</td>
++  <td>record delete for missing files</td></tr>
++   <tr><td>-f</td>
++  <td>--force</td>
++  <td>remove (and delete) file even if added or modified</td></tr>
++   <tr><td>-I</td>
++  <td>--include PATTERN [+]</td>
++  <td>include names matching the given patterns</td></tr>
++   <tr><td>-X</td>
++  <td>--exclude PATTERN [+]</td>
++  <td>exclude names matching the given patterns</td></tr>
++  </table>
++  <p>
++  [+] marked option can be specified multiple times
++  </p>
++  <p>
++  global options:
++  </p>
++  <table>
++   <tr><td>-R</td>
++  <td>--repository REPO</td>
++  <td>repository root directory or name of overlay bundle file</td></tr>
++   <tr><td></td>
++  <td>--cwd DIR</td>
++  <td>change working directory</td></tr>
++   <tr><td>-y</td>
++  <td>--noninteractive</td>
++  <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
++   <tr><td>-q</td>
++  <td>--quiet</td>
++  <td>suppress output</td></tr>
++   <tr><td>-v</td>
++  <td>--verbose</td>
++  <td>enable additional output</td></tr>
++   <tr><td></td>
++  <td>--config CONFIG [+]</td>
++  <td>set/override config option (use 'section.name=value')</td></tr>
++   <tr><td></td>
++  <td>--debug</td>
++  <td>enable debugging output</td></tr>
++   <tr><td></td>
++  <td>--debugger</td>
++  <td>start debugger</td></tr>
++   <tr><td></td>
++  <td>--encoding ENCODE</td>
++  <td>set the charset encoding (default: ascii)</td></tr>
++   <tr><td></td>
++  <td>--encodingmode MODE</td>
++  <td>set the charset encoding mode (default: strict)</td></tr>
++   <tr><td></td>
++  <td>--traceback</td>
++  <td>always print a traceback on exception</td></tr>
++   <tr><td></td>
++  <td>--time</td>
++  <td>time how long the command takes</td></tr>
++   <tr><td></td>
++  <td>--profile</td>
++  <td>print command execution profile</td></tr>
++   <tr><td></td>
++  <td>--version</td>
++  <td>output version information and exit</td></tr>
++   <tr><td>-h</td>
++  <td>--help</td>
++  <td>display help and exit</td></tr>
++   <tr><td></td>
++  <td>--hidden</td>
++  <td>consider hidden changesets</td></tr>
++  </table>
++  <p>
++  [+] marked option can be specified multiple times
++  </p>
+   
+-  aliases: rm
+-  
+-  remove the specified files on the next commit
+-  
+-      Schedule the indicated files for removal from the current branch.
+-  
+-      This command schedules the files to be removed at the next commit. To undo
+-      a remove before that, see &quot;hg revert&quot;. To undo added files, see &quot;hg
+-      forget&quot;.
+-  
+-      -A/--after can be used to remove only files that have already been
+-      deleted, -f/--force can be used to force deletion, and -Af can be used to
+-      remove files from the next revision without deleting them from the working
+-      directory.
+-  
+-      The following table details the behavior of remove for different file
+-      states (columns) and option combinations (rows). The file states are Added
+-      [A], Clean [C], Modified [M] and Missing [!] (as reported by &quot;hg status&quot;).
+-      The actions are Warn, Remove (from branch) and Delete (from disk):
+-  
+-           A C  M  !
+-      --------------
+-      none W RD W  R
+-      -f   R RD RD R
+-      -A   W W  W  R
+-      -Af  R R  R  R
+-  
+-      Note that remove never deletes files in Added [A] state from the working
+-      directory, not even if option --force is specified.
+-  
+-      Returns 0 on success, 1 if any warnings encountered.
+-  
+-  options:
+-  
+-   -A --after               record delete for missing files
+-   -f --force               remove (and delete) file even if added or modified
+-   -I --include PATTERN [+] include names matching the given patterns
+-   -X --exclude PATTERN [+] exclude names matching the given patterns
+-  
+-  [+] marked option can be specified multiple times
+-  
+-  global options:
+-  
+-   -R --repository REPO   repository root directory or name of overlay bundle
+-                          file
+-      --cwd DIR           change working directory
+-   -y --noninteractive    do not prompt, automatically pick the first choice for
+-                          all prompts
+-   -q --quiet             suppress output
+-   -v --verbose           enable additional output
+-      --config CONFIG [+] set/override config option (use 'section.name=value')
+-      --debug             enable debugging output
+-      --debugger          start debugger
+-      --encoding ENCODE   set the charset encoding (default: ascii)
+-      --encodingmode MODE set the charset encoding mode (default: strict)
+-      --traceback         always print a traceback on exception
+-      --time              time how long the command takes
+-      --profile           print command execution profile
+-      --version           output version information and exit
+-   -h --help              display help and exit
+-      --hidden            consider hidden changesets
+-  
+-  [+] marked option can be specified multiple times
+-  
+-  </pre>
++  </div>
+   </div>
+   </div>
+   
+@@ -285,38 +356,50 @@ Dish up an empty repo; serve it cold.
+   <div id="hint">find changesets by author, revision,
+   files, or words in the commit message</div>
+   </form>
+-  <pre>
+-  Specifying Single Revisions
++  <div id="doc">
++  <table>
++   <tr><td>Specifying Single Revisions</td></tr>
++  </table>
++  <p>
++  Mercurial supports several ways to specify individual revisions.
++  </p>
++  <p>
++  A plain integer is treated as a revision number. Negative integers are
++  treated as sequential offsets from the tip, with -1 denoting the tip,
++  -2 denoting the revision prior to the tip, and so forth.
++  </p>
++  <p>
++  A 40-digit hexadecimal string is treated as a unique revision
++  identifier.
++  </p>
++  <p>
++  A hexadecimal string less than 40 characters long is treated as a
++  unique revision identifier and is referred to as a short-form
++  identifier. A short-form identifier is only valid if it is the prefix
++  of exactly one full-length identifier.
++  </p>
++  <p>
++  Any other string is treated as a bookmark, tag, or branch name. A
++  bookmark is a movable pointer to a revision. A tag is a permanent name
++  associated with a revision. A branch name denotes the tipmost revision
++  of that branch. Bookmark, tag, and branch names must not contain the ":"
++  character.
++  </p>
++  <p>
++  The reserved name "tip" always identifies the most recent revision.
++  </p>
++  <p>
++  The reserved name "null" indicates the null revision. This is the
++  revision of an empty repository, and the parent of revision 0.
++  </p>
++  <p>
++  The reserved name "." indicates the working directory parent. If no
++  working directory is checked out, it is equivalent to null. If an
++  uncommitted merge is in progress, "." is the revision of the first
++  parent.
++  </p>
+   
+-      Mercurial supports several ways to specify individual revisions.
+-  
+-      A plain integer is treated as a revision number. Negative integers are
+-      treated as sequential offsets from the tip, with -1 denoting the tip, -2
+-      denoting the revision prior to the tip, and so forth.
+-  
+-      A 40-digit hexadecimal string is treated as a unique revision identifier.
+-  
+-      A hexadecimal string less than 40 characters long is treated as a unique
+-      revision identifier and is referred to as a short-form identifier. A
+-      short-form identifier is only valid if it is the prefix of exactly one
+-      full-length identifier.
+-  
+-      Any other string is treated as a bookmark, tag, or branch name. A bookmark
+-      is a movable pointer to a revision. A tag is a permanent name associated
+-      with a revision. A branch name denotes the tipmost revision of that
+-      branch. Bookmark, tag, and branch names must not contain the &quot;:&quot;
+-      character.
+-  
+-      The reserved name &quot;tip&quot; always identifies the most recent revision.
+-  
+-      The reserved name &quot;null&quot; indicates the null revision. This is the revision
+-      of an empty repository, and the parent of revision 0.
+-  
+-      The reserved name &quot;.&quot; indicates the working directory parent. If no
+-      working directory is checked out, it is equivalent to null. If an
+-      uncommitted merge is in progress, &quot;.&quot; is the revision of the first parent.
+-  
+-  </pre>
++  </div>
+   </div>
+   </div>
+   
 test-hgweb-help.diff
 move-help.diff
 better-rst.diff
+minirst-html.diff
 rstdoc.diff
 highlight-docutils.diff
 largefiles-filesets.diff

File test-hgweb-help.diff

 # HG changeset patch
+# Parent 97761496c65ae836d6b0983a3f48959dd3112364
 # User Dan Villiom Podlaski Christiansen  <danchr@gmail.com>
 hgweb: test help functionality
 
 we tweak the templates a bit to make the output more greppable
 
-
 diff --git a/mercurial/templates/coal/map b/mercurial/templates/coal/map
 --- a/mercurial/templates/coal/map
 +++ b/mercurial/templates/coal/map
 new file mode 100644
 --- /dev/null
 +++ b/tests/test-hgweb-help.t
-@@ -0,0 +1,22 @@
+@@ -0,0 +1,330 @@
 +  $ "$TESTDIR/hghave" serve || exit 80
 +
 +Test the help pages in hgweb.
 +  $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid
 +  $ cat hg.pid >> $DAEMON_PIDS
 +
-+  $ urls=$("$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT help | \
-+  >   sed -n 's+^<a href="/\([^"]*\)">$+\1+p')
-+  $ for url in $urls
-+  > do
-+  >   echo
-+  >   echo FETCH "$url"
-+  >   echo
-+  >   "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "$url"
-+  > done
++  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "help/add"
++  200 Script output follows
++  
++  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
++  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
++  <head>
++  <link rel="icon" href="/static/hgicon.png" type="image/png" />
++  <meta name="robots" content="index, nofollow" />
++  <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
++  <script type="text/javascript" src="/static/mercurial.js"></script>
++  
++  <title>Help: add</title>
++  </head>
++  <body>
++  
++  <div class="container">
++  <div class="menu">
++  <div class="logo">
++  <a href="http://mercurial.selenic.com/">
++  <img src="/static/hglogo.png" alt="mercurial" /></a>
++  </div>
++  <ul>
++  <li><a href="/shortlog">log</a></li>
++  <li><a href="/graph">graph</a></li>
++  <li><a href="/tags">tags</a></li>
++  <li><a href="/bookmarks">bookmarks</a></li>
++  <li><a href="/branches">branches</a></li>
++  </ul>
++  <ul>
++   <li class="active"><a href="/help">help</a></li>
++  </ul>
++  </div>
++  
++  <div class="main">
++  <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
++  <h3>Help: add</h3>
++  
++  <form class="search" action="/log">
++  
++  <p><input name="rev" id="search1" type="text" size="30" /></p>
++  <div id="hint">find changesets by author, revision,
++  files, or words in the commit message</div>
++  </form>
++  <pre>
++  hg add [OPTION]... [FILE]...
++  
++  add the specified files on the next commit
++  
++      Schedule files to be version controlled and added to the repository.
++  
++      The files will be added to the repository at the next commit. To undo an
++      add before that, see &quot;hg forget&quot;.
++  
++      If no names are given, add all files to the repository.
++  
++      An example showing how new (unknown) files are added automatically by &quot;hg
++      add&quot;:
++  
++        $ ls
++        foo.c
++        $ hg status
++        ? foo.c
++        $ hg add
++        adding foo.c
++        $ hg status
++        A foo.c
++  
++      Returns 0 if all files are successfully added.
++  
++  options:
++  
++   -I --include PATTERN [+] include names matching the given patterns
++   -X --exclude PATTERN [+] exclude names matching the given patterns
++   -S --subrepos            recurse into subrepositories
++   -n --dry-run             do not perform actions, just print output
++  
++  [+] marked option can be specified multiple times
++  
++  global options:
++  
++   -R --repository REPO   repository root directory or name of overlay bundle
++                          file
++      --cwd DIR           change working directory
++   -y --noninteractive    do not prompt, automatically pick the first choice for
++                          all prompts
++   -q --quiet             suppress output
++   -v --verbose           enable additional output
++      --config CONFIG [+] set/override config option (use 'section.name=value')
++      --debug             enable debugging output
++      --debugger          start debugger
++      --encoding ENCODE   set the charset encoding (default: ascii)
++      --encodingmode MODE set the charset encoding mode (default: strict)
++      --traceback         always print a traceback on exception
++      --time              time how long the command takes
++      --profile           print command execution profile
++      --version           output version information and exit
++   -h --help              display help and exit
++      --hidden            consider hidden changesets
++  
++  [+] marked option can be specified multiple times
++  
++  </pre>
++  </div>
++  </div>
++  
++  <script type="text/javascript">process_dates()</script>
++  
++  
++  </body>
++  </html>
++  
++
++  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "help/remove"
++  200 Script output follows
++  
++  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
++  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
++  <head>
++  <link rel="icon" href="/static/hgicon.png" type="image/png" />
++  <meta name="robots" content="index, nofollow" />
++  <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
++  <script type="text/javascript" src="/static/mercurial.js"></script>
++  
++  <title>Help: remove</title>
++  </head>
++  <body>
++  
++  <div class="container">
++  <div class="menu">
++  <div class="logo">
++  <a href="http://mercurial.selenic.com/">
++  <img src="/static/hglogo.png" alt="mercurial" /></a>
++  </div>
++  <ul>
++  <li><a href="/shortlog">log</a></li>
++  <li><a href="/graph">graph</a></li>
++  <li><a href="/tags">tags</a></li>
++  <li><a href="/bookmarks">bookmarks</a></li>
++  <li><a href="/branches">branches</a></li>
++  </ul>
++  <ul>
++   <li class="active"><a href="/help">help</a></li>
++  </ul>
++  </div>
++  
++  <div class="main">
++  <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
++  <h3>Help: remove</h3>
++  
++  <form class="search" action="/log">
++  
++  <p><input name="rev" id="search1" type="text" size="30" /></p>
++  <div id="hint">find changesets by author, revision,
++  files, or words in the commit message</div>
++  </form>
++  <pre>
++  hg remove [OPTION]... FILE...
++  
++  aliases: rm
++  
++  remove the specified files on the next commit
++  
++      Schedule the indicated files for removal from the current branch.
++  
++      This command schedules the files to be removed at the next commit. To undo
++      a remove before that, see &quot;hg revert&quot;. To undo added files, see &quot;hg
++      forget&quot;.
++  
++      -A/--after can be used to remove only files that have already been
++      deleted, -f/--force can be used to force deletion, and -Af can be used to
++      remove files from the next revision without deleting them from the working
++      directory.
++  
++      The following table details the behavior of remove for different file
++      states (columns) and option combinations (rows). The file states are Added
++      [A], Clean [C], Modified [M] and Missing [!] (as reported by &quot;hg status&quot;).
++      The actions are Warn, Remove (from branch) and Delete (from disk):
++  
++           A C  M  !
++      --------------
++      none W RD W  R
++      -f   R RD RD R
++      -A   W W  W  R
++      -Af  R R  R  R
++  
++      Note that remove never deletes files in Added [A] state from the working
++      directory, not even if option --force is specified.
++  
++      Returns 0 on success, 1 if any warnings encountered.
++  
++  options:
++  
++   -A --after               record delete for missing files
++   -f --force               remove (and delete) file even if added or modified
++   -I --include PATTERN [+] include names matching the given patterns
++   -X --exclude PATTERN [+] exclude names matching the given patterns
++  
++  [+] marked option can be specified multiple times
++  
++  global options:
++  
++   -R --repository REPO   repository root directory or name of overlay bundle
++                          file
++      --cwd DIR           change working directory
++   -y --noninteractive    do not prompt, automatically pick the first choice for
++                          all prompts
++   -q --quiet             suppress output
++   -v --verbose           enable additional output
++      --config CONFIG [+] set/override config option (use 'section.name=value')
++      --debug             enable debugging output
++      --debugger          start debugger
++      --encoding ENCODE   set the charset encoding (default: ascii)
++      --encodingmode MODE set the charset encoding mode (default: strict)
++      --traceback         always print a traceback on exception
++      --time              time how long the command takes
++      --profile           print command execution profile
++      --version           output version information and exit
++   -h --help              display help and exit
++      --hidden            consider hidden changesets
++  
++  [+] marked option can be specified multiple times
++  
++  </pre>
++  </div>
++  </div>
++  
++  <script type="text/javascript">process_dates()</script>
++  
++  
++  </body>
++  </html>
++  
++
++  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "help/revisions"
++  200 Script output follows
++  
++  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
++  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
++  <head>
++  <link rel="icon" href="/static/hgicon.png" type="image/png" />
++  <meta name="robots" content="index, nofollow" />
++  <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
++  <script type="text/javascript" src="/static/mercurial.js"></script>
++  
++  <title>Help: revisions</title>
++  </head>
++  <body>
++  
++  <div class="container">
++  <div class="menu">
++  <div class="logo">
++  <a href="http://mercurial.selenic.com/">
++  <img src="/static/hglogo.png" alt="mercurial" /></a>
++  </div>
++  <ul>
++  <li><a href="/shortlog">log</a></li>
++  <li><a href="/graph">graph</a></li>
++  <li><a href="/tags">tags</a></li>
++  <li><a href="/bookmarks">bookmarks</a></li>
++  <li><a href="/branches">branches</a></li>
++  </ul>
++  <ul>
++   <li class="active"><a href="/help">help</a></li>
++  </ul>
++  </div>
++  
++  <div class="main">
++  <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
++  <h3>Help: revisions</h3>
++  
++  <form class="search" action="/log">
++  
++  <p><input name="rev" id="search1" type="text" size="30" /></p>
++  <div id="hint">find changesets by author, revision,
++  files, or words in the commit message</div>
++  </form>
++  <pre>
++  Specifying Single Revisions
++  
++      Mercurial supports several ways to specify individual revisions.
++  
++      A plain integer is treated as a revision number. Negative integers are
++      treated as sequential offsets from the tip, with -1 denoting the tip, -2
++      denoting the revision prior to the tip, and so forth.
++  
++      A 40-digit hexadecimal string is treated as a unique revision identifier.
++  
++      A hexadecimal string less than 40 characters long is treated as a unique
++      revision identifier and is referred to as a short-form identifier. A
++      short-form identifier is only valid if it is the prefix of exactly one
++      full-length identifier.
++  
++      Any other string is treated as a bookmark, tag, or branch name. A bookmark
++      is a movable pointer to a revision. A tag is a permanent name associated
++      with a revision. A branch name denotes the tipmost revision of that
++      branch. Bookmark, tag, and branch names must not contain the &quot;:&quot;
++      character.
++  
++      The reserved name &quot;tip&quot; always identifies the most recent revision.
++  
++      The reserved name &quot;null&quot; indicates the null revision. This is the revision
++      of an empty repository, and the parent of revision 0.
++  
++      The reserved name &quot;.&quot; indicates the working directory parent. If no
++      working directory is checked out, it is equivalent to null. If an
++      uncommitted merge is in progress, &quot;.&quot; is the revision of the first parent.
++  
++  </pre>
++  </div>
++  </div>
++  
++  <script type="text/javascript">process_dates()</script>
++  
++  
++  </body>
++  </html>
++  
 +
 +  $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS