This instance will be upgraded to Heptapod 0.23.2 on 2021-08-05 at 11:00 UTC+2 (a few minutes of down time)

Commit 61b99ce7 authored by Anton Shestakov's avatar Anton Shestakov
Browse files

tests: add more merge+successors cases for stack

--HG--
branch : stable
parent 1d80cda7fe93
Pipeline #13684 passed with stage
in 4 minutes and 6 seconds
Stack and multiple successor sets of a parent of a merge
testing issue6424 and several "single successor" handling in stack code
$ . "$TESTDIR/testlib/topic_setup.sh"
$ . "$TESTDIR/testlib/common.sh"
$ cat << EOF >> $HGRCPATH
> [ui]
> logtemplate = {rev} {branch} \{{get(namespaces, "topics")}} {phase} {desc|firstline}\n
> [experimental]
> evolution = all
> [phases]
> publish = no
> EOF
Two template repos
$ hg init stack-merge-1-topic
$ cd stack-merge-1-topic
$ hg topic tofu
marked working directory as topic: tofu
$ echo a > A
$ hg ci -qAm A0
$ echo b > B
$ hg ci -qAm B0
$ hg up 'desc("A0")' -q
$ echo c > C
$ hg ci -qAm C0
$ hg merge 'desc("B0")' -q
$ hg ci -m merge
$ hg log -G
@ 3 default {tofu} draft merge
|\
| o 2 default {tofu} draft C0
| |
o | 1 default {tofu} draft B0
|/
o 0 default {tofu} draft A0
$ hg log -r 'p1(desc("merge"))' -T '{desc}\n'
C0
$ hg log -r 'p2(desc("merge"))' -T '{desc}\n'
B0
$ cd ..
$ hg init stack-merge-2-topics
$ cd stack-merge-2-topics
$ hg topic tofu
marked working directory as topic: tofu
$ echo a > A
$ hg ci -qAm A0
$ echo b > B
$ hg ci -qAm B0
$ hg up 'desc("A0")' -q
$ hg topic futon
$ echo c > C
$ hg ci -qAm C0
$ hg merge 'desc("B0")' -q
$ hg ci -m merge
$ hg log -G
@ 3 default {futon} draft merge
|\
| o 2 default {futon} draft C0
| |
o | 1 default {tofu} draft B0
|/
o 0 default {tofu} draft A0
$ hg log -r 'p1(desc("merge"))' -T '{desc}\n'
C0
$ hg log -r 'p2(desc("merge"))' -T '{desc}\n'
B0
$ cd ..
Let's make p1 of the merge commit have multiple unrelated successors
(successors are siblings)
$ hg clone -U stack-merge-1-topic stack-merge-p1-siblings
$ cd stack-merge-p1-siblings
$ hg up 'desc("C0")' -q
$ HGUSER=alice hg ci --amend -m 'C1'
1 new orphan changesets
$ hg up --hidden 'desc("C0")' -q
$ HGUSER=bob hg ci --amend -m 'C2'
2 new content-divergent changesets
$ hg log -G
@ 5 default {tofu} draft C2
|
| * 4 default {tofu} draft C1
|/
| * 3 default {tofu} draft merge
| |\
+---x 2 default {tofu} draft C0
| |
| o 1 default {tofu} draft B0
|/
o 0 default {tofu} draft A0
$ hg stack 2>&1 | tail -n 1
AttributeError: 'list' object has no attribute 'add'
$ cd ..
Let's make p2 of the merge commit have multiple unrelated successors
$ hg clone -U stack-merge-1-topic stack-merge-p2-siblings
$ cd stack-merge-p2-siblings
$ hg up 'desc("B0")' -q
$ HGUSER=alice hg ci --amend -m 'B1'
1 new orphan changesets
$ hg up --hidden 'desc("B0")' -q
$ HGUSER=bob hg ci --amend -m 'B2'
2 new content-divergent changesets
$ hg log -G
@ 5 default {tofu} draft B2
|
| * 4 default {tofu} draft B1
|/
| * 3 default {tofu} draft merge
| |\
+---o 2 default {tofu} draft C0
| |
| x 1 default {tofu} draft B0
|/
o 0 default {tofu} draft A0
$ hg stack 2>&1 | tail -n 1
ValueError: list.remove(x): x not in list
$ cd ..
Let's make p1 of the merge commit have multiple unrelated successors
(successors are parent-child)
$ hg clone -U stack-merge-2-topics stack-merge-p1-parent-child
$ cd stack-merge-p1-parent-child
$ hg up 'desc("A0")' -q
$ hg topic futon
$ echo 1 > C
$ hg ci -qAm C1
$ echo 2 > C
$ hg ci -qAm C2
$ hg debugobsolete `getid 'desc("C0")'` `getid 'desc("C1")'`
1 new obsolescence markers
obsoleted 1 changesets
1 new orphan changesets
$ hg debugobsolete `getid 'desc("C0")'` `getid 'desc("C2")'`
1 new obsolescence markers
2 new content-divergent changesets
$ hg log -G
@ 5 default {futon} draft C2
|
* 4 default {futon} draft C1
|
| * 3 default {futon} draft merge
| |\
+---x 2 default {futon} draft C0
| |
| o 1 default {tofu} draft B0
|/
o 0 default {tofu} draft A0
$ hg stack 2>&1 | tail -n 1
hgext3rd.topic.evolvebits.MultipleSuccessorsError* (glob)
$ cd ..
Let's make p1 of the merge commit have multiple unrelated successors
(unusual situation: successors are on top of p1)
$ hg clone -U stack-merge-2-topics stack-merge-p1-unusual-parent
$ cd stack-merge-p1-unusual-parent
$ hg up 'desc("C0")' -q
$ hg topic futon
$ echo 1 > C
$ hg ci -qAm C1
$ echo 2 > C
$ hg ci -qAm C2
$ hg debugobsolete `getid 'desc("C0")'` `getid 'desc("C1")'`
1 new obsolescence markers
obsoleted 1 changesets
3 new orphan changesets
$ hg debugobsolete `getid 'desc("C0")'` `getid 'desc("C2")'`
1 new obsolescence markers
2 new content-divergent changesets
$ hg log -G
@ 5 default {futon} draft C2
|
* 4 default {futon} draft C1
|
| * 3 default {futon} draft merge
|/|
x | 2 default {futon} draft C0
| |
| o 1 default {tofu} draft B0
|/
o 0 default {tofu} draft A0
XXX same traceback, different place
$ hg stack 2>&1 | tail -n 1
hgext3rd.topic.evolvebits.MultipleSuccessorsError* (glob)
$ cd ..
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment