annotate tests/test-unstable-orphan.t @ 4766:bbf6837a7fed mercurial-4.4

test-compat: close branch for mercurial-4.0 We dropped compatibility in 9.0.0
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 29 Jul 2019 12:45:29 +0200
parents 79bc0f1a832e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
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"
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
54 $ hg log -G
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
55 @ 3:36050226a9b9@default(draft) bprime
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
56 |
4516
f54bb6eaf5e6 test-compat: merge mercurial-4.5 into mercurial-4.4
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4468
diff changeset
57 | o 2:102002290587@default(draft) add _c
1479
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
58 | |
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
59 | x 1:37445b16603b@default(draft) add _b
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
60 |/
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
61 o 0:135f39f4bd78@default(draft) add _a
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
62
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
63
2834
38db1466c6fb log: unstable was renamed into orphan
Boris Feld <boris.feld@octobus.net>
parents: 2776
diff changeset
64 $ hg evo --all --any --orphan
1479
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
65 move:[2] add _c
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
66 atop:[3] bprime
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
67 $ hg log -G
4577
bcd52ce0916d evolve: don't update after instability resolution by default (BC)
Anton Shestakov <av6@dwimlabs.net>
parents: 4468
diff changeset
68 o 4:fdcf3523a74d@default(draft) add _c
1479
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
69 |
4577
bcd52ce0916d evolve: don't update after instability resolution by default (BC)
Anton Shestakov <av6@dwimlabs.net>
parents: 4468
diff changeset
70 @ 3:36050226a9b9@default(draft) bprime
1479
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 0:135f39f4bd78@default(draft) add _a
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
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
75 $ cd ..
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
76
4468
a2273aa71a4b test: rename and clarify content of test-unstable-orphan.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3540
diff changeset
77
a2273aa71a4b test: rename and clarify content of test-unstable-orphan.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3540
diff changeset
78 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
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
a2273aa71a4b test: rename and clarify content of test-unstable-orphan.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 3540
diff changeset
81 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
82 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
83
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
84 $ hg init test5
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
85 $ cd test5
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
86 $ mkcommits _a _b _c
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
87 $ hg up "desc(_a)"
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
88 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
89 $ mkcommits bprimesplit1 bprimesplit2
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
90 created new head
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
91 $ hg prune "desc(_b)" -s "desc(bprimesplit1) + desc(bprimesplit2)" --split
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
92 1 changesets pruned
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
93 $ hg up "desc(_a)"
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
94 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
95 $ mkcommits bsecondsplit1 bsecondsplit2
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
96 created new head
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
97 $ hg prune "desc(bprimesplit1)" -s "desc(bsecondsplit2)"
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
98 1 changesets pruned
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
99 $ hg prune "desc(bprimesplit2)" -s "desc(bsecondsplit1)"
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
100 1 changesets pruned
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
101 $ hg log -G
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
102 @ 6:59b942dbda14@default(draft) add bsecondsplit2
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
103 |
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
104 o 5:8ffdae67d696@default(draft) add bsecondsplit1
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
105 |
4516
f54bb6eaf5e6 test-compat: merge mercurial-4.5 into mercurial-4.4
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4468
diff changeset
106 | o 2:102002290587@default(draft) add _c
1479
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 | x 1:37445b16603b@default(draft) add _b
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
109 |/
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
110 o 0:135f39f4bd78@default(draft) add _a
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
2834
38db1466c6fb log: unstable was renamed into orphan
Boris Feld <boris.feld@octobus.net>
parents: 2776
diff changeset
113 $ hg evo --all --any --orphan
1481
3c0aebe73482 evolve: handle split commit for instability
Laurent Charignon <lcharignon@fb.com>
parents: 1479
diff changeset
114 move:[2] add _c
3c0aebe73482 evolve: handle split commit for instability
Laurent Charignon <lcharignon@fb.com>
parents: 1479
diff changeset
115 atop:[6] add bsecondsplit2
1479
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
116 $ hg log -G
4577
bcd52ce0916d evolve: don't update after instability resolution by default (BC)
Anton Shestakov <av6@dwimlabs.net>
parents: 4468
diff changeset
117 o 7:98e3f21461ff@default(draft) add _c
1481
3c0aebe73482 evolve: handle split commit for instability
Laurent Charignon <lcharignon@fb.com>
parents: 1479
diff changeset
118 |
4577
bcd52ce0916d evolve: don't update after instability resolution by default (BC)
Anton Shestakov <av6@dwimlabs.net>
parents: 4468
diff changeset
119 @ 6:59b942dbda14@default(draft) add bsecondsplit2
1479
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
120 |
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
121 o 5:8ffdae67d696@default(draft) add bsecondsplit1
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
122 |
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
123 o 0:135f39f4bd78@default(draft) add _a
72eab894a89d evolve: add test for instability
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
124
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 $ cd ..