--- a/tests/test-topic-stack.t Wed Sep 27 16:24:44 2017 +0200
+++ b/tests/test-topic-stack.t Sat Sep 30 11:11:04 2017 +0100
@@ -7,7 +7,7 @@
> [ui]
> logtemplate = {rev} {branch} \{{get(namespaces, "topics")}} {phase} {desc|firstline}\n
> [experimental]
- > evolution=createmarkers,exchange,allowunstable
+ > evolution=all
> EOF
$ hg init main
@@ -791,3 +791,125 @@
^ c_F
t1$ c_D (current unstable)
t0^ c_C (base)
+
+Test stack behavior with a split
+--------------------------------
+
+get things linear again
+
+ $ hg rebase -r t1 -d default
+ rebasing 16:1d84ec948370 "c_D" (tip)
+ switching to topic blue
+ $ hg rebase -r t2 -d t1
+ rebasing 13:3ab2eedae500 "c_G"
+ $ hg rebase -r t3 -d t2
+ rebasing 8:3bfe800e0486 "c_I"
+ $ hg stack
+ ### topic: blue
+ ### target: default (branch)
+ t3: c_I
+ t2: c_G
+ t1@ c_D (current)
+ t0^ c_A (base)
+
+making a split
+(first get something to split)
+
+ $ hg up t2
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg status --change .
+ A ggg
+ $ echo zzz > Z
+ $ hg add Z
+ $ hg commit --amend
+ $ hg status --change .
+ A Z
+ A ggg
+ $ hg stack
+ ### topic: blue
+ ### target: default (branch)
+ t3$ c_I (unstable)
+ t2@ c_G (current)
+ t1: c_D
+ t0^ c_A (base)
+ $ hg --config extensions.evolve= --config ui.interactive=yes split << EOF
+ > y
+ > y
+ > n
+ > y
+ > EOF
+ 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+ adding Z
+ adding ggg
+ diff --git a/Z b/Z
+ new file mode 100644
+ examine changes to 'Z'? [Ynesfdaq?] y
+
+ @@ -0,0 +1,1 @@
+ +zzz
+ record change 1/2 to 'Z'? [Ynesfdaq?] y
+
+ diff --git a/ggg b/ggg
+ new file mode 100644
+ examine changes to 'ggg'? [Ynesfdaq?] n
+
+ Done splitting? [yN] y
+
+ $ hg --config extensions.evolve= obslog --all
+ o dde94df880e9 (22) c_G
+ |
+ | @ e7ea874afbd5 (23) c_G
+ |/
+ x b24bab30ac12 (21) c_G
+ | rewritten(parent, content) as dde94df880e9, e7ea874afbd5 by test (Thu Jan 01 00:00:00 1970 +0000)
+ |
+ x 907f7d3c2333 (18) c_G
+ | rewritten as b24bab30ac12 by test (Thu Jan 01 00:00:00 1970 +0000)
+ |
+ x 3ab2eedae500 (13) c_G
+ | rewritten as 907f7d3c2333 by test (Thu Jan 01 00:00:00 1970 +0000)
+ |
+ x c7d60a180d05 (6) c_G
+ rewritten as 3ab2eedae500 by test (Thu Jan 01 00:00:00 1970 +0000)
+
+ $ hg export .
+ # HG changeset patch
+ # User test3
+ # Date 0 0
+ # Thu Jan 01 00:00:00 1970 +0000
+ # Node ID e7ea874afbd5c17aeee366d39a828dbcb01682ce
+ # Parent dde94df880e97f4a1ee8c5408254b429b3d90204
+ # EXP-Topic blue
+ c_G
+
+ diff -r dde94df880e9 -r e7ea874afbd5 ggg
+ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+ +++ b/ggg Thu Jan 01 00:00:00 1970 +0000
+ @@ -0,0 +1,1 @@
+ +ggg
+ $ hg export .^
+ # HG changeset patch
+ # User test3
+ # Date 0 0
+ # Thu Jan 01 00:00:00 1970 +0000
+ # Node ID dde94df880e97f4a1ee8c5408254b429b3d90204
+ # Parent f3328cd199dc389b850ca952f65a15a8e6dbc79b
+ # EXP-Topic blue
+ c_G
+
+ diff -r f3328cd199dc -r dde94df880e9 Z
+ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+ +++ b/Z Thu Jan 01 00:00:00 1970 +0000
+ @@ -0,0 +1,1 @@
+ +zzz
+
+Check that stack ouput still make sense
+
+ $ hg stack
+ ### topic: blue
+ ### target: default (branch)
+ t4$ c_I (unstable)
+ t3@ c_G (current)
+ t2: c_G
+ t1: c_D
+ t0^ c_A (base)