mercurial/help/hgweb.txt
author Martijn Pieters <mj@zopatista.com>
Wed, 11 Jul 2018 14:28:13 +0100
changeset 38661 8ac0c9cd4c48
parent 26781 1aee2ab0f902
permissions -rw-r--r--
fncache: avoid loading the filename cache when not actually modifying it With time, fncache can become very large. The mozilla-central repo for example, has a 31M and growing fncache file. Loading this file takes time (280ms for the mozilla-central repository). In many scenarios, we don't need to load fncache at all. For example, when committing changes to existing files, or pushing such commits to another clone. This patch detects when a name is added via store.vfs(), and only loads the cache if a) the data metadata file doesn't already exist, or b) when opening for appending, the data or metadata file exists but has size (a transaction rollback leaves behind such files). Benchmarks (run on Macos 10.13 on a 2017-model Macbook Pro with Core i7 2.9GHz and flash drive), each test without and with patch run 5 times: * committing to an existing file, against the mozilla-central repository. Baseline real time average 2.3736, with patch 1.9884. * unbundling a large changeset consisting *only* of existing-file modifications (159 revisions, 1050 modifications, mozilla-central 4a250a0e4f29:beea9ac7d823), into a clone limited to the ancestor revision of that revset). Baseline real time average 1.5048, with patch 1.3108.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10999
38182ed043b7 help: add some help for hgweb.config files
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     1
Mercurial's internal web server, hgweb, can serve either a single
17104
5a9acb0b2086 help: improve hgweb help
Mads Kiilerich <mads@kiilerich.com>
parents: 13839
diff changeset
     2
repository, or a tree of repositories. In the second case, repository
5a9acb0b2086 help: improve hgweb help
Mads Kiilerich <mads@kiilerich.com>
parents: 13839
diff changeset
     3
paths and global options can be defined using a dedicated
5a9acb0b2086 help: improve hgweb help
Mads Kiilerich <mads@kiilerich.com>
parents: 13839
diff changeset
     4
configuration file common to :hg:`serve`, ``hgweb.wsgi``,
5a9acb0b2086 help: improve hgweb help
Mads Kiilerich <mads@kiilerich.com>
parents: 13839
diff changeset
     5
``hgweb.cgi`` and ``hgweb.fcgi``.
10999
38182ed043b7 help: add some help for hgweb.config files
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     6
17104
5a9acb0b2086 help: improve hgweb help
Mads Kiilerich <mads@kiilerich.com>
parents: 13839
diff changeset
     7
This file uses the same syntax as other Mercurial configuration files
5a9acb0b2086 help: improve hgweb help
Mads Kiilerich <mads@kiilerich.com>
parents: 13839
diff changeset
     8
but recognizes only the following sections:
10999
38182ed043b7 help: add some help for hgweb.config files
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     9
38182ed043b7 help: add some help for hgweb.config files
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    10
  - web
38182ed043b7 help: add some help for hgweb.config files
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    11
  - paths
38182ed043b7 help: add some help for hgweb.config files
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    12
  - collections
38182ed043b7 help: add some help for hgweb.config files
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    13
17424
e7cfe3587ea4 fix trivial spelling errors
Mads Kiilerich <mads@kiilerich.com>
parents: 17333
diff changeset
    14
The ``web`` options are thoroughly described in :hg:`help config`.
17104
5a9acb0b2086 help: improve hgweb help
Mads Kiilerich <mads@kiilerich.com>
parents: 13839
diff changeset
    15
5a9acb0b2086 help: improve hgweb help
Mads Kiilerich <mads@kiilerich.com>
parents: 13839
diff changeset
    16
The ``paths`` section maps URL paths to paths of repositories in the
5a9acb0b2086 help: improve hgweb help
Mads Kiilerich <mads@kiilerich.com>
parents: 13839
diff changeset
    17
filesystem. hgweb will not expose the filesystem directly - only
5a9acb0b2086 help: improve hgweb help
Mads Kiilerich <mads@kiilerich.com>
parents: 13839
diff changeset
    18
Mercurial repositories can be published and only according to the
5a9acb0b2086 help: improve hgweb help
Mads Kiilerich <mads@kiilerich.com>
parents: 13839
diff changeset
    19
configuration.
10999
38182ed043b7 help: add some help for hgweb.config files
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    20
17104
5a9acb0b2086 help: improve hgweb help
Mads Kiilerich <mads@kiilerich.com>
parents: 13839
diff changeset
    21
The left hand side is the path in the URL. Note that hgweb reserves
5a9acb0b2086 help: improve hgweb help
Mads Kiilerich <mads@kiilerich.com>
parents: 13839
diff changeset
    22
