# HG changeset patch
# User Denis Laxalde <denis.laxa...@logilab.fr>
# Date 1518001573 -3600
#      Wed Feb 07 12:06:13 2018 +0100
# Node ID 12c15d19266ee99f4d7de6c308286aa5c8a602a6
# Parent  2912bed9b0c7d02a1cac6f56584c0c0a2f9debe4
# EXP-Topic issue5782
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 <<EOF
+  >       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)
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to