rebase: add a test case for issue5782
authorDenis Laxalde <denis.laxalde@logilab.fr>
Wed, 07 Feb 2018 12:06:13 +0100
changeset 35993 a603a570cdbe
parent 35992 07cd54eae696
child 35994 ae0d25071fca
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.
tests/test-rebase-obsolete.t
--- a/tests/test-rebase-obsolete.t	Fri Feb 09 13:18:17 2018 +0100
+++ b/tests/test-rebase-obsolete.t	Wed Feb 07 12:06:13 2018 +0100
@@ -1218,6 +1218,50 @@
   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)