changeset 24080:a3f2ea1d4943

help: add web commands to help documentation The capabilities and URL endpoints of the hgweb server can currently only be inferred by looking at links in `hg serve` output or by reading the source code. I've frequently found myself wanting to quickly see what URLs and capabilities are available. This patch teaches the help system how to display information about web commands and their URLs. Using a mechanism similar to revsets, templates, etc, we can now iterate over the docstrings of registered web command functions and display them in the help output. Unfortunately, web commands don't currently have docstrings, so the output is currently empty. This will be addressed in the following patches. I apologize for the patch bomb.
author Gregory Szorc <gregory.szorc@gmail.com>
date Fri, 06 Feb 2015 20:27:56 -0800
parents afe03a616525
children ff42de48193c
files mercurial/help.py mercurial/help/hgweb.txt
diffstat 2 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/help.py	Fri Feb 06 23:08:47 2015 -0800
+++ b/mercurial/help.py	Fri Feb 06 20:27:56 2015 -0800
@@ -11,6 +11,7 @@
 import extensions, revset, fileset, templatekw, templatefilters, filemerge
 import encoding, util, minirst
 import cmdutil
+import hgweb.webcommands as webcommands
 
 def listexts(header, exts, indent=1, showdeprecated=False):
     '''return a text listing of the given extensions'''
@@ -202,6 +203,7 @@
 addtopicsymbols('revsets', '.. predicatesmarker', revset.symbols)
 addtopicsymbols('templates', '.. keywordsmarker', templatekw.dockeywords)
 addtopicsymbols('templates', '.. filtersmarker', templatefilters.filters)
+addtopicsymbols('hgweb', '.. webcommandsmarker', webcommands.commands)
 
 def help_(ui, name, unknowncmd=False, full=True, **opts):
     '''
--- a/mercurial/help/hgweb.txt	Fri Feb 06 23:08:47 2015 -0800
+++ b/mercurial/help/hgweb.txt	Fri Feb 06 20:27:56 2015 -0800
@@ -77,3 +77,10 @@
 12 digit hexidecimal abbreviation for the full 40 character unique
 revision identifier. However, any value described by
 :hg:`help revisions` typically works.
+
+Commands and URLs
+=================
+
+The following web commands and their URLs are available:
+
+  .. webcommandsmarker