Patchwork D1155: config: gather allowdivergence under the evolution namespace

login
register
mail settings
Submitter phabricator
Date Oct. 17, 2017, 3:05 p.m.
Message ID <differential-rev-PHID-DREV-zh2n4gexf3czgnut27bn-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/25113/
State Superseded
Headers show

Comments

phabricator - Oct. 17, 2017, 3:05 p.m.
lothiraldan created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Grouping all evolution related-config under the experimental.evolution
  namespace would helps the future migration outside [experimental].

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/rebase.py
  mercurial/configitems.py
  mercurial/help/config.txt
  tests/test-rebase-obsolete.t

CHANGE DETAILS




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


  I think this series overall cleans up the namespaces. I don't really love that evolution is still "hiding" under experimental but currently we don't have a way of marking non-"experimental" configs as experimental still so I guess this will have to suffice for now. I'll take a closer look tomorrow if nobody else gets to this first.

REPOSITORY
  rHG Mercurial

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

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


  I'm not a big fan of inserting `evolution` everywhere. It confuses people. I'd prefer things like `experimental.obsstore=bool`.

REPOSITORY
  rHG Mercurial

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

To: lothiraldan, #hg-reviewers
Cc: quark, ryanmce, mercurial-devel
phabricator - Oct. 18, 2017, 4:05 p.m.
indygreg accepted this revision.
indygreg added a comment.
This revision is now accepted and ready to land.


  @quark raises a valid point. The good thing is this is all under `[experimental]` which means there are no BC concerns. I'm all for bikeshedding a better naming strategy when things are marked as non-experimental. Until then, it isn't worth our time IMO.

REPOSITORY
  rHG Mercurial

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

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

Patch

diff --git a/tests/test-rebase-obsolete.t b/tests/test-rebase-obsolete.t
--- a/tests/test-rebase-obsolete.t
+++ b/tests/test-rebase-obsolete.t
@@ -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
diff --git a/mercurial/help/config.txt b/mercurial/help/config.txt
--- a/mercurial/help/config.txt
+++ b/mercurial/help/config.txt
@@ -1707,7 +1707,7 @@ 
 ``rebase``
 ----------
 
-``allowdivergence``
+``evolution.allowdivergence``
     Default to False, when True allow creating divergence when performing
     rebase of obsolete changesets.
 
diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -297,9 +297,6 @@ 
 coreconfigitem('email', 'reply-to',
     default=None,
 )
-coreconfigitem('experimental', 'allowdivergence',
-    default=False,
-)
 coreconfigitem('experimental', 'archivemetatemplate',
     default=dynamicdefault,
 )
@@ -342,6 +339,10 @@ 
 coreconfigitem('experimental', 'evolution',
     default=list,
 )
+coreconfigitem('experimental', 'evolution.allowdivergence',
+    default=False,
+    alias=[('experimental', 'allowdivergence')]
+)
 coreconfigitem('experimental', 'evolution.allowunstable',
     default=None,
 )
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -1075,16 +1075,16 @@ 
     """
     # 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:
         divhashes = (str(repo[r])
                      for r in divergencebasecandidates)
         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):