From patchwork Mon Nov 29 16:52:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D11819: extensions: ignore "sub-options" when looking for extensions From: phabricator X-Patchwork-Id: 50146 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Mon, 29 Nov 2021 16:52:10 +0000 marmoute created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY config suboptions are separated by ":" (see the path one for example). So we dont want to confuse these config with actual extensions. We don't have extensions sub option yet, but I am about to introduce one for making sure an extensions can load. So lets level the floor first. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D11819 AFFECTED FILES mercurial/configitems.py mercurial/extensions.py CHANGE DETAILS To: marmoute, #hg-reviewers Cc: mercurial-patches, mercurial-devel diff --git a/mercurial/extensions.py b/mercurial/extensions.py --- a/mercurial/extensions.py +++ b/mercurial/extensions.py @@ -282,6 +282,7 @@ result = ui.configitems(b"extensions") if whitelist is not None: result = [(k, v) for (k, v) in result if k in whitelist] + result = [(k, v) for (k, v) in result if b':' not in k] newindex = len(_order) ui.log( b'extension', diff --git a/mercurial/configitems.py b/mercurial/configitems.py --- a/mercurial/configitems.py +++ b/mercurial/configitems.py @@ -1281,7 +1281,7 @@ ) coreconfigitem( b'extensions', - b'.*', + b'[^:]*', default=None, generic=True, )