Mercurial > hg
comparison hgext/rebase.py @ 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 | fac3a24be50e |
children | dcb4209bd30d |
comparison
equal
deleted
inserted
replaced
28279:c1fbc92d6238 | 28280:dc6032a1d888 |
---|---|
304 rebaseobsrevs, | 304 rebaseobsrevs, |
305 dest) | 305 dest) |
306 rebaseobsskipped = set(obsoletenotrebased) | 306 rebaseobsskipped = set(obsoletenotrebased) |
307 | 307 |
308 # Obsolete node with successors not in dest leads to divergence | 308 # Obsolete node with successors not in dest leads to divergence |
309 divergenceok = ui.configbool('rebase', | 309 divergenceok = ui.configbool('experimental', |
310 'allowdivergence') | 310 'allowdivergence') |
311 divergencebasecandidates = rebaseobsrevs - rebaseobsskipped | 311 divergencebasecandidates = rebaseobsrevs - rebaseobsskipped |
312 | 312 |
313 if divergencebasecandidates and not divergenceok: | 313 if divergencebasecandidates and not divergenceok: |
314 divhashes = (str(repo[r]) | 314 divhashes = (str(repo[r]) |
315 for r in divergencebasecandidates) | 315 for r in divergencebasecandidates) |
316 msg = _("this rebase will cause " | 316 msg = _("this rebase will cause " |
317 "divergences from: %s") | 317 "divergences from: %s") |
318 h = _("to force the rebase please set " | 318 h = _("to force the rebase please set " |
319 "rebase.allowdivergence=True") | 319 "experimental.allowdivergence=True") |
320 raise error.Abort(msg % (",".join(divhashes),), hint=h) | 320 raise error.Abort(msg % (",".join(divhashes),), hint=h) |
321 | 321 |
322 # - plain prune (no successor) changesets are rebased | 322 # - plain prune (no successor) changesets are rebased |
323 # - split changesets are not rebased if at least one of the | 323 # - split changesets are not rebased if at least one of the |
324 # changeset resulting from the split is an ancestor of dest | 324 # changeset resulting from the split is an ancestor of dest |