mercurial/help/hgweb.txt
changeset 17104 5a9acb0b2086
parent 13839 8d960240faac
child 17333 ba36e771f268
equal deleted inserted replaced
17103:5146de7bce96 17104:5a9acb0b2086
     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 collection of them. In the latter case, a special
     2 repository, or a tree of repositories. In the second case, repository
     3 configuration file can be used to specify the repository paths to use
     3 paths and global options can be defined using a dedicated
     4 and global web configuration options.
     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 This file uses the same syntax as other Mercurial configuration files
     7 but only the following sections are recognized:
     8 but recognizes only the following sections:
     8 
     9 
     9   - web
    10   - web
    10   - paths
    11   - paths
    11   - collections
    12   - collections
    12 
    13 
    13 The ``web`` section can specify all the settings described in the web
    14 The ``web`` options are thorougly described in :hg:`help config`.
    14 section of the hgrc(5) documentation. See :hg:`help config` for
       
    15 information on where to find the manual page.
       
    16 
    15 
    17 The ``paths`` section provides mappings of physical repository
    16 The ``paths`` section maps URL paths to paths of repositories in the
    18 paths to virtual ones. For instance::
    17 filesystem. hgweb will not expose the filesystem directly - only
       
    18 Mercurial repositories can be published and only according to the
       
    19 configuration.
       
    20 
       
    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   [paths]
    35   [paths]
    21   projects/a = /foo/bar
    36   /projects/a = /srv/tmprepos/a
    22   projects/b = /baz/quux
    37   /projects/b = c:/repos/b
    23   web/root = /real/root/*
    38   / = /srv/repos/*
    24   / = /real/root2/*
    39   /user/bob = /home/bob/repos/**
    25   virtual/root2 = /real/root2/**
       
    26 
    40 
    27 - The first two entries make two repositories in different directories
    41 - The first two entries make two repositories in different directories
    28   appear under the same directory in the web interface
    42   appear under the same directory in the web interface
    29 - The third entry maps every Mercurial repository found in '/real/root'
    43 - The third entry will publish every Mercurial repository found in
    30   into 'web/root'. This format is preferred over the [collections] one,
    44   ``/srv/repos/``, for instance the repository ``/srv/repos/quux/``
    31   since using absolute paths as configuration keys is not supported on every
    45   will appear as ``http://server/quux/``
    32   platform (especially on Windows).
    46 - The fourth entry will publish both ``http://server/user/bob/quux/``
    33 - The fourth entry is a special case mapping all repositories in
    47   and ``http://server/user/bob/quux/testsubrepo/``
    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.
       
    37 
    48 
    38 The ``collections`` section provides mappings of trees of physical
    49 The ``collections`` section is deprecated and has been superseeded by
    39 repositories paths to virtual ones, though the paths syntax is generally
    50 ``paths``.
    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.