Commits

Dan Villiom Podlaski Christiansen committed 21c465d

Better.

  • Participants
  • Parent commits 6ef76b0

Comments (0)

Files changed (11)

better-rst.diff

-# HG changeset patch
-# User Dan Villiom Podlaski Christiansen  <danchr@gmail.com>
-help: ReST tweaks
-
-Use a full header for topic titles; make the indent configurable by
-the caller
-
-diff --git a/mercurial/help.py b/mercurial/help.py
---- a/mercurial/help.py
-+++ b/mercurial/help.py
-@@ -389,12 +389,17 @@ def help_(ui, name, unknowncmd=False, fu
-         else:
-             raise error.UnknownCommand(name)
- 
--        rst = ["%s\n\n" % header]
-+        headerstyleline = '=' * encoding.colwidth(header)
-+        rst = ["%s\n%s\n%s\n\n" % (headerstyleline, header, headerstyleline)]
-+
-         # description
-         if not doc:
--            rst.append("    %s\n" % _("(no help text available)"))
-+            doc = _("(no help text available)")
-         if util.safehasattr(doc, '__call__'):
--            rst += ["    %s\n" % l for l in doc().splitlines()]
-+            doc = doc()
-+
-+        indent = ' ' * int(opts.get('indent', 4))
-+        rst += ["%s%s\n" % (indent, l) for l in doc.splitlines()]
- 
-         if not ui.verbose:
-             omitted = (_('use "hg help -v %s" to show more complete help') %
+# HG changeset patch
+# Parent ffb18bf870a9c22158c08f633ad112418e028613
+# User Dan Villiom Podlaski Christiansen  <danchr@gmail.com>
+help: make the indent configurable by the caller
+
+diff --git a/mercurial/help.py b/mercurial/help.py
+--- a/mercurial/help.py
++++ b/mercurial/help.py
+@@ -208,7 +208,7 @@ addtopicsymbols('revsets', '.. predicate
+ addtopicsymbols('templates', '.. keywordsmarker', templatekw.dockeywords)
+ addtopicsymbols('templates', '.. filtersmarker', templatefilters.filters)
+ 
+-def help_(ui, name, unknowncmd=False, full=True, **opts):
++def help_(ui, name, unknowncmd=False, full=True, indent=4, **opts):
+     '''
+     Generate the help for 'name' as unformatted restructured text. If
+     'name' is None, describe the commands available.
+@@ -399,9 +399,11 @@ def help_(ui, name, unknowncmd=False, fu
+ 
+         # description
+         if not doc:
+-            rst.append("    %s\n" % _("(no help text available)"))
++            doc = _("(no help text available)")
+         if util.safehasattr(doc, '__call__'):
+-            rst += ["    %s\n" % l for l in doc().splitlines()]
++            doc = doc()
++
++        rst += ["%s%s\n" % (' ' * indent, l) for l in doc.splitlines()]
+ 
+         if not ui.verbose:
+             omitted = (_('use "hg help -v %s" to show more complete help') %
+@@ -458,7 +460,7 @@ def help_(ui, name, unknowncmd=False, fu
+         doc = gettext(mod.__doc__).splitlines()[0]
+ 
+         rst = listexts(_("'%s' is provided by the following "
+-                              "extension:") % cmd, {ext: doc}, indent=4)
++                              "extension:") % cmd, {ext: doc}, indent=indent)
+         rst.append('\n')
+         rst.append(_('use "hg help extensions" for information on enabling '
+                    'extensions\n'))
+diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
+--- a/mercurial/hgweb/webcommands.py
++++ b/mercurial/hgweb/webcommands.py
+@@ -995,7 +995,7 @@ def help(web, req, tmpl):
+     u.pushbuffer()
+     u.verbose = True
+     try:
+-        doc = helpmod.help_(u, topicname)
++        doc = helpmod.help_(u, topicname, indent=0)
+     except error.UnknownCommand:
+         raise ErrorResponse(HTTP_NOT_FOUND)
+     return tmpl('help', topic=topicname, doc=doc)

hgweb-long-lines.diff

+# HG changeset patch
+# Parent cc491a9d16dc5435f40354a88ee83fe20f9590ba
+# User Dan Villiom Podlaski Christiansen  <danchr@gmail.com>
+hgweb help: split up long lines (in generated output)
+
+diff --git a/mercurial/templates/coal/map b/mercurial/templates/coal/map
+--- a/mercurial/templates/coal/map
++++ b/mercurial/templates/coal/map
+@@ -13,7 +13,14 @@ graph = ../paper/graph.tmpl
+ help = ../paper/help.tmpl
+ helptopics = ../paper/helptopics.tmpl
+ 
+-helpentry = '<tr><td><a href="{url|urlescape}help/{topic|escape}{sessionvars%urlparameter}">{topic|escape}</a></td><td>{summary|escape}</td></tr>'
++helpentry = '
++  <tr><td>
++    <a href="{url|urlescape}help/{topic|escape}{sessionvars%urlparameter}">
++      {topic|escape}
++    </a>
++  </td><td>
++    {summary|escape}
++  </td></tr>'
+ 
+ naventry = '<a href="{url|urlescape}log/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
+ navshortentry = '<a href="{url|urlescape}shortlog/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
+diff --git a/mercurial/templates/gitweb/map b/mercurial/templates/gitweb/map
+--- a/mercurial/templates/gitweb/map
++++ b/mercurial/templates/gitweb/map
+@@ -11,7 +11,14 @@ notfound = notfound.tmpl
+ help = help.tmpl
+ helptopics = helptopics.tmpl
+ 
+-helpentry = '<tr><td><a href="{url|urlescape}help/{topic|escape}{sessionvars%urlparameter}">{topic|escape}</a></td><td>{summary|escape}</td></tr>'
++helpentry = '
++  <tr><td>
++    <a href="{url|urlescape}help/{topic|escape}{sessionvars%urlparameter}">
++      {topic|escape}
++    </a>
++  </td><td>
++    {summary|escape}
++  </td></tr>'
+ 
+ naventry = '<a href="{url|urlescape}log/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
+ navshortentry = '<a href="{url|urlescape}shortlog/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
+diff --git a/mercurial/templates/monoblue/map b/mercurial/templates/monoblue/map
+--- a/mercurial/templates/monoblue/map
++++ b/mercurial/templates/monoblue/map
+@@ -11,7 +11,14 @@ notfound = notfound.tmpl
+ help = help.tmpl
+ helptopics = helptopics.tmpl
+ 
+-helpentry = '<tr><td><a href="{url|urlescape}help/{topic|escape}{sessionvars%urlparameter}">{topic|escape}</a></td><td>{summary|escape}</td></tr>'
++helpentry = '
++  <tr><td>
++    <a href="{url|urlescape}help/{topic|escape}{sessionvars%urlparameter}">
++      {topic|escape}
++    </a>
++  </td><td>
++    {summary|escape}
++  </td></tr>'
+ 
+ naventry = '<a href="{url|urlescape}log/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
+ navshortentry = '<a href="{url|urlescape}shortlog/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
+diff --git a/mercurial/templates/paper/map b/mercurial/templates/paper/map
+--- a/mercurial/templates/paper/map
++++ b/mercurial/templates/paper/map
+@@ -12,7 +12,14 @@ graph = graph.tmpl
+ help = help.tmpl
+ helptopics = helptopics.tmpl
+ 
+-helpentry = '<tr><td><a href="{url|urlescape}help/{topic|escape}{sessionvars%urlparameter}">{topic|escape}</a></td><td>{summary|escape}</td></tr>'
++helpentry = '
++  <tr><td>
++    <a href="{url|urlescape}help/{topic|escape}{sessionvars%urlparameter}">
++      {topic|escape}
++    </a>
++  </td><td>
++    {summary|escape}
++  </td></tr>'
+ 
+ naventry = '<a href="{url|urlescape}log/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
+ navshortentry = '<a href="{url|urlescape}shortlog/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
+diff --git a/tests/test-help.t b/tests/test-help.t
+--- a/tests/test-help.t
++++ b/tests/test-help.t
+@@ -930,13 +930,524 @@ Dish up an empty repo; serve it cold.
+   </form>
+   <table class="bigtable">
+   <tr><td colspan="2"><h2><a name="main" href="#topics">Topics</a></h2></td></tr>
+-  <tr><td><a href="/help/config">config</a></td><td>Configuration Files</td></tr><tr><td><a href="/help/dates">dates</a></td><td>Date Formats</td></tr><tr><td><a href="/help/diffs">diffs</a></td><td>Diff Formats</td></tr><tr><td><a href="/help/environment">environment</a></td><td>Environment Variables</td></tr><tr><td><a href="/help/extensions">extensions</a></td><td>Using Additional Features</td></tr><tr><td><a href="/help/filesets">filesets</a></td><td>Specifying File Sets</td></tr><tr><td><a href="/help/glossary">glossary</a></td><td>Glossary</td></tr><tr><td><a href="/help/hgignore">hgignore</a></td><td>Syntax for Mercurial Ignore Files</td></tr><tr><td><a href="/help/hgweb">hgweb</a></td><td>Configuring hgweb</td></tr><tr><td><a href="/help/merge-tools">merge-tools</a></td><td>Merge Tools</td></tr><tr><td><a href="/help/multirevs">multirevs</a></td><td>Specifying Multiple Revisions</td></tr><tr><td><a href="/help/patterns">patterns</a></td><td>File Name Patterns</td></tr><tr><td><a href="/help/phases">phases</a></td><td>Working with Phases</td></tr><tr><td><a href="/help/revisions">revisions</a></td><td>Specifying Single Revisions</td></tr><tr><td><a href="/help/revsets">revsets</a></td><td>Specifying Revision Sets</td></tr><tr><td><a href="/help/subrepos">subrepos</a></td><td>Subrepositories</td></tr><tr><td><a href="/help/templating">templating</a></td><td>Template Usage</td></tr><tr><td><a href="/help/urls">urls</a></td><td>URL Paths</td></tr><tr><td><a href="/help/topic-containing-verbose">topic-containing-verbose</a></td><td>This is the topic to test omit indicating.</td></tr>
++  
++  <tr><td>
++  <a href="/help/config">
++  config
++  </a>
++  </td><td>
++  Configuration Files
++  </td></tr>
++  <tr><td>
++  <a href="/help/dates">
++  dates
++  </a>
++  </td><td>
++  Date Formats
++  </td></tr>
++  <tr><td>
++  <a href="/help/diffs">
++  diffs
++  </a>
++  </td><td>
++  Diff Formats
++  </td></tr>
++  <tr><td>
++  <a href="/help/environment">
++  environment
++  </a>
++  </td><td>
++  Environment Variables
++  </td></tr>
++  <tr><td>
++  <a href="/help/extensions">
++  extensions
++  </a>
++  </td><td>
++  Using Additional Features
++  </td></tr>
++  <tr><td>
++  <a href="/help/filesets">
++  filesets
++  </a>
++  </td><td>
++  Specifying File Sets
++  </td></tr>
++  <tr><td>
++  <a href="/help/glossary">
++  glossary
++  </a>
++  </td><td>
++  Glossary
++  </td></tr>
++  <tr><td>
++  <a href="/help/hgignore">
++  hgignore
++  </a>
++  </td><td>
++  Syntax for Mercurial Ignore Files
++  </td></tr>
++  <tr><td>
++  <a href="/help/hgweb">
++  hgweb
++  </a>
++  </td><td>
++  Configuring hgweb
++  </td></tr>
++  <tr><td>
++  <a href="/help/merge-tools">
++  merge-tools
++  </a>
++  </td><td>
++  Merge Tools
++  </td></tr>
++  <tr><td>
++  <a href="/help/multirevs">
++  multirevs
++  </a>
++  </td><td>
++  Specifying Multiple Revisions
++  </td></tr>
++  <tr><td>
++  <a href="/help/patterns">
++  patterns
++  </a>
++  </td><td>
++  File Name Patterns
++  </td></tr>
++  <tr><td>
++  <a href="/help/phases">
++  phases
++  </a>
++  </td><td>
++  Working with Phases
++  </td></tr>
++  <tr><td>
++  <a href="/help/revisions">
++  revisions
++  </a>
++  </td><td>
++  Specifying Single Revisions
++  </td></tr>
++  <tr><td>
++  <a href="/help/revsets">
++  revsets
++  </a>
++  </td><td>
++  Specifying Revision Sets
++  </td></tr>
++  <tr><td>
++  <a href="/help/subrepos">
++  subrepos
++  </a>
++  </td><td>
++  Subrepositories
++  </td></tr>
++  <tr><td>
++  <a href="/help/templating">
++  templating
++  </a>
++  </td><td>
++  Template Usage
++  </td></tr>
++  <tr><td>
++  <a href="/help/urls">
++  urls
++  </a>
++  </td><td>
++  URL Paths
++  </td></tr>
++  <tr><td>
++  <a href="/help/topic-containing-verbose">
++  topic-containing-verbose
++  </a>
++  </td><td>
++  This is the topic to test omit indicating.
++  </td></tr>
+   
+   <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
+-  <tr><td><a href="/help/add">add</a></td><td>add the specified files on the next commit</td></tr><tr><td><a href="/help/annotate">annotate</a></td><td>show changeset information by line for each file</td></tr><tr><td><a href="/help/clone">clone</a></td><td>make a copy of an existing repository</td></tr><tr><td><a href="/help/commit">commit</a></td><td>commit the specified files or all outstanding changes</td></tr><tr><td><a href="/help/diff">diff</a></td><td>diff repository (or selected files)</td></tr><tr><td><a href="/help/export">export</a></td><td>dump the header and diffs for one or more changesets</td></tr><tr><td><a href="/help/forget">forget</a></td><td>forget the specified files on the next commit</td></tr><tr><td><a href="/help/init">init</a></td><td>create a new repository in the given directory</td></tr><tr><td><a href="/help/log">log</a></td><td>show revision history of entire repository or files</td></tr><tr><td><a href="/help/merge">merge</a></td><td>merge working directory with another revision</td></tr><tr><td><a href="/help/pull">pull</a></td><td>pull changes from the specified source</td></tr><tr><td><a href="/help/push">push</a></td><td>push changes to the specified destination</td></tr><tr><td><a href="/help/remove">remove</a></td><td>remove the specified files on the next commit</td></tr><tr><td><a href="/help/serve">serve</a></td><td>start stand-alone webserver</td></tr><tr><td><a href="/help/status">status</a></td><td>show changed files in the working directory</td></tr><tr><td><a href="/help/summary">summary</a></td><td>summarize working directory state</td></tr><tr><td><a href="/help/update">update</a></td><td>update working directory (or switch revisions)</td></tr>
++  
++  <tr><td>
++  <a href="/help/add">
++  add
++  </a>
++  </td><td>
++  add the specified files on the next commit
++  </td></tr>
++  <tr><td>
++  <a href="/help/annotate">
++  annotate
++  </a>
++  </td><td>
++  show changeset information by line for each file
++  </td></tr>
++  <tr><td>
++  <a href="/help/clone">
++  clone
++  </a>
++  </td><td>
++  make a copy of an existing repository
++  </td></tr>
++  <tr><td>
++  <a href="/help/commit">
++  commit
++  </a>
++  </td><td>
++  commit the specified files or all outstanding changes
++  </td></tr>
++  <tr><td>
++  <a href="/help/diff">
++  diff
++  </a>
++  </td><td>
++  diff repository (or selected files)
++  </td></tr>
++  <tr><td>
++  <a href="/help/export">
++  export
++  </a>
++  </td><td>
++  dump the header and diffs for one or more changesets
++  </td></tr>
++  <tr><td>
++  <a href="/help/forget">
++  forget
++  </a>
++  </td><td>
++  forget the specified files on the next commit
++  </td></tr>
++  <tr><td>
++  <a href="/help/init">
++  init
++  </a>
++  </td><td>
++  create a new repository in the given directory
++  </td></tr>
++  <tr><td>
++  <a href="/help/log">
++  log
++  </a>
++  </td><td>
++  show revision history of entire repository or files
++  </td></tr>
++  <tr><td>
++  <a href="/help/merge">
++  merge
++  </a>
++  </td><td>
++  merge working directory with another revision
++  </td></tr>
++  <tr><td>
++  <a href="/help/pull">
++  pull
++  </a>
++  </td><td>
++  pull changes from the specified source
++  </td></tr>
++  <tr><td>
++  <a href="/help/push">
++  push
++  </a>
++  </td><td>
++  push changes to the specified destination
++  </td></tr>
++  <tr><td>
++  <a href="/help/remove">
++  remove
++  </a>
++  </td><td>
++  remove the specified files on the next commit
++  </td></tr>
++  <tr><td>
++  <a href="/help/serve">
++  serve
++  </a>
++  </td><td>
++  start stand-alone webserver
++  </td></tr>
++  <tr><td>
++  <a href="/help/status">
++  status
++  </a>
++  </td><td>
++  show changed files in the working directory
++  </td></tr>
++  <tr><td>
++  <a href="/help/summary">
++  summary
++  </a>
++  </td><td>
++  summarize working directory state
++  </td></tr>
++  <tr><td>
++  <a href="/help/update">
++  update
++  </a>
++  </td><td>
++  update working directory (or switch revisions)
++  </td></tr>
+   
+   <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
+-  <tr><td><a href="/help/addremove">addremove</a></td><td>add all new files, delete all missing files</td></tr><tr><td><a href="/help/archive">archive</a></td><td>create an unversioned archive of a repository revision</td></tr><tr><td><a href="/help/backout">backout</a></td><td>reverse effect of earlier changeset</td></tr><tr><td><a href="/help/bisect">bisect</a></td><td>subdivision search of changesets</td></tr><tr><td><a href="/help/bookmarks">bookmarks</a></td><td>track a line of development with movable markers</td></tr><tr><td><a href="/help/branch">branch</a></td><td>set or show the current branch name</td></tr><tr><td><a href="/help/branches">branches</a></td><td>list repository named branches</td></tr><tr><td><a href="/help/bundle">bundle</a></td><td>create a changegroup file</td></tr><tr><td><a href="/help/cat">cat</a></td><td>output the current or given revision of files</td></tr><tr><td><a href="/help/copy">copy</a></td><td>mark files as copied for the next commit</td></tr><tr><td><a href="/help/graft">graft</a></td><td>copy changes from other branches onto the current branch</td></tr><tr><td><a href="/help/grep">grep</a></td><td>search for a pattern in specified files and revisions</td></tr><tr><td><a href="/help/heads">heads</a></td><td>show current repository heads or show branch heads</td></tr><tr><td><a href="/help/help">help</a></td><td>show help for a given topic or a help overview</td></tr><tr><td><a href="/help/identify">identify</a></td><td>identify the working copy or specified revision</td></tr><tr><td><a href="/help/import">import</a></td><td>import an ordered set of patches</td></tr><tr><td><a href="/help/incoming">incoming</a></td><td>show new changesets found in source</td></tr><tr><td><a href="/help/locate">locate</a></td><td>locate files matching specific patterns</td></tr><tr><td><a href="/help/manifest">manifest</a></td><td>output the current or given revision of the project manifest</td></tr><tr><td><a href="/help/nohelp">nohelp</a></td><td>(no help text available)</td></tr><tr><td><a href="/help/outgoing">outgoing</a></td><td>show changesets not found in the destination</td></tr><tr><td><a href="/help/parents">parents</a></td><td>show the parents of the working directory or revision</td></tr><tr><td><a href="/help/paths">paths</a></td><td>show aliases for remote repositories</td></tr><tr><td><a href="/help/phase">phase</a></td><td>set or show the current phase name</td></tr><tr><td><a href="/help/recover">recover</a></td><td>roll back an interrupted transaction</td></tr><tr><td><a href="/help/rename">rename</a></td><td>rename files; equivalent of copy + remove</td></tr><tr><td><a href="/help/resolve">resolve</a></td><td>redo merges or set/view the merge status of files</td></tr><tr><td><a href="/help/revert">revert</a></td><td>restore files to their checkout state</td></tr><tr><td><a href="/help/rollback">rollback</a></td><td>roll back the last transaction (dangerous)</td></tr><tr><td><a href="/help/root">root</a></td><td>print the root (top) of the current working directory</td></tr><tr><td><a href="/help/showconfig">showconfig</a></td><td>show combined config settings from all hgrc files</td></tr><tr><td><a href="/help/tag">tag</a></td><td>add one or more tags for the current or given revision</td></tr><tr><td><a href="/help/tags">tags</a></td><td>list repository tags</td></tr><tr><td><a href="/help/tip">tip</a></td><td>show the tip revision</td></tr><tr><td><a href="/help/unbundle">unbundle</a></td><td>apply one or more changegroup files</td></tr><tr><td><a href="/help/verify">verify</a></td><td>verify the integrity of the repository</td></tr><tr><td><a href="/help/version">version</a></td><td>output version and copyright information</td></tr>
++  
++  <tr><td>
++  <a href="/help/addremove">
++  addremove
++  </a>
++  </td><td>
++  add all new files, delete all missing files
++  </td></tr>
++  <tr><td>
++  <a href="/help/archive">
++  archive
++  </a>
++  </td><td>
++  create an unversioned archive of a repository revision
++  </td></tr>
++  <tr><td>
++  <a href="/help/backout">
++  backout
++  </a>
++  </td><td>
++  reverse effect of earlier changeset
++  </td></tr>
++  <tr><td>
++  <a href="/help/bisect">
++  bisect
++  </a>
++  </td><td>
++  subdivision search of changesets
++  </td></tr>
++  <tr><td>
++  <a href="/help/bookmarks">
++  bookmarks
++  </a>
++  </td><td>
++  track a line of development with movable markers
++  </td></tr>
++  <tr><td>
++  <a href="/help/branch">
++  branch
++  </a>
++  </td><td>
++  set or show the current branch name
++  </td></tr>
++  <tr><td>
++  <a href="/help/branches">
++  branches
++  </a>
++  </td><td>
++  list repository named branches
++  </td></tr>
++  <tr><td>
++  <a href="/help/bundle">
++  bundle
++  </a>
++  </td><td>
++  create a changegroup file
++  </td></tr>
++  <tr><td>
++  <a href="/help/cat">
++  cat
++  </a>
++  </td><td>
++  output the current or given revision of files
++  </td></tr>
++  <tr><td>
++  <a href="/help/copy">
++  copy
++  </a>
++  </td><td>
++  mark files as copied for the next commit
++  </td></tr>
++  <tr><td>
++  <a href="/help/graft">
++  graft
++  </a>
++  </td><td>
++  copy changes from other branches onto the current branch
++  </td></tr>
++  <tr><td>
++  <a href="/help/grep">
++  grep
++  </a>
++  </td><td>
++  search for a pattern in specified files and revisions
++  </td></tr>
++  <tr><td>
++  <a href="/help/heads">
++  heads
++  </a>
++  </td><td>
++  show current repository heads or show branch heads
++  </td></tr>
++  <tr><td>
++  <a href="/help/help">
++  help
++  </a>
++  </td><td>
++  show help for a given topic or a help overview
++  </td></tr>
++  <tr><td>
++  <a href="/help/identify">
++  identify
++  </a>
++  </td><td>
++  identify the working copy or specified revision
++  </td></tr>
++  <tr><td>
++  <a href="/help/import">
++  import
++  </a>
++  </td><td>
++  import an ordered set of patches
++  </td></tr>
++  <tr><td>
++  <a href="/help/incoming">
++  incoming
++  </a>
++  </td><td>
++  show new changesets found in source
++  </td></tr>
++  <tr><td>
++  <a href="/help/locate">
++  locate
++  </a>
++  </td><td>
++  locate files matching specific patterns
++  </td></tr>
++  <tr><td>
++  <a href="/help/manifest">
++  manifest
++  </a>
++  </td><td>
++  output the current or given revision of the project manifest
++  </td></tr>
++  <tr><td>
++  <a href="/help/nohelp">
++  nohelp
++  </a>
++  </td><td>
++  (no help text available)
++  </td></tr>
++  <tr><td>
++  <a href="/help/outgoing">
++  outgoing
++  </a>
++  </td><td>
++  show changesets not found in the destination
++  </td></tr>
++  <tr><td>
++  <a href="/help/parents">
++  parents
++  </a>
++  </td><td>
++  show the parents of the working directory or revision
++  </td></tr>
++  <tr><td>
++  <a href="/help/paths">
++  paths
++  </a>
++  </td><td>
++  show aliases for remote repositories
++  </td></tr>
++  <tr><td>
++  <a href="/help/phase">
++  phase
++  </a>
++  </td><td>
++  set or show the current phase name
++  </td></tr>
++  <tr><td>
++  <a href="/help/recover">
++  recover
++  </a>
++  </td><td>
++  roll back an interrupted transaction
++  </td></tr>
++  <tr><td>
++  <a href="/help/rename">
++  rename
++  </a>
++  </td><td>
++  rename files; equivalent of copy + remove
++  </td></tr>
++  <tr><td>
++  <a href="/help/resolve">
++  resolve
++  </a>
++  </td><td>
++  redo merges or set/view the merge status of files
++  </td></tr>
++  <tr><td>
++  <a href="/help/revert">
++  revert
++  </a>
++  </td><td>
++  restore files to their checkout state
++  </td></tr>
++  <tr><td>
++  <a href="/help/rollback">
++  rollback
++  </a>
++  </td><td>
++  roll back the last transaction (dangerous)
++  </td></tr>
++  <tr><td>
++  <a href="/help/root">
++  root
++  </a>
++  </td><td>
++  print the root (top) of the current working directory
++  </td></tr>
++  <tr><td>
++  <a href="/help/showconfig">
++  showconfig
++  </a>
++  </td><td>
++  show combined config settings from all hgrc files
++  </td></tr>
++  <tr><td>
++  <a href="/help/tag">
++  tag
++  </a>
++  </td><td>
++  add one or more tags for the current or given revision
++  </td></tr>
++  <tr><td>
++  <a href="/help/tags">
++  tags
++  </a>
++  </td><td>
++  list repository tags
++  </td></tr>
++  <tr><td>
++  <a href="/help/tip">
++  tip
++  </a>
++  </td><td>
++  show the tip revision
++  </td></tr>
++  <tr><td>
++  <a href="/help/unbundle">
++  unbundle
++  </a>
++  </td><td>
++  apply one or more changegroup files
++  </td></tr>
++  <tr><td>
++  <a href="/help/verify">
++  verify
++  </a>
++  </td><td>
++  verify the integrity of the repository
++  </td></tr>
++  <tr><td>
++  <a href="/help/version">
++  version
++  </a>
++  </td><td>
++  output version and copyright information
++  </td></tr>
+   </table>
+   </div>
+   </div>

minirst-html.diff

 # HG changeset patch
+# Parent 970a2a1c97fc8c8ff672142607e46f262f9ef412
 # 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
+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:
+@@ -547,7 +547,7 @@ def formathtml(blocks):
                  l = []
                  for v in zip(row):
--                    if not t:
--                        l.append('<th>%s</th>' % v)
--                    else:
--                        l.append('<td>%s</td>' % v)
+                     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))
++                t.append('<tr>%s</tr>\n' % '\n'.join(l))
              out.append('<table>\n%s</table>\n' % ''.join(t))
          elif btype == 'definition':
              openlist('dl', level)
+diff --git a/tests/test-help.t b/tests/test-help.t
+--- a/tests/test-help.t
++++ b/tests/test-help.t
+@@ -1527,10 +1527,18 @@ Dish up an empty repo; serve it cold.
+   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>
++  <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
+@@ -1539,22 +1547,54 @@ Dish up an empty repo; serve it cold.
+   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>
++  <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
+@@ -1639,10 +1679,18 @@ Dish up an empty repo; serve it cold.
+   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>
++  <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
+@@ -1651,22 +1699,54 @@ Dish up an empty repo; serve it cold.
+   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>
++  <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
+@@ -1728,7 +1808,7 @@ Dish up an empty repo; serve it cold.
+   </form>
+   <div id="doc">
+   <table>
+-   <tr><td>Specifying Single Revisions</td></tr>
++  <tr><td>Specifying Single Revisions</td></tr>
+   </table>
+   <p>
+   Mercurial supports several ways to specify individual revisions.
 diff --git a/tests/test-minirst.py.out b/tests/test-minirst.py.out
 --- a/tests/test-minirst.py.out
 +++ b/tests/test-minirst.py.out
  html format:
  ----------------------------------------------------------------------
  <table>
-- <tr><th>a</th><th>b</th><th>c</th></tr>
+- <tr><td>a</td><td>b</td><td>c</td></tr>
 - <tr><td>1</td><td>2</td><td>3</td></tr>
 - <tr><td>foo</td><td>bar</td><td>baz this list is very very very long man</td></tr>
-+ <tr><td>a</td>
++<tr><td>a</td>
 +<td>b</td>
 +<td>c</td></tr>
-+ <tr><td>1</td>
++<tr><td>1</td>
 +<td>2</td>
 +<td>3</td></tr>
-+ <tr><td>foo</td>
++<tr><td>foo</td>
 +<td>bar</td>
 +<td>baz this list is very very very long man</td></tr>
  </table>
+# HG changeset patch
+# Parent 9933e986cfa4d123bd15905aeb3cfd41078023fc
+# User Dan Villiom Podlaski Christiansen  <danchr@gmail.com>
+minirst: don't generate TH elements for the first row in table
+
+We mainly use them for option tables -- browsers bolding and centering
+them looks wrong.
+
+diff --git a/mercurial/minirst.py b/mercurial/minirst.py
+--- a/mercurial/minirst.py
++++ b/mercurial/minirst.py
+@@ -546,10 +546,7 @@ 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)
++                    l.append('<td>%s</td>' % v)
+                 t.append(' <tr>%s</tr>\n' % ''.join(l))
+             out.append('<table>\n%s</table>\n' % ''.join(t))
+         elif btype == 'definition':
+diff --git a/tests/test-help.t b/tests/test-help.t
+--- a/tests/test-help.t
++++ b/tests/test-help.t
+@@ -1527,7 +1527,7 @@ Dish up an empty repo; serve it cold.
+   options:
+   </p>
+   <table>
+-   <tr><th>-I</th><th>--include PATTERN [+]</th><th>include names matching the given patterns</th></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>
+    <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>
+@@ -1539,7 +1539,7 @@ Dish up an empty repo; serve it cold.
+   global options:
+   </p>
+   <table>
+-   <tr><th>-R</th><th>--repository REPO</th><th>repository root directory or name of overlay bundle file</th></tr>
++   <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>
+@@ -1639,7 +1639,7 @@ Dish up an empty repo; serve it cold.
+   options:
+   </p>
+   <table>
+-   <tr><th>-A</th><th>--after</th><th>record delete for missing files</th></tr>
++   <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>
+@@ -1651,7 +1651,7 @@ Dish up an empty repo; serve it cold.
+   global options:
+   </p>
+   <table>
+-   <tr><th>-R</th><th>--repository REPO</th><th>repository root directory or name of overlay bundle file</th></tr>
++   <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>
+@@ -1728,7 +1728,7 @@ Dish up an empty repo; serve it cold.
+   </form>
+   <div id="doc">
+   <table>
+-   <tr><th>Specifying Single Revisions</th></tr>
++   <tr><td>Specifying Single Revisions</td></tr>
+   </table>
+   <p>
+   Mercurial supports several ways to specify individual revisions.
+diff --git a/tests/test-minirst.py.out b/tests/test-minirst.py.out
+--- a/tests/test-minirst.py.out
++++ b/tests/test-minirst.py.out
+@@ -758,7 +758,7 @@ 30 column format:
+ html format:
+ ----------------------------------------------------------------------
+ <table>
+- <tr><th>a</th><th>b</th><th>c</th></tr>
++ <tr><td>a</td><td>b</td><td>c</td></tr>
+  <tr><td>1</td><td>2</td><td>3</td></tr>
+  <tr><td>foo</td><td>bar</td><td>baz this list is very very very long man</td></tr>
+ </table>
 # HG changeset patch
+# Parent dfbcf67a6e05f74e6c21ed3a0cebfd04d3be8f63
 # User Dan Villiom Podlaski Christiansen  <danchr@gmail.com>
 help: move the majority of the help command to the help module
 
+We move the logic for generating the unformatted ReST source to the
+help module, in order to eventually avoid calling commands.help_()
+from hgweb.
+
+No functionality change.
+
 diff --git a/mercurial/commands.py b/mercurial/commands.py
 --- a/mercurial/commands.py
 +++ b/mercurial/commands.py
  
  def listexts(header, exts, indent=1):
      '''return a text listing of the given extensions'''
-@@ -206,3 +207,292 @@ addtopicsymbols('merge-tools', '.. inter
+@@ -206,3 +207,297 @@ addtopicsymbols('merge-tools', '.. inter
  addtopicsymbols('revsets', '.. predicatesmarker', revset.symbols)
  addtopicsymbols('templates', '.. keywordsmarker', templatekw.dockeywords)
  addtopicsymbols('templates', '.. filtersmarker', templatefilters.filters)
 +
 +def help_(ui, name, unknowncmd=False, full=True, **opts):
++    '''
++    Generate the help for 'name' as unformatted restructured text. If
++    'name' is None, describe the commands available.
++    '''
++
 +    import commands # avoid cycle
 +
 +    def helpcmd(name):

optimize-minirst-table.diff

+# HG changeset patch
+# Parent d93eb251b0c4c5c2b4e89ef427fe68bb3e4ebf5f
+# User Dan Villiom Podlaski Christiansen  <danchr@gmail.com>
+minirst: optimize HTML table generation a bit
+
+avoid a couple of array copies and string interpolations
+
+diff --git a/mercurial/minirst.py b/mercurial/minirst.py
+--- a/mercurial/minirst.py
++++ b/mercurial/minirst.py
+@@ -542,13 +542,17 @@ def formathtml(blocks):
+             out.append('<h%d>%s</h%d>\n' % (level, lines[0], level))
+         elif btype == 'table':
+             table = b['table']
+-            t = []
++            out.append('<table>\n')
+             for row in table:
+-                l = []
+-                for v in zip(row):
+-                    l.append('<td>%s</td>' % v)
+-                t.append('<tr>%s</tr>\n' % '\n'.join(l))
+-            out.append('<table>\n%s</table>\n' % ''.join(t))
++                out.append('<tr>')
++                for v in row:
++                    out.append('<td>')
++                    out.append(v)
++                    out.append('</td>')
++                    out.append('\n')
++                out.pop()
++                out.append('</tr>\n')
++            out.append('</table>\n')
+         elif btype == 'definition':
+             openlist('dl', level)
+             term = lines[0]
 # HG changeset patch
+# Parent a7f8009503398b24a2276b524db9410247b9a30b
 # User Dan Villiom Podlaski Christiansen  <danchr@gmail.com>
 hgweb: generate HTML documentation
 
+It's generated from the raw ReST source, as returned from help.help_().
+
 diff --git a/mercurial/help/templates.txt b/mercurial/help/templates.txt
 --- a/mercurial/help/templates.txt
 +++ b/mercurial/help/templates.txt
 diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
 --- a/mercurial/hgweb/webcommands.py
 +++ b/mercurial/hgweb/webcommands.py
-@@ -995,8 +995,7 @@ def help(web, req, tmpl):
-     u.pushbuffer()
+@@ -992,11 +992,9 @@ def help(web, req, tmpl):
+                     othercommands=othercommands, title='Index')
+ 
+     u = webutil.wsgiui()
+-    u.pushbuffer()
      u.verbose = True
      try:
 -        commands.help_(u, topicname)
-+        doc = helpmod.help_(u, topicname, indent=0)
++        doc = helpmod.help_(u, topicname)
      except error.UnknownCommand:
          raise ErrorResponse(HTTP_NOT_FOUND)
 -    doc = u.popbuffer()
  </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.
+diff --git a/tests/test-help.t b/tests/test-help.t
+--- a/tests/test-help.t
++++ b/tests/test-help.t
+@@ -1502,65 +1502,65 @@ 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>
 +  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>
++   <tr><th>-I</th><th>--include PATTERN [+]</th><th>include names matching the given patterns</th></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
 +  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>
++   <tr><th>-R</th><th>--repository REPO</th><th>repository root directory or name of overlay bundle file</th></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
    </div>
    </div>
    
-@@ -164,74 +204,105 @@ Dish up an empty repo; serve it cold.
+@@ -1614,74 +1614,65 @@ 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>
 +  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>
++   <tr><th>-A</th><th>--after</th><th>record delete for missing files</th></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
 +  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>
++   <tr><th>-R</th><th>--repository REPO</th><th>repository root directory or name of overlay bundle file</th></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
    </div>
    </div>
    
-@@ -285,38 +356,50 @@ Dish up an empty repo; serve it cold.
+@@ -1735,38 +1726,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>
+   Specifying Single Revisions
++  </p>
 +  <p>
 +  Mercurial supports several ways to specify individual revisions.
 +  </p>
 test-hgweb-help.diff
+hgweb-long-lines.diff
 move-help.diff
-better-rst.diff
 rstdoc.diff
+topic-titles.diff
+minirst-th.diff
 minirst-html.diff
+help-indent.diff
+optimize-minirst-table.diff
 highlight-docutils.diff
 largefiles-filesets.diff
 commitworkingctx.diff

test-hgweb-help.diff

 # HG changeset patch
+# Parent d8cfe29c6b612fe6e250afdd7219eb4d461b9e3e
 # User Dan Villiom Podlaski Christiansen  <danchr@gmail.com>
-hgweb: test help functionality
+hgweb help: add tests
 
-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
-@@ -13,7 +13,14 @@ graph = ../paper/graph.tmpl
- help = ../paper/help.tmpl
- helptopics = ../paper/helptopics.tmpl
+diff --git a/tests/test-help.t b/tests/test-help.t
+--- a/tests/test-help.t
++++ b/tests/test-help.t
+@@ -876,3 +876,396 @@ Test usage of section marks in help docu
  
--helpentry = '<tr><td><a href="{url|urlescape}help/{topic|escape}{sessionvars%urlparameter}">{topic|escape}</a></td><td>{summary|escape}</td></tr>'
-+helpentry = '
-+  <tr><td>
-+    <a href="{url|urlescape}help/{topic|escape}{sessionvars%urlparameter}">
-+      {topic|escape}
-+    </a>
-+  </td><td>
-+    {summary|escape}
-+  </td></tr>'
- 
- naventry = '<a href="{url|urlescape}log/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
- navshortentry = '<a href="{url|urlescape}shortlog/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
-diff --git a/mercurial/templates/gitweb/map b/mercurial/templates/gitweb/map
---- a/mercurial/templates/gitweb/map
-+++ b/mercurial/templates/gitweb/map
-@@ -11,7 +11,14 @@ notfound = notfound.tmpl
- help = help.tmpl
- helptopics = helptopics.tmpl
- 
--helpentry = '<tr><td><a href="{url|urlescape}help/{topic|escape}{sessionvars%urlparameter}">{topic|escape}</a></td><td>{summary|escape}</td></tr>'
-+helpentry = '
-+  <tr><td>
-+    <a href="{url|urlescape}help/{topic|escape}{sessionvars%urlparameter}">
-+      {topic|escape}
-+    </a>
-+  </td><td>
-+    {summary|escape}
-+  </td></tr>'
- 
- naventry = '<a href="{url|urlescape}log/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
- navshortentry = '<a href="{url|urlescape}shortlog/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
-diff --git a/mercurial/templates/monoblue/map b/mercurial/templates/monoblue/map
---- a/mercurial/templates/monoblue/map
-+++ b/mercurial/templates/monoblue/map
-@@ -11,7 +11,14 @@ notfound = notfound.tmpl
- help = help.tmpl
- helptopics = helptopics.tmpl
- 
--helpentry = '<tr><td><a href="{url|urlescape}help/{topic|escape}{sessionvars%urlparameter}">{topic|escape}</a></td><td>{summary|escape}</td></tr>'
-+helpentry = '
-+  <tr><td>
-+    <a href="{url|urlescape}help/{topic|escape}{sessionvars%urlparameter}">
-+      {topic|escape}
-+    </a>
-+  </td><td>
-+    {summary|escape}
-+  </td></tr>'
- 
- naventry = '<a href="{url|urlescape}log/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
- navshortentry = '<a href="{url|urlescape}shortlog/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
-diff --git a/mercurial/templates/paper/map b/mercurial/templates/paper/map
---- a/mercurial/templates/paper/map
-+++ b/mercurial/templates/paper/map
-@@ -12,7 +12,14 @@ graph = graph.tmpl
- help = help.tmpl
- helptopics = helptopics.tmpl
- 
--helpentry = '<tr><td><a href="{url|urlescape}help/{topic|escape}{sessionvars%urlparameter}">{topic|escape}</a></td><td>{summary|escape}</td></tr>'
-+helpentry = '
-+  <tr><td>
-+    <a href="{url|urlescape}help/{topic|escape}{sessionvars%urlparameter}">
-+      {topic|escape}
-+    </a>
-+  </td><td>
-+    {summary|escape}
-+  </td></tr>'
- 
- naventry = '<a href="{url|urlescape}log/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
- navshortentry = '<a href="{url|urlescape}shortlog/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
-diff --git a/tests/test-hgweb-help.t b/tests/test-hgweb-help.t
-new file mode 100644
---- /dev/null
-+++ b/tests/test-hgweb-help.t
-@@ -0,0 +1,330 @@
-+  $ "$TESTDIR/hghave" serve || exit 80
+   $ cd "$TESTDIR"/../doc
+   $ python check-seclevel.py
++
++#if serve
 +
 +Test the help pages in hgweb.
 +
 +Dish up an empty repo; serve it cold.
 +
-+  $ hg init test
-+  $ cd test
-+  $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid
++  $ hg init "$TESTTMP/test"
++  $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
 +  $ cat hg.pid >> $DAEMON_PIDS
 +
++  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "help"
++  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: Index</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">help</li>
++  </ul>
++  </div>
++  
++  <div class="main">
++  <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
++  <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>
++  <table class="bigtable">
++  <tr><td colspan="2"><h2><a name="main" href="#topics">Topics</a></h2></td></tr>
++  <tr><td><a href="/help/config">config</a></td><td>Configuration Files</td></tr><tr><td><a href="/help/dates">dates</a></td><td>Date Formats</td></tr><tr><td><a href="/help/diffs">diffs</a></td><td>Diff Formats</td></tr><tr><td><a href="/help/environment">environment</a></td><td>Environment Variables</td></tr><tr><td><a href="/help/extensions">extensions</a></td><td>Using Additional Features</td></tr><tr><td><a href="/help/filesets">filesets</a></td><td>Specifying File Sets</td></tr><tr><td><a href="/help/glossary">glossary</a></td><td>Glossary</td></tr><tr><td><a href="/help/hgignore">hgignore</a></td><td>Syntax for Mercurial Ignore Files</td></tr><tr><td><a href="/help/hgweb">hgweb</a></td><td>Configuring hgweb</td></tr><tr><td><a href="/help/merge-tools">merge-tools</a></td><td>Merge Tools</td></tr><tr><td><a href="/help/multirevs">multirevs</a></td><td>Specifying Multiple Revisions</td></tr><tr><td><a href="/help/patterns">patterns</a></td><td>File Name Patterns</td></tr><tr><td><a href="/help/phases">phases</a></td><td>Working with Phases</td></tr><tr><td><a href="/help/revisions">revisions</a></td><td>Specifying Single Revisions</td></tr><tr><td><a href="/help/revsets">revsets</a></td><td>Specifying Revision Sets</td></tr><tr><td><a href="/help/subrepos">subrepos</a></td><td>Subrepositories</td></tr><tr><td><a href="/help/templating">templating</a></td><td>Template Usage</td></tr><tr><td><a href="/help/urls">urls</a></td><td>URL Paths</td></tr><tr><td><a href="/help/topic-containing-verbose">topic-containing-verbose</a></td><td>This is the topic to test omit indicating.</td></tr>
++  
++  <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
++  <tr><td><a href="/help/add">add</a></td><td>add the specified files on the next commit</td></tr><tr><td><a href="/help/annotate">annotate</a></td><td>show changeset information by line for each file</td></tr><tr><td><a href="/help/clone">clone</a></td><td>make a copy of an existing repository</td></tr><tr><td><a href="/help/commit">commit</a></td><td>commit the specified files or all outstanding changes</td></tr><tr><td><a href="/help/diff">diff</a></td><td>diff repository (or selected files)</td></tr><tr><td><a href="/help/export">export</a></td><td>dump the header and diffs for one or more changesets</td></tr><tr><td><a href="/help/forget">forget</a></td><td>forget the specified files on the next commit</td></tr><tr><td><a href="/help/init">init</a></td><td>create a new repository in the given directory</td></tr><tr><td><a href="/help/log">log</a></td><td>show revision history of entire repository or files</td></tr><tr><td><a href="/help/merge">merge</a></td><td>merge working directory with another revision</td></tr><tr><td><a href="/help/pull">pull</a></td><td>pull changes from the specified source</td></tr><tr><td><a href="/help/push">push</a></td><td>push changes to the specified destination</td></tr><tr><td><a href="/help/remove">remove</a></td><td>remove the specified files on the next commit</td></tr><tr><td><a href="/help/serve">serve</a></td><td>start stand-alone webserver</td></tr><tr><td><a href="/help/status">status</a></td><td>show changed files in the working directory</td></tr><tr><td><a href="/help/summary">summary</a></td><td>summarize working directory state</td></tr><tr><td><a href="/help/update">update</a></td><td>update working directory (or switch revisions)</td></tr>
++  
++  <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
++  <tr><td><a href="/help/addremove">addremove</a></td><td>add all new files, delete all missing files</td></tr><tr><td><a href="/help/archive">archive</a></td><td>create an unversioned archive of a repository revision</td></tr><tr><td><a href="/help/backout">backout</a></td><td>reverse effect of earlier changeset</td></tr><tr><td><a href="/help/bisect">bisect</a></td><td>subdivision search of changesets</td></tr><tr><td><a href="/help/bookmarks">bookmarks</a></td><td>track a line of development with movable markers</td></tr><tr><td><a href="/help/branch">branch</a></td><td>set or show the current branch name</td></tr><tr><td><a href="/help/branches">branches</a></td><td>list repository named branches</td></tr><tr><td><a href="/help/bundle">bundle</a></td><td>create a changegroup file</td></tr><tr><td><a href="/help/cat">cat</a></td><td>output the current or given revision of files</td></tr><tr><td><a href="/help/copy">copy</a></td><td>mark files as copied for the next commit</td></tr><tr><td><a href="/help/graft">graft</a></td><td>copy changes from other branches onto the current branch</td></tr><tr><td><a href="/help/grep">grep</a></td><td>search for a pattern in specified files and revisions</td></tr><tr><td><a href="/help/heads">heads</a></td><td>show current repository heads or show branch heads</td></tr><tr><td><a href="/help/help">help</a></td><td>show help for a given topic or a help overview</td></tr><tr><td><a href="/help/identify">identify</a></td><td>identify the working copy or specified revision</td></tr><tr><td><a href="/help/import">import</a></td><td>import an ordered set of patches</td></tr><tr><td><a href="/help/incoming">incoming</a></td><td>show new changesets found in source</td></tr><tr><td><a href="/help/locate">locate</a></td><td>locate files matching specific patterns</td></tr><tr><td><a href="/help/manifest">manifest</a></td><td>output the current or given revision of the project manifest</td></tr><tr><td><a href="/help/nohelp">nohelp</a></td><td>(no help text available)</td></tr><tr><td><a href="/help/outgoing">outgoing</a></td><td>show changesets not found in the destination</td></tr><tr><td><a href="/help/parents">parents</a></td><td>show the parents of the working directory or revision</td></tr><tr><td><a href="/help/paths">paths</a></td><td>show aliases for remote repositories</td></tr><tr><td><a href="/help/phase">phase</a></td><td>set or show the current phase name</td></tr><tr><td><a href="/help/recover">recover</a></td><td>roll back an interrupted transaction</td></tr><tr><td><a href="/help/rename">rename</a></td><td>rename files; equivalent of copy + remove</td></tr><tr><td><a href="/help/resolve">resolve</a></td><td>redo merges or set/view the merge status of files</td></tr><tr><td><a href="/help/revert">revert</a></td><td>restore files to their checkout state</td></tr><tr><td><a href="/help/rollback">rollback</a></td><td>roll back the last transaction (dangerous)</td></tr><tr><td><a href="/help/root">root</a></td><td>print the root (top) of the current working directory</td></tr><tr><td><a href="/help/showconfig">showconfig</a></td><td>show combined config settings from all hgrc files</td></tr><tr><td><a href="/help/tag">tag</a></td><td>add one or more tags for the current or given revision</td></tr><tr><td><a href="/help/tags">tags</a></td><td>list repository tags</td></tr><tr><td><a href="/help/tip">tip</a></td><td>show the tip revision</td></tr><tr><td><a href="/help/unbundle">unbundle</a></td><td>apply one or more changegroup files</td></tr><tr><td><a href="/help/verify">verify</a></td><td>verify the integrity of the repository</td></tr><tr><td><a href="/help/version">version</a></td><td>output version and copyright information</td></tr>
++  </table>
++  </div>
++  </div>
++  
++  <script type="text/javascript">process_dates()</script>
++  
++  
++  </body>
++  </html>
++  
++
 +  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "help/add"
 +  200 Script output follows
 +  
 +  
 +
 +  $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
++
++#endif

topic-titles.diff

+# HG changeset patch
+# Parent 18519ed1c3d7bba3c1e523e7bf6e044fdf3f7b52
+# User Dan Villiom Podlaski Christiansen  <danchr@gmail.com>
+help: use a full header for topic titles
+
+diff --git a/mercurial/help.py b/mercurial/help.py
+--- a/mercurial/help.py
++++ b/mercurial/help.py
+@@ -394,7 +394,9 @@ def help_(ui, name, unknowncmd=False, fu
+         else:
+             raise error.UnknownCommand(name)
+ 
+-        rst = ["%s\n\n" % header]
++        headerstyleline = '=' * encoding.colwidth(header)
++        rst = ["%s\n%s\n%s\n\n" % (headerstyleline, header, headerstyleline)]
++
+         # description
+         if not doc:
+             rst.append("    %s\n" % _("(no help text available)"))
+diff --git a/tests/test-help.t b/tests/test-help.t
+--- a/tests/test-help.t
++++ b/tests/test-help.t
+@@ -1727,9 +1727,9 @@ Dish up an empty repo; serve it cold.
+   files, or words in the commit message</div>
+   </form>
+   <div id="doc">
+-  <p>
+-  Specifying Single Revisions
+-  </p>
++  <table>
++   <tr><th>Specifying Single Revisions</th></tr>
++  </table>
+   <p>
+   Mercurial supports several ways to specify individual revisions.
+   </p>