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