changeset 28280:dc6032a1d888

rebase: remove experimental option from 'rebase' config section Changeset f0e9f38d250f introduced a guard against case where obsolete changesets are included in the rebase in a way this will result in divergence (because rebase create new successors for changeset which already have successors). In the same go a 'rebase.allowdivergence' option was introduced to control that behavior. We rename this config option to 'experimental.allowdivergence' for multiple reasons: * First this behavior is attached to changeset evolution, a feature still experimental. * Second, there was no 'rebase' section in config before we introduced this option. I would like to avoid proliferation of micro config section and therefore would like to avoid the creation of this new section just for an experimental feature. * Third, this guard (warning the user about a history rewriting operation that will create divergence) will very likely be generalised to all history rewriting operations, making this not rebase specific. * Finally, because this will likely be a general guard present a bit everywhere in the UI we'll likely end up with something better than a config option to control this behavior, so having the current config option living in experimental will allow us make it disappear in the future. So we banish this config option back to the experimental section where it belongs, killing the newly born 'rebase' config section in the process.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Sat, 27 Feb 2016 18:02:12 +0100
parents c1fbc92d6238
children 4ef967661751
files hgext/rebase.py tests/test-rebase-obsolete.t
diffstat 2 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/rebase.py	Fri Feb 26 17:15:49 2016 +0000
+++ b/hgext/rebase.py	Sat Feb 27 18:02:12 2016 +0100
@@ -306,7 +306,7 @@
                 rebaseobsskipped = set(obsoletenotrebased)
 
                 # Obsolete node with successors not in dest leads to divergence
-                divergenceok = ui.configbool('rebase',
+                divergenceok = ui.configbool('experimental',
                                              'allowdivergence')
                 divergencebasecandidates = rebaseobsrevs - rebaseobsskipped
 
@@ -316,7 +316,7 @@
                     msg = _("this rebase will cause "
                             "divergences from: %s")
                     h = _("to force the rebase please set "
-                          "rebase.allowdivergence=True")
+                          "experimental.allowdivergence=True")
                     raise error.Abort(msg % (",".join(divhashes),), hint=h)
 
                 # - plain prune (no successor) changesets are rebased
--- a/tests/test-rebase-obsolete.t	Fri Feb 26 17:15:49 2016 +0000
+++ b/tests/test-rebase-obsolete.t	Sat Feb 27 18:02:12 2016 +0100
@@ -772,7 +772,7 @@
   unstable: 1 changesets
   $ hg rebase -s 10 -d 12
   abort: this rebase will cause divergences from: 121d9e3bc4c6
-  (to force the rebase please set rebase.allowdivergence=True)
+  (to force the rebase please set experimental.allowdivergence=True)
   [255]
   $ hg log -G
   @  15:73568ab6879d bar foo
@@ -791,9 +791,9 @@
   |
   o  0:4a2df7238c3b A
   
-With rebase.allowdivergence=True, rebase can create divergence
+With experimental.allowdivergence=True, rebase can create divergence
 
-  $ hg rebase -s 10 -d 12 --config rebase.allowdivergence=True
+  $ hg rebase -s 10 -d 12 --config experimental.allowdivergence=True
   rebasing 10:121d9e3bc4c6 "P"
   rebasing 15:73568ab6879d "bar foo" (tip)
   $ hg summary