Patchwork D6728: config: add experimental argument to the config registrar

login
register
mail settings
Submitter phabricator
Date Aug. 15, 2019, 2:22 p.m.
Message ID <differential-rev-PHID-DREV-yq422ggrpx76lep7k7hn-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/41298/
State Superseded
Headers show

Comments

phabricator - Aug. 15, 2019, 2:22 p.m.
navaneeth.suresh created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6728

AFFECTED FILES
  contrib/perf.py
  hgext/fsmonitor/__init__.py
  hgext/remotefilelog/__init__.py
  hgext/sqlitestore.py
  mercurial/configitems.py

CHANGE DETAILS




To: navaneeth.suresh, #hg-reviewers
Cc: mercurial-devel
phabricator - Aug. 17, 2019, 7:25 p.m.
pulkit added inline comments.

INLINE COMMENTS

> perf.py:244
>          default=mercurial.configitems.dynamicdefault,
> +        experimental=True,
>      )

This breaks `contrib/perf.py` with older versions of mercurial. Can you send a compatibility fix as followup?

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6728/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6728

To: navaneeth.suresh, #hg-reviewers
Cc: pulkit, mercurial-devel
phabricator - Aug. 18, 2019, 11:56 a.m.
navaneeth.suresh added inline comments.

INLINE COMMENTS

> pulkit wrote in perf.py:244
> This breaks `contrib/perf.py` with older versions of mercurial. Can you send a compatibility fix as followup?

I'm not sure I understood that. Do you want me to remove the changes in `contrib/perf.py`?

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6728/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6728

To: navaneeth.suresh, #hg-reviewers
Cc: pulkit, mercurial-devel
Pierre-Yves David - Aug. 19, 2019, 2:10 p.m.
This change breaks contrib/perf.py on older version (that extension is 
special and we expect it to be compatible with older version). Can you 
follow up with a fix ?

(note: when doing this kind of change it is often useful to have 
different patch for adding the feature and using it. It help to deal 
with this kind of case).

On 8/15/19 4:22 PM, navaneeth.suresh (Navaneeth Suresh) wrote:
> navaneeth.suresh created this revision.
> Herald added a subscriber: mercurial-devel.
> Herald added a reviewer: hg-reviewers.
> 
> REVISION SUMMARY
>    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.
> 
> REPOSITORY
>    rHG Mercurial
> 
> REVISION DETAIL
>    https://phab.mercurial-scm.org/D6728
> 
> AFFECTED FILES
>    contrib/perf.py
>    hgext/fsmonitor/__init__.py
>    hgext/remotefilelog/__init__.py
>    hgext/sqlitestore.py
>    mercurial/configitems.py
> 
> CHANGE DETAILS
> 
> diff --git a/mercurial/configitems.py b/mercurial/configitems.py
> --- a/mercurial/configitems.py
> +++ b/mercurial/configitems.py
> @@ -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,
> @@ -684,18 +691,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,
> @@ -718,6 +729,7 @@
>   )
>   coreconfigitem('format', 'internal-phase',
>       default=False,
> +    experimental=True,
>   )
>   coreconfigitem('fsmonitor', 'warn_when_unused',
>       default=True,
> @@ -823,6 +835,7 @@
>   )
>   coreconfigitem('merge', 'preferancestor',
>           default=lambda: ['*'],
> +        experimental=True,
>   )
>   coreconfigitem('merge', 'strict-capability-check',
>       default=False,
> @@ -1007,6 +1020,7 @@
>   )
>   coreconfigitem('storage', 'new-repo-backend',
>       default='revlogv1',
> +    experimental=True,
>   )
>   coreconfigitem('storage', 'revlog.optimize-delta-parent-choice',
>       default=True,
> @@ -1117,6 +1131,7 @@
>   )
>   coreconfigitem('sparse', 'missingwarning',
>       default=True,
> +    experimental=True,
>   )
>   coreconfigitem('subrepos', 'allowed',
>       default=dynamicdefault,  # to make backporting simpler
> @@ -1463,6 +1478,7 @@
>   )
>   coreconfigitem('web', 'view',
>       default='served',
> +    experimental=True,
>   )
>   coreconfigitem('worker', 'backgroundclose',
>       default=dynamicdefault,
> diff --git a/hgext/sqlitestore.py b/hgext/sqlitestore.py
> --- a/hgext/sqlitestore.py
> +++ b/hgext/sqlitestore.py
> @@ -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
> diff --git a/hgext/remotefilelog/__init__.py b/hgext/remotefilelog/__init__.py
> --- a/hgext/remotefilelog/__init__.py
> +++ b/hgext/remotefilelog/__init__.py
> @@ -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)
> diff --git a/hgext/fsmonitor/__init__.py b/hgext/fsmonitor/__init__.py
> --- a/hgext/fsmonitor/__init__.py
> +++ b/hgext/fsmonitor/__init__.py
> @@ -167,6 +167,7 @@
>   )
>   configitem('fsmonitor', 'verbose',
>       default=True,
> +    experimental=True,
>   )
>   configitem('experimental', 'fsmonitor.transaction_notify',
>       default=False,
> diff --git a/contrib/perf.py b/contrib/perf.py
> --- a/contrib/perf.py
> +++ b/contrib/perf.py
> @@ -241,15 +241,19 @@
>       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,
> @@ -259,6 +263,7 @@
>       )
>       configitem(b'perf', b'run-limits',
>           default=mercurial.configitems.dynamicdefault,
> +        experimental=True,
>       )
>   except (ImportError, AttributeError):
>       pass
> 
> 
> 
> To: navaneeth.suresh, #hg-reviewers
> Cc: mercurial-devel
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>

