Mercurial > hg
annotate mercurial/help/extensions.txt @ 22304:5678b0e3608f
templater: enable alias predicates to be used in "revset()" function
Before this patch, predicates defined in "[revsetalias]" can't be used
in the query specified to template function "revset()", because:
- "revset()" uses "localrepository.revs()" to get query result, but
- "localrepository.revs()" passes "None" as "ui" to "revset.match()", then
- "revset.match()" can't recognize any alias predicates
To enable alias predicates to be used in "revset()" function, this
patch invokes "revset.match()" directly with "repo.ui".
This patch doesn't make "localrepository.revs()" pass "self.ui" to
"revset.match()", because this may be intentional implementation to
prevent alias predicates from shadowing built-in ones and breaking
functions internally using "localrepository.revs()".
Even if it isn't intentional one, the check for shadowing should be
implemented (maybe on default branch) before fixing it for safety.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Sat, 23 Aug 2014 21:23:02 +0900 |
parents | da16d21cf4ed |
children |
rev | line source |
---|---|
9540
cad36e496640
help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents:
9539
diff
changeset
|
1 Mercurial has the ability to add new features through the use of |
cad36e496640
help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents:
9539
diff
changeset
|
2 extensions. Extensions may add new commands, add options to |
cad36e496640
help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents:
9539
diff
changeset
|
3 existing commands, change the default behavior of commands, or |
cad36e496640
help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents:
9539
diff
changeset
|
4 implement hooks. |
9539
c904e76e3834
help: move help topics from mercurial/help.py to help/*.txt
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
5 |
12083
ebfc46929f3e
help: refer to user configuration file more consistently
Brodie Rao <brodie@bitheap.org>
parents:
10123
diff
changeset
|
6 To enable the "foo" extension, either shipped with Mercurial or in the |
ebfc46929f3e
help: refer to user configuration file more consistently
Brodie Rao <brodie@bitheap.org>
parents:
10123
diff
changeset
|
7 Python search path, create an entry for it in your configuration file, |
ebfc46929f3e
help: refer to user configuration file more consistently
Brodie Rao <brodie@bitheap.org>
parents:
10123
diff
changeset
|
8 like this:: |
9539
c904e76e3834
help: move help topics from mercurial/help.py to help/*.txt
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
9 |
9540
cad36e496640
help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents:
9539
diff
changeset
|
10 [extensions] |
cad36e496640
help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents:
9539
diff
changeset
|
11 foo = |
9539
c904e76e3834
help: move help topics from mercurial/help.py to help/*.txt
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
12 |
9540
cad36e496640
help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents:
9539
diff
changeset
|
13 You may also specify the full path to an extension:: |
9539
c904e76e3834
help: move help topics from mercurial/help.py to help/*.txt
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
14 |
9540
cad36e496640
help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents:
9539
diff
changeset
|
15 [extensions] |
cad36e496640
help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents:
9539
diff
changeset
|
16 myfeature = ~/.hgext/myfeature.py |
9539
c904e76e3834
help: move help topics from mercurial/help.py to help/*.txt
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
17 |
19296
da16d21cf4ed
doc: make it easier to read how to enable extensions
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
12083
diff
changeset
|
18 See :hg:`help config` for more information on configuration files. |
da16d21cf4ed
doc: make it easier to read how to enable extensions
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
12083
diff
changeset
|
19 |
da16d21cf4ed
doc: make it easier to read how to enable extensions
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
12083
diff
changeset
|
20 Extensions are not loaded by default for a variety of reasons: |
da16d21cf4ed
doc: make it easier to read how to enable extensions
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
12083
diff
changeset
|
21 they can increase startup overhead; they may be meant for advanced |
da16d21cf4ed
doc: make it easier to read how to enable extensions
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
12083
diff
changeset
|
22 usage only; they may provide potentially dangerous abilities (such |
da16d21cf4ed
doc: make it easier to read how to enable extensions
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
12083
diff
changeset
|
23 as letting you destroy or modify history); they might not be ready |
da16d21cf4ed
doc: make it easier to read how to enable extensions
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
12083
diff
changeset
|
24 for prime time; or they may alter some usual behaviors of stock |
da16d21cf4ed
doc: make it easier to read how to enable extensions
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
12083
diff
changeset
|
25 Mercurial. It is thus up to the user to activate extensions as |
da16d21cf4ed
doc: make it easier to read how to enable extensions
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
12083
diff
changeset
|
26 needed. |
da16d21cf4ed
doc: make it easier to read how to enable extensions
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
12083
diff
changeset
|
27 |
12083
ebfc46929f3e
help: refer to user configuration file more consistently
Brodie Rao <brodie@bitheap.org>
parents:
10123
diff
changeset
|
28 To explicitly disable an extension enabled in a configuration file of |
ebfc46929f3e
help: refer to user configuration file more consistently
Brodie Rao <brodie@bitheap.org>
parents:
10123
diff
changeset
|
29 broader scope, prepend its path with !:: |
9539
c904e76e3834
help: move help topics from mercurial/help.py to help/*.txt
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
30 |
9540
cad36e496640
help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents:
9539
diff
changeset
|
31 [extensions] |
cad36e496640
help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents:
9539
diff
changeset
|
32 # disabling extension bar residing in /path/to/extension/bar.py |
10122
0ddbc0299742
extensions help: make disabling example analogous to enabling example
Christian Ebert <blacktrash@gmx.net>
parents:
9540
diff
changeset
|
33 bar = !/path/to/extension/bar.py |
9540
cad36e496640
help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents:
9539
diff
changeset
|
34 # ditto, but no path was supplied for extension baz |
10122
0ddbc0299742
extensions help: make disabling example analogous to enabling example
Christian Ebert <blacktrash@gmx.net>
parents:
9540
diff
changeset
|
35 baz = ! |