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