changeset 24079:afe03a616525

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.
author Gregory Szorc <gregory.szorc@gmail.com>
date Fri, 06 Feb 2015 23:08:47 -0800
parents e44586d9c207
children a3f2ea1d4943
files mercurial/help/hgweb.txt
diffstat 1 files changed, 29 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/help/hgweb.txt	Fri Feb 06 22:47:48 2015 -0800
+++ b/mercurial/help/hgweb.txt	Fri Feb 06 23:08:47 2015 -0800
@@ -48,3 +48,32 @@
 
 The ``collections`` section is deprecated and has been superseded by
 ``paths``.
+
+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.