| 1 |
<?xml version="1.0" encoding="utf-8"?> |
| 2 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 3 |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| 4 |
<head> |
| 5 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| 6 |
<meta name="generator" content="Docutils 0.21.2: https://docutils.sourceforge.io/" /> |
| 7 |
<title>Configuring hgweb</title> |
| 8 |
<link rel="stylesheet" href="../style.css" type="text/css" /> |
| 9 |
</head> |
| 10 |
<body> |
| 11 |
<div class="document" id="configuring-hgweb"> |
| 12 |
<span id="topic-hgweb"></span> |
| 13 |
<h1 class="title">Configuring hgweb</h1> |
| 14 |
|
| 15 |
<div class="contents htmlonly topic" id="contents"> |
| 16 |
<p class="topic-title"><a class="reference internal" href="#top">Contents</a></p> |
| 17 |
<ul class="simple"> |
| 18 |
<li><a class="reference internal" href="#urls-and-common-arguments" id="toc-entry-1">URLs and Common Arguments</a></li> |
| 19 |
<li><a class="reference internal" href="#commands-and-urls" id="toc-entry-2">Commands and URLs</a><ul> |
| 20 |
<li><a class="reference internal" href="#annotate-revision-path" id="toc-entry-3">/annotate/{revision}/{path}</a></li> |
| 21 |
<li><a class="reference internal" href="#archive-revision-format-path" id="toc-entry-4">/archive/{revision}.{format}[/{path}]</a></li> |
| 22 |
<li><a class="reference internal" href="#bookmarks" id="toc-entry-5">/bookmarks</a></li> |
| 23 |
<li><a class="reference internal" href="#branches" id="toc-entry-6">/branches</a></li> |
| 24 |
<li><a class="reference internal" href="#changelog-revision" id="toc-entry-7">/changelog[/{revision}]</a></li> |
| 25 |
<li><a class="reference internal" href="#changeset-revision" id="toc-entry-8">/changeset[/{revision}]</a></li> |
| 26 |
<li><a class="reference internal" href="#comparison-revision-path" id="toc-entry-9">/comparison/{revision}/{path}</a></li> |
| 27 |
<li><a class="reference internal" href="#diff-revision-path" id="toc-entry-10">/diff/{revision}/{path}</a></li> |
| 28 |
<li><a class="reference internal" href="#file-revision-path" id="toc-entry-11">/file/{revision}[/{path}]</a></li> |
| 29 |
<li><a class="reference internal" href="#diff-revision-path-1" id="toc-entry-12">/diff/{revision}/{path}</a></li> |
| 30 |
<li><a class="reference internal" href="#filelog-revision-path" id="toc-entry-13">/filelog/{revision}/{path}</a></li> |
| 31 |
<li><a class="reference internal" href="#graph-revision" id="toc-entry-14">/graph[/{revision}]</a></li> |
| 32 |
<li><a class="reference internal" href="#help-topic" id="toc-entry-15">/help[/{topic}]</a></li> |
| 33 |
<li><a class="reference internal" href="#log-revision-path" id="toc-entry-16">/log[/{revision}[/{path}]]</a></li> |
| 34 |
<li><a class="reference internal" href="#manifest-revision-path" id="toc-entry-17">/manifest[/{revision}[/{path}]]</a></li> |
| 35 |
<li><a class="reference internal" href="#changeset-revision-1" id="toc-entry-18">/changeset[/{revision}]</a></li> |
| 36 |
<li><a class="reference internal" href="#shortlog" id="toc-entry-19">/shortlog</a></li> |
| 37 |
<li><a class="reference internal" href="#summary" id="toc-entry-20">/summary</a></li> |
| 38 |
<li><a class="reference internal" href="#tags" id="toc-entry-21">/tags</a></li> |
| 39 |
</ul> |
| 40 |
</li> |
| 41 |
</ul> |
| 42 |
</div> |
| 43 |
<p id="hgweb">Mercurial's internal web server, hgweb, can serve either a single |
| 44 |
repository, or a tree of repositories. In the second case, repository |
| 45 |
paths and global options can be defined using a dedicated |
| 46 |
configuration file common to <a class="reference external" href="hg-serve.html"><tt class="docutils literal">hg serve</tt></a>, <tt class="docutils literal">hgweb.wsgi</tt>, |
| 47 |
<tt class="docutils literal">hgweb.cgi</tt> and <tt class="docutils literal">hgweb.fcgi</tt>.</p> |
| 48 |
<p>This file uses the same syntax as other Mercurial configuration files |
| 49 |
but recognizes only the following sections:</p> |
| 50 |
<blockquote> |
| 51 |
<ul class="simple"> |
| 52 |
<li>web</li> |
| 53 |
<li>paths</li> |
| 54 |
<li>collections</li> |
| 55 |
</ul> |
| 56 |
</blockquote> |
| 57 |
<p>The <tt class="docutils literal">web</tt> options are thoroughly described in <a class="reference external" href="hgrc.5.html"><tt class="docutils literal">hg help config</tt></a>.</p> |
| 58 |
<p>The <tt class="docutils literal">paths</tt> section maps URL paths to paths of repositories in the |
| 59 |
filesystem. hgweb will not expose the filesystem directly - only |
| 60 |
Mercurial repositories can be published and only according to the |
| 61 |
configuration.</p> |
| 62 |
<p>The left hand side is the path in the URL. Note that hgweb reserves |
| 63 |
subpaths like <tt class="docutils literal">rev</tt> or <tt class="docutils literal">file</tt>, try using different names for |
| 64 |
nested repositories to avoid confusing effects.</p> |
| 65 |
<p>The right hand side is the path in the filesystem. If the specified |
| 66 |
path ends with <tt class="docutils literal">*</tt> or <tt class="docutils literal">**</tt> the filesystem will be searched |
| 67 |
recursively for repositories below that point. |
| 68 |
With <tt class="docutils literal">*</tt> it will not recurse into the repositories it finds (except for |
| 69 |
<tt class="docutils literal">.hg/patches</tt>). |
| 70 |
With <tt class="docutils literal">**</tt> it will also search inside repository working directories |
| 71 |
and possibly find subrepositories.</p> |
| 72 |
<p>In this example:</p> |
| 73 |
<pre class="literal-block"> |
| 74 |
[paths] |
| 75 |
/projects/a = /srv/tmprepos/a |
| 76 |
/projects/b = c:/repos/b |
| 77 |
/ = /srv/repos/* |
| 78 |
/user/bob = /home/bob/repos/** |
| 79 |
</pre> |
| 80 |
<ul class="simple"> |
| 81 |
<li>The first two entries make two repositories in different directories |
| 82 |
appear under the same directory in the web interface</li> |
| 83 |
<li>The third entry will publish every Mercurial repository found in |
| 84 |
<tt class="docutils literal">/srv/repos/</tt>, for instance the repository <tt class="docutils literal">/srv/repos/quux/</tt> |
| 85 |
will appear as <tt class="docutils literal"><span class="pre">http://server/quux/</span></tt></li> |
| 86 |
<li>The fourth entry will publish both <tt class="docutils literal"><span class="pre">http://server/user/bob/quux/</span></tt> |
| 87 |
and <tt class="docutils literal"><span class="pre">http://server/user/bob/quux/testsubrepo/</span></tt></li> |
| 88 |
</ul> |
| 89 |
<p>The <tt class="docutils literal">collections</tt> section is deprecated and has been superseded by |
| 90 |
<tt class="docutils literal">paths</tt>.</p> |
| 91 |
<div class="section" id="urls-and-common-arguments"> |
| 92 |
<h1><a class="toc-backref" href="#contents">URLs and Common Arguments</a></h1> |
| 93 |
<p>URLs under each repository have the form <tt class="docutils literal"><span class="pre">/{command}[/{arguments}]</span></tt> |
| 94 |
where <tt class="docutils literal">{command}</tt> represents the name of a command or handler and |
| 95 |
<tt class="docutils literal">{arguments}</tt> represents any number of additional URL parameters |
| 96 |
to that command.</p> |
| 97 |
<p>The web server has a default style associated with it. Styles map to |
| 98 |
a collection of named templates. Each template is used to render a |
| 99 |
specific piece of data, such as a changeset or diff.</p> |
| 100 |
<p>The style for the current request can be overridden two ways. First, |
| 101 |
if <tt class="docutils literal">{command}</tt> contains a hyphen (<tt class="docutils literal">-</tt>), the text before the hyphen |
| 102 |
defines the style. For example, <tt class="docutils literal"><span class="pre">/atom-log</span></tt> will render the <tt class="docutils literal">log</tt> |
| 103 |
command handler with the <tt class="docutils literal">atom</tt> style. The second way to set the |
| 104 |
style is with the <tt class="docutils literal">style</tt> query string argument. For example, |
| 105 |
<tt class="docutils literal"><span class="pre">/log?style=atom</span></tt>. The hyphenated URL parameter is preferred.</p> |
| 106 |
<p>Not all templates are available for all styles. Attempting to use |
| 107 |
a style that doesn't have all templates defined may result in an error |
| 108 |
rendering the page.</p> |
| 109 |
<p>Many commands take a <tt class="docutils literal">{revision}</tt> URL parameter. This defines the |
| 110 |
changeset to operate on. This is commonly specified as the short, |
| 111 |
12 digit hexadecimal abbreviation for the full 40 character unique |
| 112 |
revision identifier. However, any value described by |
| 113 |
<a class="reference external" href="topic-revisions.html"><tt class="docutils literal">hg help revisions</tt></a> typically works.</p> |
| 114 |
</div> |
| 115 |
<div class="section" id="commands-and-urls"> |
| 116 |
<h1><a class="toc-backref" href="#contents">Commands and URLs</a></h1> |
| 117 |
<p>The following web commands and their URLs are available:</p> |
| 118 |
<div class="section" id="annotate-revision-path"> |
| 119 |
<h2><a class="toc-backref" href="#contents">/annotate/{revision}/{path}</a></h2> |
| 120 |
<p>Show changeset information for each line in a file.</p> |
| 121 |
<p>The <tt class="docutils literal">ignorews</tt>, <tt class="docutils literal">ignorewsamount</tt>, <tt class="docutils literal">ignorewseol</tt>, and |
| 122 |
<tt class="docutils literal">ignoreblanklines</tt> query string arguments have the same meaning as |
| 123 |
their <tt class="docutils literal">[annotate]</tt> config equivalents. It uses the hgrc boolean |
| 124 |
parsing logic to interpret the value. e.g. <tt class="docutils literal">0</tt> and <tt class="docutils literal">false</tt> are |
| 125 |
false and <tt class="docutils literal">1</tt> and <tt class="docutils literal">true</tt> are true. If not defined, the server |
| 126 |
default settings are used.</p> |
| 127 |
<p>The <tt class="docutils literal">fileannotate</tt> template is rendered.</p> |
| 128 |
</div> |
| 129 |
<div class="section" id="archive-revision-format-path"> |
| 130 |
<h2><a class="toc-backref" href="#contents">/archive/{revision}.{format}[/{path}]</a></h2> |
| 131 |
<p>Obtain an archive of repository content.</p> |
| 132 |
<p>The content and type of the archive is defined by a URL path parameter. |
| 133 |
<tt class="docutils literal">format</tt> is the file extension of the archive type to be generated. e.g. |
| 134 |
<tt class="docutils literal">zip</tt> or <tt class="docutils literal">tar.bz2</tt>. Not all archive types may be allowed by your |
| 135 |
server configuration.</p> |
| 136 |
<p>The optional <tt class="docutils literal">path</tt> URL parameter controls content to include in the |
| 137 |
archive. If omitted, every file in the specified revision is present in the |
| 138 |
archive. If included, only the specified file or contents of the specified |
| 139 |
directory will be included in the archive.</p> |
| 140 |
<p>No template is used for this handler. Raw, binary content is generated.</p> |
| 141 |
</div> |
| 142 |
<div class="section" id="bookmarks"> |
| 143 |
<h2><a class="toc-backref" href="#contents">/bookmarks</a></h2> |
| 144 |
<p>Show information about bookmarks.</p> |
| 145 |
<p>No arguments are accepted.</p> |
| 146 |
<p>The <tt class="docutils literal">bookmarks</tt> template is rendered.</p> |
| 147 |
</div> |
| 148 |
<div class="section" id="branches"> |
| 149 |
<h2><a class="toc-backref" href="#contents">/branches</a></h2> |
| 150 |
<p>Show information about branches.</p> |
| 151 |
<p>All known branches are contained in the output, even closed branches.</p> |
| 152 |
<p>No arguments are accepted.</p> |
| 153 |
<p>The <tt class="docutils literal">branches</tt> template is rendered.</p> |
| 154 |
</div> |
| 155 |
<div class="section" id="changelog-revision"> |
| 156 |
<h2><a class="toc-backref" href="#contents">/changelog[/{revision}]</a></h2> |
| 157 |
<p>Show information about multiple changesets.</p> |
| 158 |
<p>If the optional <tt class="docutils literal">revision</tt> URL argument is absent, information about |
| 159 |
all changesets starting at <tt class="docutils literal">tip</tt> will be rendered. If the <tt class="docutils literal">revision</tt> |
| 160 |
argument is present, changesets will be shown starting from the specified |
| 161 |
revision.</p> |
| 162 |
<p>If <tt class="docutils literal">revision</tt> is absent, the <tt class="docutils literal">rev</tt> query string argument may be |
| 163 |
defined. This will perform a search for changesets.</p> |
| 164 |
<p>The argument for <tt class="docutils literal">rev</tt> can be a single revision, a revision set, |
| 165 |
or a literal keyword to search for in changeset data (equivalent to |
| 166 |
<a class="reference external" href="hg-log.html"><tt class="docutils literal">hg log <span class="pre">-k</span></tt></a>).</p> |
| 167 |
<p>The <tt class="docutils literal">revcount</tt> query string argument defines the maximum numbers of |
| 168 |
changesets to render.</p> |
| 169 |
<p>For non-searches, the <tt class="docutils literal">changelog</tt> template will be rendered.</p> |
| 170 |
</div> |
| 171 |
<div class="section" id="changeset-revision"> |
| 172 |
<h2><a class="toc-backref" href="#contents">/changeset[/{revision}]</a></h2> |
| 173 |
<p>Show information about a single changeset.</p> |
| 174 |
<p>A URL path argument is the changeset identifier to show. See <tt class="docutils literal">hg help |
| 175 |
revisions</tt> for possible values. If not defined, the <tt class="docutils literal">tip</tt> changeset |
| 176 |
will be shown.</p> |
| 177 |
<p>The <tt class="docutils literal">changeset</tt> template is rendered. Contents of the <tt class="docutils literal">changesettag</tt>, |
| 178 |
<tt class="docutils literal">changesetbookmark</tt>, <tt class="docutils literal">filenodelink</tt>, <tt class="docutils literal">filenolink</tt>, and the many |
| 179 |
templates related to diffs may all be used to produce the output.</p> |
| 180 |
</div> |
| 181 |
<div class="section" id="comparison-revision-path"> |
| 182 |
<h2><a class="toc-backref" href="#contents">/comparison/{revision}/{path}</a></h2> |
| 183 |
<p>Show a comparison between the old and new versions of a file from changes |
| 184 |
made on a particular revision.</p> |
| 185 |
<p>This is similar to the <tt class="docutils literal">diff</tt> handler. However, this form features |
| 186 |
a split or side-by-side diff rather than a unified diff.</p> |
| 187 |
<p>The <tt class="docutils literal">context</tt> query string argument can be used to control the lines of |
| 188 |
context in the diff.</p> |
| 189 |
<p>The <tt class="docutils literal">filecomparison</tt> template is rendered.</p> |
| 190 |
</div> |
| 191 |
<div class="section" id="diff-revision-path"> |
| 192 |
<h2><a class="toc-backref" href="#contents">/diff/{revision}/{path}</a></h2> |
| 193 |
<p>Show how a file changed in a particular commit.</p> |
| 194 |
<p>The <tt class="docutils literal">filediff</tt> template is rendered.</p> |
| 195 |
<p>This handler is registered under both the <tt class="docutils literal">/diff</tt> and <tt class="docutils literal">/filediff</tt> |
| 196 |
paths. <tt class="docutils literal">/diff</tt> is used in modern code.</p> |
| 197 |
</div> |
| 198 |
<div class="section" id="file-revision-path"> |
| 199 |
<h2><a class="toc-backref" href="#contents">/file/{revision}[/{path}]</a></h2> |
| 200 |
<p>Show information about a directory or file in the repository.</p> |
| 201 |
<p>Info about the <tt class="docutils literal">path</tt> given as a URL parameter will be rendered.</p> |
| 202 |
<p>If <tt class="docutils literal">path</tt> is a directory, information about the entries in that |
| 203 |
directory will be rendered. This form is equivalent to the <tt class="docutils literal">manifest</tt> |
| 204 |
handler.</p> |
| 205 |
<p>If <tt class="docutils literal">path</tt> is a file, information about that file will be shown via |
| 206 |
the <tt class="docutils literal">filerevision</tt> template.</p> |
| 207 |
<p>If <tt class="docutils literal">path</tt> is not defined, information about the root directory will |
| 208 |
be rendered.</p> |
| 209 |
</div> |
| 210 |
<div class="section" id="diff-revision-path-1"> |
| 211 |
<h2><a class="toc-backref" href="#contents">/diff/{revision}/{path}</a></h2> |
| 212 |
<p>Show how a file changed in a particular commit.</p> |
| 213 |
<p>The <tt class="docutils literal">filediff</tt> template is rendered.</p> |
| 214 |
<p>This handler is registered under both the <tt class="docutils literal">/diff</tt> and <tt class="docutils literal">/filediff</tt> |
| 215 |
paths. <tt class="docutils literal">/diff</tt> is used in modern code.</p> |
| 216 |
</div> |
| 217 |
<div class="section" id="filelog-revision-path"> |
| 218 |
<h2><a class="toc-backref" href="#contents">/filelog/{revision}/{path}</a></h2> |
| 219 |
<p>Show information about the history of a file in the repository.</p> |
| 220 |
<p>The <tt class="docutils literal">revcount</tt> query string argument can be defined to control the |
| 221 |
maximum number of entries to show.</p> |
| 222 |
<p>The <tt class="docutils literal">filelog</tt> template will be rendered.</p> |
| 223 |
</div> |
| 224 |
<div class="section" id="graph-revision"> |
| 225 |
<h2><a class="toc-backref" href="#contents">/graph[/{revision}]</a></h2> |
| 226 |
<p>Show information about the graphical topology of the repository.</p> |
| 227 |
<p>Information rendered by this handler can be used to create visual |
| 228 |
representations of repository topology.</p> |
| 229 |
<p>The <tt class="docutils literal">revision</tt> URL parameter controls the starting changeset. If it's |
| 230 |
absent, the default is <tt class="docutils literal">tip</tt>.</p> |
| 231 |
<p>The <tt class="docutils literal">revcount</tt> query string argument can define the number of changesets |
| 232 |
to show information for.</p> |
| 233 |
<p>The <tt class="docutils literal">graphtop</tt> query string argument can specify the starting changeset |
| 234 |
for producing <tt class="docutils literal">jsdata</tt> variable that is used for rendering graph in |
| 235 |
JavaScript. By default it has the same value as <tt class="docutils literal">revision</tt>.</p> |
| 236 |
<p>This handler will render the <tt class="docutils literal">graph</tt> template.</p> |
| 237 |
</div> |
| 238 |
<div class="section" id="help-topic"> |
| 239 |
<h2><a class="toc-backref" href="#contents">/help[/{topic}]</a></h2> |
| 240 |
<p>Render help documentation.</p> |
| 241 |
<p>This web command is roughly equivalent to <a class="reference external" href="hg-help.html"><tt class="docutils literal">hg help</tt></a>. If a <tt class="docutils literal">topic</tt> |
| 242 |
is defined, that help topic will be rendered. If not, an index of |
| 243 |
available help topics will be rendered.</p> |
| 244 |
<p>The <tt class="docutils literal">help</tt> template will be rendered when requesting help for a topic. |
| 245 |
<tt class="docutils literal">helptopics</tt> will be rendered for the index of help topics.</p> |
| 246 |
</div> |
| 247 |
<div class="section" id="log-revision-path"> |
| 248 |
<h2><a class="toc-backref" href="#contents">/log[/{revision}[/{path}]]</a></h2> |
| 249 |
<p>Show repository or file history.</p> |
| 250 |
<p>For URLs of the form <tt class="docutils literal"><span class="pre">/log/{revision}</span></tt>, a list of changesets starting at |
| 251 |
the specified changeset identifier is shown. If <tt class="docutils literal">{revision}</tt> is not |
| 252 |
defined, the default is <tt class="docutils literal">tip</tt>. This form is equivalent to the |
| 253 |
<tt class="docutils literal">changelog</tt> handler.</p> |
| 254 |
<p>For URLs of the form <tt class="docutils literal"><span class="pre">/log/{revision}/{file}</span></tt>, the history for a specific |
| 255 |
file will be shown. This form is equivalent to the <tt class="docutils literal">filelog</tt> handler.</p> |
| 256 |
</div> |
| 257 |
<div class="section" id="manifest-revision-path"> |
| 258 |
<h2><a class="toc-backref" href="#contents">/manifest[/{revision}[/{path}]]</a></h2> |
| 259 |
<p>Show information about a directory.</p> |
| 260 |
<p>If the URL path arguments are omitted, information about the root |
| 261 |
directory for the <tt class="docutils literal">tip</tt> changeset will be shown.</p> |
| 262 |
<p>Because this handler can only show information for directories, it |
| 263 |
is recommended to use the <tt class="docutils literal">file</tt> handler instead, as it can handle both |
| 264 |
directories and files.</p> |
| 265 |
<p>The <tt class="docutils literal">manifest</tt> template will be rendered for this handler.</p> |
| 266 |
</div> |
| 267 |
<div class="section" id="changeset-revision-1"> |
| 268 |
<h2><a class="toc-backref" href="#contents">/changeset[/{revision}]</a></h2> |
| 269 |
<p>Show information about a single changeset.</p> |
| 270 |
<p>A URL path argument is the changeset identifier to show. See <tt class="docutils literal">hg help |
| 271 |
revisions</tt> for possible values. If not defined, the <tt class="docutils literal">tip</tt> changeset |
| 272 |
will be shown.</p> |
| 273 |
<p>The <tt class="docutils literal">changeset</tt> template is rendered. Contents of the <tt class="docutils literal">changesettag</tt>, |
| 274 |
<tt class="docutils literal">changesetbookmark</tt>, <tt class="docutils literal">filenodelink</tt>, <tt class="docutils literal">filenolink</tt>, and the many |
| 275 |
templates related to diffs may all be used to produce the output.</p> |
| 276 |
</div> |
| 277 |
<div class="section" id="shortlog"> |
| 278 |
<h2><a class="toc-backref" href="#contents">/shortlog</a></h2> |
| 279 |
<p>Show basic information about a set of changesets.</p> |
| 280 |
<p>This accepts the same parameters as the <tt class="docutils literal">changelog</tt> handler. The only |
| 281 |
difference is the <tt class="docutils literal">shortlog</tt> template will be rendered instead of the |
| 282 |
<tt class="docutils literal">changelog</tt> template.</p> |
| 283 |
</div> |
| 284 |
<div class="section" id="summary"> |
| 285 |
<h2><a class="toc-backref" href="#contents">/summary</a></h2> |
| 286 |
<p>Show a summary of repository state.</p> |
| 287 |
<p>Information about the latest changesets, bookmarks, tags, and branches |
| 288 |
is captured by this handler.</p> |
| 289 |
<p>The <tt class="docutils literal">summary</tt> template is rendered.</p> |
| 290 |
</div> |
| 291 |
<div class="section" id="tags"> |
| 292 |
<h2><a class="toc-backref" href="#contents">/tags</a></h2> |
| 293 |
<p>Show information about tags.</p> |
| 294 |
<p>No arguments are accepted.</p> |
| 295 |
<p>The <tt class="docutils literal">tags</tt> template is rendered.</p> |
| 296 |
</div> |
| 297 |
</div> |
| 298 |
</div> |
| 299 |
</body> |
| 300 |
</html> |