Patch

diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -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,
@@ -684,18 +691,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,
@@ -718,6 +729,7 @@ 
 )
 coreconfigitem('format', 'internal-phase',
     default=False,
+    experimental=True,
 )
 coreconfigitem('fsmonitor', 'warn_when_unused',
     default=True,
@@ -823,6 +835,7 @@ 
 )
 coreconfigitem('merge', 'preferancestor',
         default=lambda: ['*'],
+        experimental=True,
 )
 coreconfigitem('merge', 'strict-capability-check',
     default=False,
@@ -1007,6 +1020,7 @@ 
 )
 coreconfigitem('storage', 'new-repo-backend',
     default='revlogv1',
+    experimental=True,
 )
 coreconfigitem('storage', 'revlog.optimize-delta-parent-choice',
     default=True,
@@ -1117,6 +1131,7 @@ 
 )
 coreconfigitem('sparse', 'missingwarning',
     default=True,
+    experimental=True,
 )
 coreconfigitem('subrepos', 'allowed',
     default=dynamicdefault,  # to make backporting simpler
@@ -1463,6 +1478,7 @@ 
 )
 coreconfigitem('web', 'view',
     default='served',
+    experimental=True,
 )
 coreconfigitem('worker', 'backgroundclose',
     default=dynamicdefault,
diff --git a/hgext/sqlitestore.py b/hgext/sqlitestore.py
--- a/hgext/sqlitestore.py
+++ b/hgext/sqlitestore.py
@@ -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
diff --git a/hgext/remotefilelog/__init__.py b/hgext/remotefilelog/__init__.py
--- a/hgext/remotefilelog/__init__.py
+++ b/hgext/remotefilelog/__init__.py
@@ -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)
diff --git a/hgext/fsmonitor/__init__.py b/hgext/fsmonitor/__init__.py
--- a/hgext/fsmonitor/__init__.py
+++ b/hgext/fsmonitor/__init__.py
@@ -167,6 +167,7 @@ 
 )
 configitem('fsmonitor', 'verbose',
     default=True,
+    experimental=True,
 )
 configitem('experimental', 'fsmonitor.transaction_notify',
     default=False,
diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -241,15 +241,19 @@ 
     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,
@@ -259,6 +263,7 @@ 
     )
     configitem(b'perf', b'run-limits',
         default=mercurial.configitems.dynamicdefault,
+        experimental=True,
     )
 except (ImportError, AttributeError):
     pass