changeset 42760:9f2189b6bf2a

config: add experimental argument to the config registrar Until now, there are almost 28 config items which are considered as `experimental` but, not present in the `experimental` section of the registrar. This patch adds an `experimental` argument to the config registrar to mark such config items. Differential Revision: https://phab.mercurial-scm.org/D6728 Differential Revision: https://phab.mercurial-scm.org/D6746
author Navaneeth Suresh <navaneeths1998@gmail.com>
date Tue, 20 Aug 2019 18:35:16 +0300
parents 791791a1fd4e
children 5c285c8e4f98
files contrib/perf.py hgext/fsmonitor/__init__.py hgext/remotefilelog/__init__.py hgext/sqlitestore.py mercurial/configitems.py
diffstat 5 files changed, 52 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/perf.py	Wed Aug 14 16:11:45 2019 -0400
+++ b/contrib/perf.py	Tue Aug 20 18:35:16 2019 +0300
@@ -241,6 +241,37 @@
     configitem = mercurial.registrar.configitem(configtable)
     configitem(b'perf', b'presleep',
         default=mercurial.configitems.dynamicdefault,
+        experimental=True,
+    )
+    configitem(b'perf', b'stub',
+        default=mercurial.configitems.dynamicdefault,
+        experimental=True,
+    )
+    configitem(b'perf', b'parentscount',
+        default=mercurial.configitems.dynamicdefault,
+        experimental=True,
+    )
+    configitem(b'perf', b'all-timing',
+        default=mercurial.configitems.dynamicdefault,
+        experimental=True,
+    )
+    configitem(b'perf', b'pre-run',
+        default=mercurial.configitems.dynamicdefault,
+    )
+    configitem(b'perf', b'profile-benchmark',
+        default=mercurial.configitems.dynamicdefault,
+    )
+    configitem(b'perf', b'run-limits',
+        default=mercurial.configitems.dynamicdefault,
+        experimental=True,
+    )
+except (ImportError, AttributeError):
+    pass
+except TypeError:
+    # compatibility fix for a11fd395e83f
+    # hg version: 5.2
+    configitem(b'perf', b'presleep',
+        default=mercurial.configitems.dynamicdefault,
     )
     configitem(b'perf', b'stub',
         default=mercurial.configitems.dynamicdefault,
@@ -260,8 +291,6 @@
     configitem(b'perf', b'run-limits',
         default=mercurial.configitems.dynamicdefault,
     )
-except (ImportError, AttributeError):
-    pass
 
 def getlen(ui):
     if ui.configbool(b"perf", b"stub", False):
--- a/hgext/fsmonitor/__init__.py	Wed Aug 14 16:11:45 2019 -0400
+++ b/hgext/fsmonitor/__init__.py	Tue Aug 20 18:35:16 2019 +0300
@@ -167,6 +167,7 @@
 )
 configitem('fsmonitor', 'verbose',
     default=True,
+    experimental=True,
 )
 configitem('experimental', 'fsmonitor.transaction_notify',
     default=False,
--- a/hgext/remotefilelog/__init__.py	Wed Aug 14 16:11:45 2019 -0400
+++ b/hgext/remotefilelog/__init__.py	Tue Aug 20 18:35:16 2019 +0300
@@ -219,7 +219,7 @@
 
 configitem('remotefilelog', 'gcrepack', default=False)
 configitem('remotefilelog', 'repackonhggc', default=False)
-configitem('repack', 'chainorphansbysize', default=True)
+configitem('repack', 'chainorphansbysize', default=True, experimental=True)
 
 configitem('packs', 'maxpacksize', default=0)
 configitem('packs', 'maxchainlen', default=1000)
--- a/hgext/sqlitestore.py	Wed Aug 14 16:11:45 2019 -0400
+++ b/hgext/sqlitestore.py	Tue Aug 20 18:35:16 2019 +0300
@@ -90,7 +90,8 @@
 
 # experimental config: storage.sqlite.compression
 configitem('storage', 'sqlite.compression',
-           default='zstd' if zstd else 'zlib')
+           default='zstd' if zstd else 'zlib',
+           experimental=True)
 
 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
