changeset 46569:eb36f7a71291

gendoc: add support for loading extensions from config settings We manage our installation and ship some extensions, enabled by default for our users, that are in hgext3rd or other directories not scanned by this tool by default. We want to generate docs during the build process, and having those docs include the extensions that users don't have to manually enable is desirable. This is *not* desirable for the normal build process, however, and should never be enabled by default. Differential Revision: https://phab.mercurial-scm.org/D9989
author Kyle Lippincott <spectral@google.com>
date Fri, 12 Feb 2021 11:06:56 -0800
parents 921e1253c8ba
children 85ec89c47a04
files doc/gendoc.py
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/doc/gendoc.py	Fri Feb 12 11:04:03 2021 -0800
+++ b/doc/gendoc.py	Fri Feb 12 11:06:56 2021 -0800
@@ -330,6 +330,11 @@
         doc = encoding.strtolocal(sys.argv[1])
 
     ui = uimod.ui.load()
+    # Trigger extensions to load. This is disabled by default because it uses
+    # the current user's configuration, which is often not what is wanted.
+    if encoding.environ.get(b'GENDOC_LOAD_CONFIGURED_EXTENSIONS', b'0') != b'0':
+        extensions.loadall(ui)
+
     if doc == b'hg.1.gendoc':
         showdoc(ui)
     else: