changeset 34872:29f52e7966dd

config: gather allowdivergence under the evolution namespace Grouping all evolution related-config under the experimental.evolution namespace would helps the future migration outside [experimental]. Differential Revision: https://phab.mercurial-scm.org/D1155
author Boris Feld <boris.feld@octobus.net>
date Tue, 17 Oct 2017 16:54:31 +0200
parents 28fd13076962
children aa849cf5d089
files hgext/rebase.py mercurial/configitems.py mercurial/help/config.txt tests/test-rebase-obsolete.t
diffstat 4 files changed, 10 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/rebase.py	Tue Oct 17 15:57:56 2017 +0200
+++ b/hgext/rebase.py	Tue Oct 17 16:54:31 2017 +0200
@@ -1061,7 +1061,7 @@
     """
     # Obsolete node with successors not in dest leads to divergence
     divergenceok = ui.configbool('experimental',
-                                 'allowdivergence')
+                                 'evolution.allowdivergence')
     divergencebasecandidates = rebaseobsrevs - rebaseobsskipped
 
     if divergencebasecandidates and not divergenceok:
@@ -1070,7 +1070,7 @@
         msg = _("this rebase will cause "
                 "divergences from: %s")
         h = _("to force the rebase please set "
-              "experimental.allowdivergence=True")
+              "experimental.evolution.allowdivergence=True")
         raise error.Abort(msg % (",".join(divhashes),), hint=h)
 
 def successorrevs(unfi, rev):
--- a/mercurial/configitems.py	Tue Oct 17 15:57:56 2017 +0200
+++ b/mercurial/configitems.py	Tue Oct 17 16:54:31 2017 +0200
@@ -300,9 +300,6 @@
 coreconfigitem('email', 'reply-to',
     default=None,
 )
-coreconfigitem('experimental', 'allowdivergence',
-    default=False,
-)
 coreconfigitem('experimental', 'archivemetatemplate',
     default=dynamicdefault,
 )
@@ -348,6 +345,10 @@
 coreconfigitem('experimental', 'evolution',
     default=list,
 )
+coreconfigitem('experimental', 'evolution.allowdivergence',
+    default=False,
+    alias=[('experimental', 'allowdivergence')]
+)
 coreconfigitem('experimental', 'evolution.allowunstable',
     default=None,
 )
--- a/mercurial/help/config.txt	Tue Oct 17 15:57:56 2017 +0200
+++ b/mercurial/help/config.txt	Tue Oct 17 16:54:31 2017 +0200
@@ -1707,7 +1707,7 @@
 ``rebase``
 ----------
 
-``allowdivergence``
+``evolution.allowdivergence``
     Default to False, when True allow creating divergence when performing
     rebase of obsolete changesets.
 
--- a/tests/test-rebase-obsolete.t	Tue Oct 17 15:57:56 2017 +0200
+++ b/tests/test-rebase-obsolete.t	Tue Oct 17 16:54:31 2017 +0200
@@ -826,7 +826,7 @@
   orphan: 1 changesets
   $ hg rebase -s 10 -d 12
   abort: this rebase will cause divergences from: 121d9e3bc4c6
-  (to force the rebase please set experimental.allowdivergence=True)
+  (to force the rebase please set experimental.evolution.allowdivergence=True)
   [255]
   $ hg log -G
   @  14:73568ab6879d bar foo
@@ -845,9 +845,9 @@
   |
   o  0:4a2df7238c3b A
   
-With experimental.allowdivergence=True, rebase can create divergence
+With experimental.evolution.allowdivergence=True, rebase can create divergence
 
-  $ hg rebase -s 10 -d 12 --config experimental.allowdivergence=True
+  $ hg rebase -s 10 -d 12 --config experimental.evolution.allowdivergence=True
   rebasing 10:121d9e3bc4c6 "P"
   rebasing 14:73568ab6879d "bar foo" (tip)
   $ hg summary