subpaths like ``rev`` or ``file``, try using different names for
5a9acb0b2086 help: improve hgweb help
Mads Kiilerich <mads@kiilerich.com>
parents: 13839
diff changeset
    23
nested repositories to avoid confusing effects.
5a9acb0b2086 help: improve hgweb help
Mads Kiilerich <mads@kiilerich.com>
parents: 13839
diff changeset
    24
5a9acb0b2086 help: improve hgweb help
Mads Kiilerich <mads@kiilerich.com>
parents: 13839
diff changeset
    25
The right hand side is the path in the filesystem. If the specified
5a9acb0b2086 help: improve hgweb help
Mads Kiilerich <mads@kiilerich.com>
parents: 13839
diff changeset
    26
path ends with ``*`` or ``**`` the filesystem will be searched
5a9acb0b2086 help: improve hgweb help
Mads Kiilerich <mads@kiilerich.com>
parents: 13839
diff changeset
    27
recursively for repositories below that point.
5a9acb0b2086 help: improve hgweb help
Mads Kiilerich <mads@kiilerich.com>
parents: 13839
diff changeset
    28
With ``*`` it will not recurse into the repositories it finds (except for
5a9acb0b2086 help: improve hgweb help
Mads Kiilerich <mads@kiilerich.com>
parents: 13839
diff changeset
    29
``.hg/patches``).
5a9acb0b2086 help: improve hgweb help
Mads Kiilerich <mads@kiilerich.com>
parents: 13839
diff changeset
    30
With ``**`` it will also search inside repository working directories
5a9acb0b2086 help: improve hgweb help
Mads Kiilerich <mads@kiilerich.com>
parents: 13839
diff changeset
    31
and possibly find subrepositories.
5a9acb0b2086 help: improve hgweb help
Mads Kiilerich <mads@kiilerich.com>
parents: 13839
diff changeset
    32
5a9acb0b2086 help: improve hgweb help
Mads Kiilerich <mads@kiilerich.com>
parents: 13839
diff changeset
    33
In this example::
10999
38182ed043b7 help: add some help for hgweb.config files
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    34
38182ed043b7 help: add some help for hgweb.config files
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    35
  [paths]
17104
5a9acb0b2086 help: improve hgweb help
Mads Kiilerich <mads@kiilerich.com>
parents: 13839
diff changeset
    36
  /projects/a = /srv/tmprepos/a
5a9acb0b2086 help: improve hgweb help
Mads Kiilerich <mads@kiilerich.com>
parents: 13839
diff changeset
    37
  /projects/b = c:/repos/b
