[PATCH] help: show content for explicitly disabled extension (issue5228)

liscju piotr.listkiewicz at gmail.com
Thu Sep 1 20:08:58 UTC 2016


# HG changeset patch
# User liscju <piotr.listkiewicz at gmail.com>
# Date 1472760402 -7200
#      Thu Sep 01 22:06:42 2016 +0200
# Node ID fbf842ccbfcf26f3f110638ba6b174891bb0d69f
# Parent  f148bfa40489269be2e48046734f81065129847a
help: show content for explicitly disabled extension (issue5228)

diff --git a/mercurial/extensions.py b/mercurial/extensions.py
--- a/mercurial/extensions.py
+++ b/mercurial/extensions.py
@@ -22,6 +22,7 @@ from . import (
 )
 
 _extensions = {}
+_disabledextensions = {}
 _aftercallbacks = {}
 _order = []
 _builtin = set(['hbisect', 'bookmarks', 'parentrevspec', 'progress', 'interhg',
@@ -148,6 +149,7 @@ def loadall(ui):
     for (name, path) in result:
         if path:
             if path[0] == '!':
+                _disabledextensions[name] = path[1:]
                 continue
         try:
             load(ui, name, path)
@@ -370,6 +372,7 @@ def _disabledpaths(strip_init=False):
         if name in exts or name in _order or name == '__init__':
             continue
         exts[name] = path
+    exts.update(_disabledextensions)
     return exts
 
 def _moduledoc(file):
diff --git a/tests/test-help.t b/tests/test-help.t
--- a/tests/test-help.t
+++ b/tests/test-help.t
@@ -1623,6 +1623,17 @@ such str.lower().
   > 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


More information about the Mercurial-devel mailing list