narrow: introduce a config option to check if narrow is enabled or not
This patch introduces a new config option experimental.narrow which is set to
False by default and set to True by the narrow extension.
While moving narrow related logic into core, we need to know at places whether
narrow extension is enabled or not. Checking the list of extension enabled is
one solution but once narrow is inbuilt, we will definitely want a config option
to check whether narrow is turned on or not.
So this patch introduces a config option, which will evolve to the main point to
turn narrow capability on and off once all the narrow is in core.
Differential Revision: https://phab.mercurial-scm.org/D4889
--- a/hgext/narrow/__init__.py Fri Oct 05 20:24:07 2018 +0300
+++ b/hgext/narrow/__init__.py Fri Oct 05 22:19:19 2018 +0300
@@ -62,6 +62,7 @@
if not repo.local():
return
+ repo.ui.setconfig('experimental', 'narrow', True, 'narrow-ext')
if repository.NARROW_REQUIREMENT in repo.requirements:
narrowrepo.wraprepo(repo)
narrowwirepeer.reposetup(repo)
--- a/mercurial/configitems.py Fri Oct 05 20:24:07 2018 +0300
+++ b/mercurial/configitems.py Fri Oct 05 22:19:19 2018 +0300
@@ -538,6 +538,9 @@
coreconfigitem('experimental', 'mmapindexthreshold',
default=None,
)
+coreconfigitem('experimental', 'narrow',
+ default=False,
+)
coreconfigitem('experimental', 'nonnormalparanoidcheck',
default=False,
)