# HG changeset patch # User Denis Laxalde # Date 2018-02-07 11:06:13 # Node ID a603a570cdbeb19ae958585599200b05ac419d0c # Parent 07cd54eae696bb85f4d50d674f8e32056708559b rebase: add a test case for issue5782 Issue 5782 reports that rebase incorrectly aborts when trying to rebase an extinct revision (an obsolete revision with only obsolete successor). We add a test to demonstrate this: the first "hg rebase" command aborts with the divergence warning while, when allowing divergence, the rebase completes and does not actually produce any divergence. 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 @@ -1218,6 +1218,50 @@ Similar test on a more complex graph o 0:b173517d0057 a +issue5782 + $ hg strip -r 0: + $ hg debugdrawdag < d + > | + > c1 c # replace: c -> c1 + > \ / + > b + > | + > a + > EOF + 1 new orphan changesets + $ hg debugobsolete `hg log -T "{node}" --hidden -r 'desc("c1")'` + obsoleted 1 changesets + $ hg log -G -r 'a': --hidden + * 4:76be324c128b d + | + | x 3:ef8a456de8fa c1 (pruned) + | | + x | 2:a82ac2b38757 c (rewritten using replace as 3:ef8a456de8fa) + |/ + o 1:488e1b7e7341 b + | + o 0:b173517d0057 a + + $ hg rebase -d 0 -r 2 + abort: this rebase will cause divergences from: a82ac2b38757 + (to force the rebase please set experimental.evolution.allowdivergence=True) + [255] + $ hg rebase -d 0 -r 2 --config experimental.evolution.allowdivergence=True + rebasing 2:a82ac2b38757 "c" (c) + $ hg log -G -r 'a': --hidden + o 5:69ad416a4a26 c + | + | * 4:76be324c128b d + | | + | | x 3:ef8a456de8fa c1 (pruned) + | | | + | x | 2:a82ac2b38757 c (rewritten using replace as 3:ef8a456de8fa rewritten using rebase as 5:69ad416a4a26) + | |/ + | o 1:488e1b7e7341 b + |/ + o 0:b173517d0057 a + $ cd .. Rebase merge where successor of one parent is equal to destination (issue5198)