author | Pierre-Yves David <pierre-yves.david@octobus.net> |
Wed, 24 Apr 2019 14:38:26 +0200 | |
changeset 4574 | 5e8c47c553db |
parent 4468 | a2273aa71a4b |
child 4516 | f54bb6eaf5e6 |
child 4577 | bcd52ce0916d |
permissions | -rw-r--r-- |
4468
a2273aa71a4b
test: rename and clarify content of test-unstable-orphan.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
3540
diff
changeset
|
1 |
================================== |
a2273aa71a4b
test: rename and clarify content of test-unstable-orphan.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
3540
diff
changeset
|
2 |
Test for "orphan" type instability |
a2273aa71a4b
test: rename and clarify content of test-unstable-orphan.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
3540
diff
changeset
|
3 |
================================== |
a2273aa71a4b
test: rename and clarify content of test-unstable-orphan.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
3540
diff
changeset
|
4 |
|
a2273aa71a4b
test: rename and clarify content of test-unstable-orphan.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
3540
diff
changeset
|
5 |
This file gather test case around the "orphan" changeset instability. This |
a2273aa71a4b
test: rename and clarify content of test-unstable-orphan.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
3540
diff
changeset
|
6 |
instability happens when a changesets has obsolete ancestors. |
a2273aa71a4b
test: rename and clarify content of test-unstable-orphan.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
3540
diff
changeset
|
7 |
|
1479
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
8 |
$ cat >> $HGRCPATH <<EOF |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
9 |
> [defaults] |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
10 |
> amend=-d "0 0" |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
11 |
> fold=-d "0 0" |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
12 |
> [web] |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
13 |
> push_ssl = false |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
14 |
> allow_push = * |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
15 |
> [phases] |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
16 |
> publish = False |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
17 |
> [diff] |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
18 |
> git = 1 |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
19 |
> unified = 0 |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
20 |
> [ui] |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
21 |
> logtemplate = {rev}:{node|short}@{branch}({phase}) {desc|firstline}\n |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
22 |
> [extensions] |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
23 |
> EOF |
1806
9f42f819267b
evolve: move the extensions to 'hgext3rd'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
1639
diff
changeset
|
24 |
$ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH |
1479
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
25 |
$ mkcommit() { |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
26 |
> echo "$1" > "$1" |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
27 |
> hg add "$1" |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
28 |
> hg ci -m "add $1" |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
29 |
> } |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
30 |
|
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
31 |
$ mkstack() { |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
32 |
> # Creates a stack of commit based on $1 with messages from $2, $3 .. |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
33 |
> hg update "$1" -C |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
34 |
> shift |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
35 |
> mkcommits $* |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
36 |
> } |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
37 |
|
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
38 |
$ mkcommits() { |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
39 |
> for i in $@; do mkcommit $i ; done |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
40 |
> } |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
41 |
|
4468
a2273aa71a4b
test: rename and clarify content of test-unstable-orphan.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
3540
diff
changeset
|
42 |
orphan parent is obsolete with a single successor |
a2273aa71a4b
test: rename and clarify content of test-unstable-orphan.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
3540
diff
changeset
|
43 |
================================================= |
a2273aa71a4b
test: rename and clarify content of test-unstable-orphan.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
3540
diff
changeset
|
44 |
|
a2273aa71a4b
test: rename and clarify content of test-unstable-orphan.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
3540
diff
changeset
|
45 |
Test orphan resolution for a changeset orphan because its parent is obsolete |
a2273aa71a4b
test: rename and clarify content of test-unstable-orphan.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
3540
diff
changeset
|
46 |
with one successor. |
a2273aa71a4b
test: rename and clarify content of test-unstable-orphan.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
3540
diff
changeset
|
47 |
|
1479
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
48 |
$ hg init test1 |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
49 |
$ cd test1 |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
50 |
$ mkcommits _a _b _c |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
51 |
$ hg up "desc(_b)" |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
52 |
0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
53 |
$ hg amend -m "bprime" |
3013
945a0989e41b
packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
3000
diff
changeset
|
54 |
1 new orphan changesets |
1479
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
55 |
$ hg log -G |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
56 |
@ 3:36050226a9b9@default(draft) bprime |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
57 |
| |
3417
d3a17c67f85c
branching: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
3411
diff
changeset
|
58 |
| * 2:102002290587@default(draft) add _c |
1479
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
59 |
| | |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
60 |
| x 1:37445b16603b@default(draft) add _b |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
61 |
|/ |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
62 |
o 0:135f39f4bd78@default(draft) add _a |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
63 |
|
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
64 |
|
2834
38db1466c6fb
log: unstable was renamed into orphan
Boris Feld <boris.feld@octobus.net>
parents:
2776
diff
changeset
|
65 |
$ hg evo --all --any --orphan |
1479
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
66 |
move:[2] add _c |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
67 |
atop:[3] bprime |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
68 |
working directory is now at fdcf3523a74d |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
69 |
$ hg log -G |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
70 |
@ 4:fdcf3523a74d@default(draft) add _c |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
71 |
| |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
72 |
o 3:36050226a9b9@default(draft) bprime |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
73 |
| |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
74 |
o 0:135f39f4bd78@default(draft) add _a |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
75 |
|
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
76 |
|
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
77 |
$ cd .. |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
78 |
|
4468
a2273aa71a4b
test: rename and clarify content of test-unstable-orphan.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
3540
diff
changeset
|
79 |
|
a2273aa71a4b
test: rename and clarify content of test-unstable-orphan.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
3540
diff
changeset
|
80 |
orphan parent is obsolete with a multiple successors (reversed order) |
a2273aa71a4b
test: rename and clarify content of test-unstable-orphan.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
3540
diff
changeset
|
81 |
===================================================================== |
a2273aa71a4b
test: rename and clarify content of test-unstable-orphan.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
3540
diff
changeset
|
82 |
|
a2273aa71a4b
test: rename and clarify content of test-unstable-orphan.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
3540
diff
changeset
|
83 |
Test orphan resolution for a changeset orphan because its parent is obsolete |
a2273aa71a4b
test: rename and clarify content of test-unstable-orphan.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
3540
diff
changeset
|
84 |
with multiple successors on the same branch but in reverse order (cross-split). |
1479
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
85 |
|
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
86 |
$ hg init test5 |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
87 |
$ cd test5 |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
88 |
$ mkcommits _a _b _c |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
89 |
$ hg up "desc(_a)" |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
90 |
0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
91 |
$ mkcommits bprimesplit1 bprimesplit2 |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
92 |
created new head |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
93 |
$ hg prune "desc(_b)" -s "desc(bprimesplit1) + desc(bprimesplit2)" --split |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
94 |
1 changesets pruned |
3013
945a0989e41b
packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
3000
diff
changeset
|
95 |
1 new orphan changesets |
1479
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
96 |
$ hg up "desc(_a)" |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
97 |
0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
98 |
$ mkcommits bsecondsplit1 bsecondsplit2 |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
99 |
created new head |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
100 |
$ hg prune "desc(bprimesplit1)" -s "desc(bsecondsplit2)" |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
101 |
1 changesets pruned |
3013
945a0989e41b
packaging: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
3000
diff
changeset
|
102 |
1 new orphan changesets |
1479
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
103 |
$ hg prune "desc(bprimesplit2)" -s "desc(bsecondsplit1)" |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
104 |
1 changesets pruned |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
105 |
$ hg log -G |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
106 |
@ 6:59b942dbda14@default(draft) add bsecondsplit2 |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
107 |
| |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
108 |
o 5:8ffdae67d696@default(draft) add bsecondsplit1 |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
109 |
| |
3417
d3a17c67f85c
branching: merge stable back into default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
3411
diff
changeset
|
110 |
| * 2:102002290587@default(draft) add _c |
1479
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
111 |
| | |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
112 |
| x 1:37445b16603b@default(draft) add _b |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
113 |
|/ |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
114 |
o 0:135f39f4bd78@default(draft) add _a |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
115 |
|
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
116 |
|
2834
38db1466c6fb
log: unstable was renamed into orphan
Boris Feld <boris.feld@octobus.net>
parents:
2776
diff
changeset
|
117 |
$ hg evo --all --any --orphan |
1481
3c0aebe73482
evolve: handle split commit for instability
Laurent Charignon <lcharignon@fb.com>
parents:
1479
diff
changeset
|
118 |
move:[2] add _c |
3c0aebe73482
evolve: handle split commit for instability
Laurent Charignon <lcharignon@fb.com>
parents:
1479
diff
changeset
|
119 |
atop:[6] add bsecondsplit2 |
3c0aebe73482
evolve: handle split commit for instability
Laurent Charignon <lcharignon@fb.com>
parents:
1479
diff
changeset
|
120 |
working directory is now at 98e3f21461ff |
1479
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
121 |
$ hg log -G |
1481
3c0aebe73482
evolve: handle split commit for instability
Laurent Charignon <lcharignon@fb.com>
parents:
1479
diff
changeset
|
122 |
@ 7:98e3f21461ff@default(draft) add _c |
3c0aebe73482
evolve: handle split commit for instability
Laurent Charignon <lcharignon@fb.com>
parents:
1479
diff
changeset
|
123 |
| |
3c0aebe73482
evolve: handle split commit for instability
Laurent Charignon <lcharignon@fb.com>
parents:
1479
diff
changeset
|
124 |
o 6:59b942dbda14@default(draft) add bsecondsplit2 |
1479
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
125 |
| |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
126 |
o 5:8ffdae67d696@default(draft) add bsecondsplit1 |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
127 |
| |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
128 |
o 0:135f39f4bd78@default(draft) add _a |
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
129 |
|
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
130 |
|
72eab894a89d
evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
131 |
$ cd .. |