Patchwork D1117: config: simplify aliasing commands.update.check

login
register
mail settings
Submitter phabricator
Date Oct. 16, 2017, 5:13 p.m.
Message ID <differential-rev-PHID-DREV-jgga7ilvajztzqo67thn-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/25014/
State Superseded
Headers show

Comments

phabricator - Oct. 16, 2017, 5:13 p.m.
lothiraldan created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  experimental.updatecheck was renamed into commands.update.check, use the
  config system to provides the fallback on the old config name instead of
  adding more code.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/configitems.py
  mercurial/hg.py

CHANGE DETAILS




To: lothiraldan, #hg-reviewers
Cc: mercurial-devel
phabricator - Oct. 17, 2017, 1:01 a.m.
durin42 requested changes to this revision.
durin42 added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> configitems.py:184
>      default=None,
> +    alias=[('experimental', 'updatecheck')]
>  )

Please add the comment that this alias should be discarded post-4.4?

REPOSITORY
  rHG Mercurial

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

To: lothiraldan, #hg-reviewers, durin42
Cc: durin42, mercurial-devel
phabricator - Oct. 17, 2017, 12:07 p.m.
lothiraldan marked an inline comment as done.
lothiraldan added a comment.


  I've added the comment, but I think we should keep the alias until we have a way to warn people they use deprecated config aliases.

REPOSITORY
  rHG Mercurial

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

To: lothiraldan, #hg-reviewers, durin42
Cc: durin42, mercurial-devel
phabricator - Oct. 17, 2017, 12:13 p.m.
ryanmce accepted this revision.
ryanmce added a comment.


  I agree with @lothiraldan  that there's no pressing need to remove aliases, and we should have a mechanism to work before we do this for sure.
  
  This seems like exactly one of the reasons the config registration system was built in the first place -- to permanently (or semi-permanently at least) forward old configs to new ones, to allow smooth config upgrade paths.
  
  I'll queue this as-is but I think we should not necessarily drop this in the future.

REPOSITORY
  rHG Mercurial

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

To: lothiraldan, #hg-reviewers, durin42, ryanmce
Cc: ryanmce, durin42, mercurial-devel
phabricator - Oct. 17, 2017, 12:17 p.m.
ryanmce added a comment.


  queued

REPOSITORY
  rHG Mercurial

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

To: lothiraldan, #hg-reviewers, durin42, ryanmce
Cc: ryanmce, durin42, mercurial-devel

Patch

diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -758,9 +758,6 @@ 
     """
     if updatecheck is None:
         updatecheck = ui.config('commands', 'update.check')
-        if updatecheck is None:
-            # pre-4.4 compat on the old spelling of this config item
-            updatecheck = ui.config('experimental', 'updatecheck')
         if updatecheck not in ('abort', 'none', 'linear', 'noconflict'):
             # If not configured, or invalid value configured
             updatecheck = 'linear'
diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -181,6 +181,7 @@ 
 )
 coreconfigitem('commands', 'update.check',
     default=None,
+    alias=[('experimental', 'updatecheck')]
 )
 coreconfigitem('commands', 'update.requiredest',
     default=False,
@@ -412,10 +413,6 @@ 
 coreconfigitem('experimental', 'treemanifest',
     default=False,
 )
-# Deprecated, remove after 4.4 release
-coreconfigitem('experimental', 'updatecheck',
-    default=None,
-)
 coreconfigitem('extensions', '.*',
     default=None,
     generic=True,