changeset 29895:b1ebc767563d

help: show content for explicitly disabled extension (issue5228)
author liscju <piotr.listkiewicz@gmail.com>
date Thu, 01 Sep 2016 22:06:42 +0200
parents 02c150850e16
children 104914b03b83
files mercurial/extensions.py tests/test-help.t
diffstat 2 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/extensions.py	Fri Sep 02 10:18:56 2016 +0200
+++ b/mercurial/extensions.py	Thu Sep 01 22:06:42 2016 +0200
@@ -22,6 +22,7 @@
 )
 
 _extensions = {}
+_disabledextensions = {}
 _aftercallbacks = {}
 _order = []
 _builtin = set(['hbisect', 'bookmarks', 'parentrevspec', 'progress', 'interhg',
@@ -148,6 +149,7 @@
     for (name, path) in result:
         if path:
             if path[0] == '!':
+                _disabledextensions[name] = path[1:]
                 continue
         try:
             load(ui, name, path)
@@ -370,6 +372,7 @@
         if name in exts or name in _order or name == '__init__':
             continue
         exts[name] = path
+    exts.update(_disabledextensions)
     return exts
 
 def _moduledoc(file):
--- a/tests/test-help.t	Fri Sep 02 10:18:56 2016 +0200
+++ b/tests/test-help.t	Thu Sep 01 22:06:42 2016 +0200
@@ -1624,6 +1624,17 @@
   > ambiguous = !
   > EOF
 
+Show help content of disabled extensions
+
+  $ cat >> $HGRCPATH <<EOF
+  > [extensions]
+  > ambiguous = !./ambiguous.py
+  > EOF
+  $ hg help -e ambiguous
+  ambiguous extension - (no help text available)
+  
+  (use "hg help extensions" for information on enabling extensions)
+
 Test dynamic list of merge tools only shows up once
   $ hg help merge-tools
   Merge Tools