--- a/mercurial/configitems.py	Wed Aug 14 16:11:45 2019 -0400
+++ b/mercurial/configitems.py	Tue Aug 20 18:35:16 2019 +0300
@@ -39,13 +39,14 @@
     """
 
     def __init__(self, section, name, default=None, alias=(),
-                 generic=False, priority=0):
+                 generic=False, priority=0, experimental=False):
         self.section = section
         self.name = name
         self.default = default
         self.alias = list(alias)
         self.generic = generic
         self.priority = priority
+        self.experimental = experimental
         self._re = None
         if generic:
             self._re = re.compile(self.name)
@@ -166,6 +167,7 @@
 )
 coreconfigitem('censor', 'policy',
     default='abort',
+    experimental=True,
 )
 coreconfigitem('chgserver', 'idletimeout',
     default=3600,
@@ -184,9 +186,11 @@
 )
 coreconfigitem('cmdserver', 'max-repo-cache',
     default=0,
+    experimental=True,
 )
 coreconfigitem('cmdserver', 'message-encodings',
     default=list,
+    experimental=True,
 )
 coreconfigitem('cmdserver', 'track-log',
     default=lambda: ['chgserver', 'cmdserver', 'repocache'],
@@ -207,6 +211,7 @@
 )
 coreconfigitem('commands', 'grep.all-files',
     default=False,
+    experimental=True,
 )
 coreconfigitem('commands', 'resolve.confirm',
     default=False,
@@ -226,6 +231,7 @@
 )
 coreconfigitem('commands', 'status.skipstates',
     default=[],
+    experimental=True,
 )
 coreconfigitem('commands', 'status.terse',
     default='',
@@ -314,6 +320,7 @@
 )
 coreconfigitem('convert', 'ignoreancestorcheck',
     default=False,
+    experimental=True,
 )
 coreconfigitem('convert', 'localtimezone',
     default=False,
@@ -687,18 +694,22 @@
 )
 coreconfigitem('format', 'chunkcachesize',
     default=None,
+    experimental=True,
 )
 coreconfigitem('format', 'dotencode',
     default=True,
 )
 coreconfigitem('format', 'generaldelta',
     default=False,
+    experimental=True,
 )
 coreconfigitem('format', 'manifestcachesize',
     default=None,
+    experimental=True,
 )
 coreconfigitem('format', 'maxchainlen',
     default=dynamicdefault,
+    experimental=True,
 )
 coreconfigitem('format', 'obsstore-version',
     default=None,
@@ -721,6 +732,7 @@
 )
 coreconfigitem('format', 'internal-phase',
     default=False,
+    experimental=True,
 )
 coreconfigitem('fsmonitor', 'warn_when_unused',
     default=True,
@@ -826,6 +838,7 @@
 )
 coreconfigitem('merge', 'preferancestor',
         default=lambda: ['*'],
+        experimental=True,
 )
 coreconfigitem('merge', 'strict-capability-check',
     default=False,
@@ -1010,6 +1023,7 @@
 )
 coreconfigitem('storage', 'new-repo-backend',
     default='revlogv1',
+    experimental=True,
 )
 coreconfigitem('storage', 'revlog.optimize-delta-parent-choice',
     default=True,
@@ -1120,6 +1134,7 @@
 )
 coreconfigitem('sparse', 'missingwarning',
     default=True,
+    experimental=True,
 )
 coreconfigitem('subrepos', 'allowed',
     default=dynamicdefault,  # to make backporting simpler
@@ -1466,6 +1481,7 @@
 )
 coreconfigitem('web', 'view',
     default='served',
+    experimental=True,
 )
 coreconfigitem('worker', 'backgroundclose',
     default=dynamicdefault,