Show More
@@ -1,47 +1,50 b'' | |||
|
1 | 1 | Mercurial's internal web server, hgweb, can serve either a single |
|
2 |
repository, or a |
|
|
3 | configuration file can be used to specify the repository paths to use | |
|
4 | and global web configuration options. | |
|
2 | repository, or a tree of repositories. In the second case, repository | |
|
3 | paths and global options can be defined using a dedicated | |
|
4 | configuration file common to :hg:`serve`, ``hgweb.wsgi``, | |
|
5 | ``hgweb.cgi`` and ``hgweb.fcgi``. | |
|
5 | 6 | |
|
6 |
This file uses the same syntax as other Mercurial configuration files |
|
|
7 |
but only the following sections |
|
|
7 | This file uses the same syntax as other Mercurial configuration files | |
|
8 | but recognizes only the following sections: | |
|
8 | 9 | |
|
9 | 10 | - web |
|
10 | 11 | - paths |
|
11 | 12 | - collections |
|
12 | 13 | |
|
13 | The ``web`` section can specify all the settings described in the web | |
|
14 | section of the hgrc(5) documentation. See :hg:`help config` for | |
|
15 | information on where to find the manual page. | |
|
14 | The ``web`` options are thorougly described in :hg:`help config`. | |
|
15 | ||
|
16 | The ``paths`` section maps URL paths to paths of repositories in the | |
|
17 | filesystem. hgweb will not expose the filesystem directly - only | |
|
18 | Mercurial repositories can be published and only according to the | |
|
19 | configuration. | |
|
16 | 20 | |
|
17 | The ``paths`` section provides mappings of physical repository | |
|
18 | paths to virtual ones. For instance:: | |
|
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 | |
|
23 | nested repositories to avoid confusing effects. | |
|
24 | ||
|
25 | The right hand side is the path in the filesystem. If the specified | |
|
26 | path ends with ``*`` or ``**`` the filesystem will be searched | |
|
27 | recursively for repositories below that point. | |
|
28 | With ``*`` it will not recurse into the repositories it finds (except for | |
|
29 | ``.hg/patches``). | |
|
30 | With ``**`` it will also search inside repository working directories | |
|
31 | and possibly find subrepositories. | |
|
32 | ||
|
33 | In this example:: | |
|
19 | 34 | |
|
20 | 35 | [paths] |
|
21 |
projects/a = / |
|
|
22 |
projects/b = /b |
|
|
23 | web/root = /real/root/* | |
|
24 | / = /real/root2/* | |
|
25 | virtual/root2 = /real/root2/** | |
|
36 | /projects/a = /srv/tmprepos/a | |
|
37 | /projects/b = c:/repos/b | |
|
38 | / = /srv/repos/* | |
|
39 | /user/bob = /home/bob/repos/** | |
|
26 | 40 | |
|
27 | 41 | - The first two entries make two repositories in different directories |
|
28 | 42 | appear under the same directory in the web interface |
|
29 |
- The third entry |
|
|
30 | into 'web/root'. This format is preferred over the [collections] one, | |
|
31 | since using absolute paths as configuration keys is not supported on every | |
|
32 | platform (especially on Windows). | |
|
33 | - The fourth entry is a special case mapping all repositories in | |
|
34 | '/real/root2' in the root of the virtual directory. | |
|
35 | - The fifth entry recursively finds all repositories under the real | |
|
36 | root, and maps their relative paths under the virtual root. | |
|
43 | - The third entry will publish every Mercurial repository found in | |
|
44 | ``/srv/repos/``, for instance the repository ``/srv/repos/quux/`` | |
|
45 | will appear as ``http://server/quux/`` | |
|
46 | - The fourth entry will publish both ``http://server/user/bob/quux/`` | |
|
47 | and ``http://server/user/bob/quux/testsubrepo/`` | |
|
37 | 48 | |
|
38 | The ``collections`` section provides mappings of trees of physical | |
|
39 | repositories paths to virtual ones, though the paths syntax is generally | |
|
40 | preferred. For instance:: | |
|
41 | ||
|
42 | [collections] | |
|
43 | /foo = /foo | |
|
44 | ||
|
45 | Here, the left side will be stripped off all repositories found in the | |
|
46 | right side. Thus ``/foo/bar`` and ``foo/quux/baz`` will be listed as | |
|
47 | ``bar`` and ``quux/baz`` respectively. | |
|
49 | The ``collections`` section is deprecated and has been superseeded by | |
|
50 | ``paths``. |
@@ -23,10 +23,10 b' def findrepos(paths):' | |||
|
23 | 23 | repos = [] |
|
24 | 24 | for prefix, root in cleannames(paths): |
|
25 | 25 | roothead, roottail = os.path.split(root) |
|
26 |
# "foo = /bar/*" |
|
|
27 | # mounted as foo/subrepo | |
|
28 | # and "foo = /bar/**" also recurses into the subdirectories, | |
|
29 | # remember to use it without working dir. | |
|
26 | # "foo = /bar/*" or "foo = /bar/**" lets every repo /bar/N in or below | |
|
27 | # /bar/ be served as as foo/N . | |
|
28 | # '*' will not search inside dirs with .hg (except .hg/patches), | |
|
29 | # '**' will search inside dirs with .hg (and thus also find subrepos). | |
|
30 | 30 | try: |
|
31 | 31 | recurse = {'*': False, '**': True}[roottail] |
|
32 | 32 | except KeyError: |
@@ -350,7 +350,8 b' def canonpath(root, cwd, myname, auditor' | |||
|
350 | 350 | raise util.Abort('%s not under root' % myname) |
|
351 | 351 | |
|
352 | 352 | def walkrepos(path, followsym=False, seen_dirs=None, recurse=False): |
|
353 |
'''yield every hg repository under path, recursively. |
|
|
353 | '''yield every hg repository under path, always recursively. | |
|
354 | The recurse flag will only control recursion into repo working dirs''' | |
|
354 | 355 | def errhandler(err): |
|
355 | 356 | if err.filename == path: |
|
356 | 357 | raise err |
General Comments 0
You need to be logged in to leave comments.
Login now