[PATCH 04 of 22 hgweb-help] help.hgweb: add a section describing URLs and common parameters

Gregory Szorc gregory.szorc at gmail.com
Sat Feb 7 01:15:42 CST 2015


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1423292927 28800
#      Fri Feb 06 23:08:47 2015 -0800
# Node ID f47fcc745ca8295cd06a3705089452073c3a2877
# Parent  186cd0c34a7ae2c02a608445aaaa95e92f224ada
help.hgweb: add a section describing URLs and common parameters

The behavior of hgweb's URLs isn't documented anywhere inside Mercurial.
Let's start to change that.

diff --git a/mercurial/help/hgweb.txt b/mercurial/help/hgweb.txt
--- a/mercurial/help/hgweb.txt
+++ b/mercurial/help/hgweb.txt
@@ -47,4 +47,43 @@ In this example::
   and ``http://server/user/bob/quux/testsubrepo/``
 
 The ``collections`` section is deprecated and has been superseded by
 ``paths``.
+<<<<<<< local
+||||||| base
+
+Web Commands / URLs
+===================
+
+The following web commands / URL handlers are registered:
+
+  .. webcommandsmarker
+=======
+
+URLs and Common Arguments
+=========================
+
+URLs under each repository have the form ``/{command}[/{arguments}]``
+where ``{command}`` represents the name of a command or handler and
+``{arguments}`` represents any number of additional URL parameters
+to that command.
+
+The web server has a default style associated with it. Styles map to
+a collection of named templates. Each template is used to render a
+specific piece of data, such as a changeset or diff.
+
+The style for the current request can be overwritten two ways. First,
+if ``{command}`` contains a hyphen (``-``), the text before the hyphen
+defines the style. For example, ``/atom-log`` will render the ``log``
+command handler with the ``atom`` style. The second way to set the
+style is with the ``style`` query string argument. For example,
+``/log?style=atom``. The hyphenated URL parameter is preferred.
+
+Not all templates are available for all styles. Attempting to use
+a style that doesn't have all templates defined may result in an error
+rendering the page.
+
+Many commands take a ``{revision}`` URL parameter. This defines the
+changeset to operate on. This is commonly specified as the short,
+12 digit hexidecimal abbreviation for the full 40 character unique
+revision identifier. However, any value described by
+:hg:`help revisions` typically works.


More information about the Mercurial-devel mailing list