5a9acb0b2086 help: improve hgweb help
Mads Kiilerich <mads@kiilerich.com>
parents: 13839
diff changeset
    38
  / = /srv/repos/*
5a9acb0b2086 help: improve hgweb help
Mads Kiilerich <mads@kiilerich.com>
parents: 13839
diff changeset
    39
  /user/bob = /home/bob/repos/**
10999
38182ed043b7 help: add some help for hgweb.config files
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    40
38182ed043b7 help: add some help for hgweb.config files
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    41
- The first two entries make two repositories in different directories
38182ed043b7 help: add some help for hgweb.config files
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    42
  appear under the same directory in the web interface
17104
5a9acb0b2086 help: improve hgweb help
Mads Kiilerich <mads@kiilerich.com>
parents: 13839
diff changeset
    43
- The third entry will publish every Mercurial repository found in
5a9acb0b2086 help: improve hgweb help
Mads Kiilerich <mads@kiilerich.com>
parents: 13839
diff changeset
    44
  ``/srv/repos/``, for instance the repository ``/srv/repos/quux/``
5a9acb0b2086 help: improve hgweb help
Mads Kiilerich <mads@kiilerich.com>
parents: 13839
diff changeset
    45
  will appear as ``http://server/quux/``
5a9acb0b2086 help: improve hgweb help
Mads Kiilerich <mads@kiilerich.com>
parents: 13839
diff changeset
    46
- The fourth entry will publish both ``http://server/user/bob/quux/``
5a9acb0b2086 help: improve hgweb help
Mads Kiilerich <mads@kiilerich.com>
parents: 13839
diff changeset
    47
  and ``http://server/user/bob/quux/testsubrepo/``
10999
38182ed043b7 help: add some help for hgweb.config files
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    48
17333
ba36e771f268 help/hgweb: fix spelling error
Javi Merino <cibervicho@gmail.com>
parents: 17104
diff changeset
    49
The ``collections`` section is deprecated and has been superseded by
17104
5a9acb0b2086 help: improve hgweb help
Mads Kiilerich <mads@kiilerich.com>
parents: 13839
diff changeset
    50
``paths``.
24079
afe03a616525 help.hgweb: add a section describing URLs and common parameters
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17424
diff changeset
    51
afe03a616525 help.hgweb: add a section describing URLs and common parameters
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17424
diff changeset
    52
URLs and Common Arguments
afe03a616525 help.hgweb: add a section describing URLs and common parameters
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17424
diff changeset
    53
=========================
afe03a616525 help.hgweb: add a section describing URLs and common parameters
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17424
diff changeset
    54
afe03a616525 help.hgweb: add a section describing URLs and common parameters
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17424
diff changeset
    55
URLs under each repository have the form ``/{command}[/{arguments}]``
afe03a616525 help.hgweb: add a section describing URLs and common parameters
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17424
diff changeset
    56
where ``{command}`` represents the name of a command or handler and
afe03a616525 help.hgweb: add a section describing URLs and common parameters
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17424
diff changeset
    57
``{arguments}`` represents any number of additional URL parameters
afe03a616525 help.hgweb: add a section describing URLs and common parameters
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17424
diff changeset
    58
to that command.
afe03a616525 help.hgweb: add a section describing URLs and common parameters
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17424
diff changeset
    59
afe03a616525 help.hgweb: add a section describing URLs and common parameters
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17424
diff changeset
    60
The web server has a default style associated with it. Styles map to
afe03a616525 help.hgweb: add a section describing URLs and common parameters
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17424
diff changeset
    61
a collection of named templates. Each template is used to render a
afe03a616525 help.hgweb: add a section describing URLs and common parameters
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17424
diff changeset
    62
specific piece of data, such as a changeset or diff.
afe03a616525 help.hgweb: add a section describing URLs and common parameters
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17424
diff changeset
    63
afe03a616525 help.hgweb: add a section describing URLs and common parameters
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17424
diff changeset
    64
The style for the current request can be overwritten two ways. First,
afe03a616525 help.hgweb: add a section describing URLs and common parameters
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17424
diff changeset
    65
if ``{command}`` contains a hyphen (``-``), the text before the hyphen
afe03a616525 help.hgweb: add a section describing URLs and common parameters
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17424
diff changeset
    66
defines the style. For example, ``/atom-log`` will render the ``log``
afe03a616525 help.hgweb: add a section describing URLs and common parameters
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17424
diff changeset
    67
command handler with the ``atom`` style. The second way to set the
afe03a616525 help.hgweb: add a section describing URLs and common parameters
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17424
diff changeset
    68
style is with the ``style`` query string argument. For example,
afe03a616525 help.hgweb: add a section describing URLs and common parameters
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17424
diff changeset
    69
``/log?style=atom``. The hyphenated URL parameter is preferred.
afe03a616525 help.hgweb: add a section describing URLs and common parameters
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17424
diff changeset
    70
afe03a616525 help.hgweb: add a section describing URLs and common parameters
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17424
diff changeset
    71
Not all templates are available for all styles. Attempting to use
afe03a616525 help.hgweb: add a section describing URLs and common parameters
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17424
diff changeset
    72
a style that doesn't have all templates defined may result in an error
afe03a616525 help.hgweb: add a section describing URLs and common parameters
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17424
diff changeset
    73
rendering the page.
afe03a616525 help.hgweb: add a section describing URLs and common parameters
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17424
diff changeset
    74
afe03a616525 help.hgweb: add a section describing URLs and common parameters
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17424
diff changeset
    75
Many commands take a ``{revision}`` URL parameter. This defines the
afe03a616525 help.hgweb: add a section describing URLs and common parameters
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17424
diff changeset
    76
changeset to operate on. This is commonly specified as the short,
26781
1aee2ab0f902 spelling: trivial spell checking
Mads Kiilerich <madski@unity3d.com>
parents: 24080
diff changeset
    77
12 digit hexadecimal abbreviation for the full 40 character unique
24079
afe03a616525 help.hgweb: add a section describing URLs and common parameters
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17424
diff changeset
    78
revision identifier. However, any value described by
afe03a616525 help.hgweb: add a section describing URLs and common parameters
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17424
diff changeset
    79
:hg:`help revisions` typically works.
24080
a3f2ea1d4943 help: add web commands to help documentation
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24079
diff changeset
    80
a3f2ea1d4943 help: add web commands to help documentation
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24079
diff changeset
    81
Commands and URLs
a3f2ea1d4943 help: add web commands to help documentation
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24079
diff changeset
    82
=================
a3f2ea1d4943 help: add web commands to help documentation
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24079
diff changeset
    83
a3f2ea1d4943 help: add web commands to help documentation
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24079
diff changeset
    84
The following web commands and their URLs are available:
a3f2ea1d4943 help: add web commands to help documentation
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24079
diff changeset
    85
a3f2ea1d4943 help: add web commands to help documentation
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24079
diff changeset
    86
  .. webcommandsmarker