| 1 |
Mercurial has the ability to add new features through the use of |
| 2 |
extensions. Extensions may add new commands, add options to |
| 3 |
existing commands, change the default behavior of commands, or |
| 4 |
implement hooks. |
| 5 |
|
| 6 |
To enable the "foo" extension, either shipped with Mercurial or in the |
| 7 |
Python search path, create an entry for it in your configuration file, |
| 8 |
like this:: |
| 9 |
|
| 10 |
[extensions] |
| 11 |
foo = |
| 12 |
|
| 13 |
You may also specify the full path to an extension:: |
| 14 |
|
| 15 |
[extensions] |
| 16 |
myfeature = ~/.hgext/myfeature.py |
| 17 |
|
| 18 |
See :hg:`help config` for more information on configuration files. |
| 19 |
|
| 20 |
Extensions are not loaded by default for a variety of reasons: |
| 21 |
they can increase startup overhead; they may be meant for advanced |
| 22 |
usage only; they may provide potentially dangerous abilities (such |
| 23 |
as letting you destroy or modify history); they might not be ready |
| 24 |
for prime time; or they may alter some usual behaviors of stock |
| 25 |
Mercurial. It is thus up to the user to activate extensions as |
| 26 |
needed. |
| 27 |
|
| 28 |
To explicitly disable an extension enabled in a configuration file of |
| 29 |
broader scope, prepend its path with !:: |
| 30 |
|
| 31 |
[extensions] |
| 32 |
# disabling extension bar residing in /path/to/extension/bar.py |
| 33 |
bar = !/path/to/extension/bar.py |
| 34 |
# ditto, but no path was supplied for extension baz |
| 35 |
baz = ! |