Show More
@@ -1,50 +1,79 b'' | |||
|
1 | 1 | Mercurial's internal web server, hgweb, can serve either a single |
|
2 | 2 | repository, or a tree of repositories. In the second case, repository |
|
3 | 3 | paths and global options can be defined using a dedicated |
|
4 | 4 | configuration file common to :hg:`serve`, ``hgweb.wsgi``, |
|
5 | 5 | ``hgweb.cgi`` and ``hgweb.fcgi``. |
|
6 | 6 | |
|
7 | 7 | This file uses the same syntax as other Mercurial configuration files |
|
8 | 8 | but recognizes only the following sections: |
|
9 | 9 | |
|
10 | 10 | - web |
|
11 | 11 | - paths |
|
12 | 12 | - collections |
|
13 | 13 | |
|
14 | 14 | The ``web`` options are thoroughly described in :hg:`help config`. |
|
15 | 15 | |
|
16 | 16 | The ``paths`` section maps URL paths to paths of repositories in the |
|
17 | 17 | filesystem. hgweb will not expose the filesystem directly - only |
|
18 | 18 | Mercurial repositories can be published and only according to the |
|
19 | 19 | configuration. |
|
20 | 20 | |
|
21 | 21 | The left hand side is the path in the URL. Note that hgweb reserves |
|
22 | 22 | subpaths like ``rev`` or ``file``, try using different names for |
|
23 | 23 | nested repositories to avoid confusing effects. |
|
24 | 24 | |
|
25 | 25 | The right hand side is the path in the filesystem. If the specified |
|
26 | 26 | path ends with ``*`` or ``**`` the filesystem will be searched |
|
27 | 27 | recursively for repositories below that point. |
|
28 | 28 | With ``*`` it will not recurse into the repositories it finds (except for |
|
29 | 29 | ``.hg/patches``). |
|
30 | 30 | With ``**`` it will also search inside repository working directories |
|
31 | 31 | and possibly find subrepositories. |
|
32 | 32 | |
|
33 | 33 | In this example:: |
|
34 | 34 | |
|
35 | 35 | [paths] |
|
36 | 36 | /projects/a = /srv/tmprepos/a |
|
37 | 37 | /projects/b = c:/repos/b |
|
38 | 38 | / = /srv/repos/* |
|
39 | 39 | /user/bob = /home/bob/repos/** |
|
40 | 40 | |
|
41 | 41 | - The first two entries make two repositories in different directories |
|
42 | 42 | appear under the same directory in the web interface |
|
43 | 43 | - The third entry will publish every Mercurial repository found in |
|
44 | 44 | ``/srv/repos/``, for instance the repository ``/srv/repos/quux/`` |
|
45 | 45 | will appear as ``http://server/quux/`` |
|
46 | 46 | - The fourth entry will publish both ``http://server/user/bob/quux/`` |
|
47 | 47 | and ``http://server/user/bob/quux/testsubrepo/`` |
|
48 | 48 | |
|
49 | 49 | The ``collections`` section is deprecated and has been superseded by |
|
50 | 50 | ``paths``. |
|
51 | ||
|
52 | URLs and Common Arguments | |
|
53 | ========================= | |
|
54 | ||
|
55 | URLs under each repository have the form ``/{command}[/{arguments}]`` | |
|
56 | where ``{command}`` represents the name of a command or handler and | |
|
57 | ``{arguments}`` represents any number of additional URL parameters | |
|
58 | to that command. | |
|
59 | ||
|
60 | The web server has a default style associated with it. Styles map to | |
|
61 | a collection of named templates. Each template is used to render a | |
|
62 | specific piece of data, such as a changeset or diff. | |
|
63 | ||
|
64 | The style for the current request can be overwritten two ways. First, | |
|
65 | if ``{command}`` contains a hyphen (``-``), the text before the hyphen | |
|
66 | defines the style. For example, ``/atom-log`` will render the ``log`` | |
|
67 | command handler with the ``atom`` style. The second way to set the | |
|
68 | style is with the ``style`` query string argument. For example, | |
|
69 | ``/log?style=atom``. The hyphenated URL parameter is preferred. | |
|
70 | ||
|
71 | Not all templates are available for all styles. Attempting to use | |
|
72 | a style that doesn't have all templates defined may result in an error | |
|
73 | rendering the page. | |
|
74 | ||
|
75 | Many commands take a ``{revision}`` URL parameter. This defines the | |
|
76 | changeset to operate on. This is commonly specified as the short, | |
|
77 | 12 digit hexidecimal abbreviation for the full 40 character unique | |
|
78 | revision identifier. However, any value described by | |
|
79 | :hg:`help revisions` typically works. |
General Comments 0
You need to be logged in to leave comments.
Login now