D10272: rebase: drop support for rebaseskipobsolete config
martinvonz (Martin von Zweigbergk)
phabricator at mercurial-scm.org
Thu Mar 25 23:36:41 UTC 2021
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.
REVISION SUMMARY
`hg rebase` has been able to skip obsolete commits since 92409f8dff5d <https://phab.mercurial-scm.org/rHG92409f8dff5d0d6d0b6c73653b2e356eac5679bc>
(rebase: don't rebase obsolete commit whose successor is already
rebased, 2015-09-14). That commit introduced the
`experimental.rebaseskipobsolete` config and set it to false by
default to start with. Then it has been enabled by default since
a47881680402 <https://phab.mercurial-scm.org/rHGa478816804023a2ad517b86d6091a73fc53f702f> (rebase: turn rebaseskipobsolete on by default,
2016-03-09).
It seems to me that all use cases for turning off the config are
covered by `hg rebase --keep`, `hg graft`, or `hg touch`. The use
cases I can think of are:
1. Create a temporary copy of a set of commits for some experimentation (use `hg rebase --keep` or `hg graft`).
2. Revive a pruned commit (use `hg touch`, possibly followed by `hg rebase` if you want to move it elsewhere).
Also, it is a config option after all, which means that it is not
intended for one-off `hg rebase` commands (then it would have been a
command-line flag). So, let's drop support for this config since it
seems unused. It will make my work on making `rewriteutil.precheck()`
check for divergence slightly simpler.
REPOSITORY
rHG Mercurial
BRANCH
default
REVISION DETAIL
https://phab.mercurial-scm.org/D10272
AFFECTED FILES
hgext/rebase.py
mercurial/configitems.py
relnotes/next
tests/test-rebase-obsolete2.t
tests/test-rebase-obsolete3.t
CHANGE DETAILS
diff --git a/tests/test-rebase-obsolete3.t b/tests/test-rebase-obsolete3.t
--- a/tests/test-rebase-obsolete3.t
+++ b/tests/test-rebase-obsolete3.t
@@ -156,17 +156,6 @@
|/
o 0:b173517d0057 a
- $ hg strip -r 8:
-
-(Not skipping obsoletes means that divergence is allowed.)
-
- $ hg rebase --config experimental.rebaseskipobsolete=false -r 'c'::'f' -d 'x'
- rebasing 3:a82ac2b38757 c "c"
- rebasing 4:76be324c128b d "d"
- rebasing 7:1143e9adc121 f tip "f"
- 1 new orphan changesets
- 2 new content-divergent changesets
-
$ hg strip -r 0:
Similar test on a more complex graph
diff --git a/tests/test-rebase-obsolete2.t b/tests/test-rebase-obsolete2.t
--- a/tests/test-rebase-obsolete2.t
+++ b/tests/test-rebase-obsolete2.t
@@ -26,8 +26,6 @@
$ hg init obsskip
$ cd obsskip
$ cat << EOF >> .hg/hgrc
- > [experimental]
- > rebaseskipobsolete = True
> [extensions]
> strip =
> EOF
diff --git a/relnotes/next b/relnotes/next
--- a/relnotes/next
+++ b/relnotes/next
@@ -33,6 +33,10 @@
change the output of `hg log` when explicitly asking for first or
second parent.
+ * The `experimental.rebaseskipobsolete` config was removed. Obsolete
+ commits continue to be skipped as they have been for many
+ years.
+
== Internal API Changes ==
diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -2658,11 +2658,6 @@
default=False,
)
coreconfigitem(
- b'experimental',
- b'rebaseskipobsolete',
- default=True,
-)
-coreconfigitem(
b'rebase',
b'singletransaction',
default=False,
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -352,8 +352,6 @@
"""Compute structures necessary for skipping obsolete revisions"""
if self.keepf:
return
- if not self.ui.configbool(b'experimental', b'rebaseskipobsolete'):
- return
obsoleteset = {r for r in self.state if self.repo[r].obsolete()}
(
self.obsolete_with_successor_in_destination,
To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
More information about the Mercurial-devel
mailing list