Mercurial > hg
annotate mercurial/help/hgweb.txt @ 23167:a3c2d9211294 stable
templater: don't overwrite the keyword mapping in runsymbol() (issue4362)
This keyword remapping was introduced in e06e9fd2d99f as part of converting
generator based iterators into list based iterators, mentioning "undesired
behavior in template" when a generator is exhausted, but doesn't say what and
introduces no tests.
The problem with the remapping was that it corrupted the output for keywords
like 'extras', 'file_copies' and 'file_copies_switch' in templates such as:
$ hg log -r 142b5d5ec9cc --template "{file_copies % ' File: {file_copy}\n'}"
File: mercurial/changelog.py (mercurial/hg.py)
File: mercurial/changelog.py (mercurial/hg.py)
File: mercurial/changelog.py (mercurial/hg.py)
File: mercurial/changelog.py (mercurial/hg.py)
File: mercurial/changelog.py (mercurial/hg.py)
File: mercurial/changelog.py (mercurial/hg.py)
File: mercurial/changelog.py (mercurial/hg.py)
File: mercurial/changelog.py (mercurial/hg.py)
What was happening was that in the first call to runtemplate() inside runmap(),
'lm' mapped the keyword (e.g. file_copies) to the appropriate showxxx() method.
On each subsequent call to runtemplate() in that loop however, the keyword was
mapped to a list of the first item's pieces, e.g.:
'file_copy': ['mercurial/changelog.py', ' (', 'mercurial/hg.py', ')']
Therefore, the dict for the second and any subsequent items were not processed
through the corresponding showxxx() method, and the first item's data was
reused.
The 'extras' keyword regressed in de7e6c489412, and 'file_copies' regressed in
0b241d7a8c62 for other reasons. The common thread of things fixed by this seems
to be when a list of dicts are passed to the templatekw._hybrid class.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Mon, 03 Nov 2014 12:08:03 -0500 |
parents | e7cfe3587ea4 |
children | afe03a616525 |
rev | line source |
---|---|
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``. |