Show More
@@ -1485,8 +1485,7 b' def help_(ui, name=None, with_version=Fa' | |||
|
1485 | 1485 | |
|
1486 | 1486 | if name != 'shortlist': |
|
1487 | 1487 | exts, maxlength = extensions.enabled() |
|
1488 |
ui.write(help.ext |
|
|
1489 | exts, maxlength)) | |
|
1488 | ui.write(help.listexts(_('enabled extensions:'), exts, maxlength)) | |
|
1490 | 1489 | |
|
1491 | 1490 | if not ui.quiet: |
|
1492 | 1491 | addglobalopts(True) |
@@ -9,11 +9,11 b' from i18n import _' | |||
|
9 | 9 | import extensions |
|
10 | 10 | |
|
11 | 11 | |
|
12 | # loosely inspired by pydoc.source_synopsis() | |
|
13 | # rewritten to handle ''' as well as """ | |
|
14 | # and to return the whole text instead of just the synopsis | |
|
15 | 12 | def moduledoc(file): |
|
16 |
''' |
|
|
13 | '''return the top-level python documentation for the given file | |
|
14 | ||
|
15 | Loosely inspired by pydoc.source_synopsis(), but rewritten to handle \''' | |
|
16 | as well as """ and to return the whole text instead of just the synopsis''' | |
|
17 | 17 | result = [] |
|
18 | 18 | |
|
19 | 19 | line = file.readline() |
@@ -39,44 +39,42 b' def moduledoc(file):' | |||
|
39 | 39 | |
|
40 | 40 | return ''.join(result) |
|
41 | 41 | |
|
42 |
def ext |
|
|
43 |
''' |
|
|
44 | result = '' | |
|
45 | ||
|
46 | if exts: | |
|
47 | result += '\n%s\n\n' % header | |
|
48 | for name, desc in sorted(exts.iteritems()): | |
|
49 | result += ' %s %s\n' % (name.ljust(maxlength), desc) | |
|
50 | ||
|
42 | def listexts(header, exts, maxlength): | |
|
43 | '''return a text listing of the given extensions''' | |
|
44 | if not exts: | |
|
45 | return '' | |
|
46 | result = '\n%s\n\n' % header | |
|
47 | for name, desc in sorted(exts.iteritems()): | |
|
48 | result += ' %s %s\n' % (name.ljust(maxlength), desc) | |
|
51 | 49 | return result |
|
52 | 50 | |
|
53 | def topicextensions(): | |
|
51 | def extshelp(): | |
|
54 | 52 | doc = _(r''' |
|
55 | 53 | Mercurial has a mechanism for adding new features through the |
|
56 | 54 | use of extensions. Extensions may bring new commands, or new |
|
57 |
hooks, or change |
|
|
55 | hooks, or change Mercurial's behavior. | |
|
58 | 56 | |
|
59 | 57 | Extensions are not loaded by default for a variety of reasons, |
|
60 |
they may be meant for a |
|
|
61 |
dangerous commands (eg. mq |
|
|
62 |
they might not be |
|
|
63 |
|
|
|
64 |
|
|
|
58 | they may be meant for advanced users or provide potentially | |
|
59 | dangerous commands (e.g. mq and rebase allow history to be | |
|
60 | rewritten), they might not be ready for prime-time yet, or | |
|
61 | they may alter Mercurial's behavior. It is thus up to the user | |
|
62 | to activate extensions as desired. | |
|
65 | 63 | |
|
66 |
To enable |
|
|
67 |
|
|
|
68 |
|
|
|
64 | To enable the "foo" extension, either shipped with Mercurial | |
|
65 | or in the Python search path, create an entry for it in your | |
|
66 | hgrc, like this: | |
|
69 | 67 | |
|
70 | 68 | [extensions] |
|
71 | 69 | foo = |
|
72 | 70 | |
|
73 |
You may also specify the full path |
|
|
71 | You may also specify the full path to an extension: | |
|
74 | 72 | |
|
75 | 73 | [extensions] |
|
76 | 74 | myfeature = ~/.hgext/myfeature.py |
|
77 | 75 | |
|
78 |
To explicitly disable an extension |
|
|
79 |
|
|
|
76 | To explicitly disable an extension enabled in an hgrc of broader | |
|
77 | scope, prepend its path with !: | |
|
80 | 78 | |
|
81 | 79 | [extensions] |
|
82 | 80 | # disabling extension bar residing in /ext/path |
@@ -86,10 +84,10 b' def topicextensions():' | |||
|
86 | 84 | ''') |
|
87 | 85 | |
|
88 | 86 | exts, maxlength = extensions.enabled() |
|
89 |
doc += ext |
|
|
87 | doc += listexts(_('enabled extensions:'), exts, maxlength) | |
|
90 | 88 | |
|
91 | 89 | exts, maxlength = extensions.disabled() |
|
92 |
doc += ext |
|
|
90 | doc += listexts(_('disabled extensions:'), exts, maxlength) | |
|
93 | 91 | |
|
94 | 92 | return doc |
|
95 | 93 | |
@@ -504,5 +502,5 b' PYTHONPATH::' | |||
|
504 | 502 | The push command will look for a path named 'default-push', and |
|
505 | 503 | prefer it over 'default' if both are defined. |
|
506 | 504 | ''')), |
|
507 |
(["extensions"], _("Using additional features"), |
|
|
505 | (["extensions"], _("Using additional features"), extshelp), | |
|
508 | 506 | ) |
General Comments 0
You need to be logged in to leave comments.
Login now