Mercurial > evolve
comparison tests/test-topic-stack-data.t @ 2109:90ab79764ce4 mercurial-4.0
mercurial-4.0: merge with future 6.0.0
A new version will be released soon, we start handling mismatch in test output
to make the actual release time smoother.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Tue, 14 Mar 2017 14:38:10 -0700 |
parents | db617700d318 |
children | f19b314d8475 |
comparison
equal
deleted
inserted
replaced
1815:ee2d5716ef0a | 2109:90ab79764ce4 |
---|---|
1 Setup | |
2 ===== | |
3 | |
4 $ . "$TESTDIR/testlib/topic_setup.sh" | |
5 | |
6 $ hg init test-list | |
7 $ cd test-list | |
8 $ cat <<EOF >> .hg/hgrc | |
9 > [phases] | |
10 > publish=false | |
11 > EOF | |
12 $ cat <<EOF >> $HGRCPATH | |
13 > [experimental] | |
14 > # disable the new graph style until we drop 3.7 support | |
15 > graphstyle.missing = | | |
16 > # turn evolution on | |
17 > evolution=all | |
18 > EOF | |
19 | |
20 | |
21 $ mkcommit() { | |
22 > echo "$1" > "$1" | |
23 > hg add "$1" | |
24 > hg ci -m "add $1" | |
25 > } | |
26 | |
27 Build some basic graph | |
28 ---------------------- | |
29 | |
30 $ for x in base_a base_b base_c base_d base_e ; do | |
31 > mkcommit $x | |
32 > done | |
33 | |
34 Add another branch with two heads | |
35 | |
36 $ hg up 'desc(base_a)' | |
37 0 files updated, 0 files merged, 4 files removed, 0 files unresolved | |
38 $ hg branch lake | |
39 marked working directory as branch lake | |
40 (branches are permanent and global, did you want a bookmark?) | |
41 $ mkcommit lake_a | |
42 $ mkcommit lake_b | |
43 $ hg up 'desc(lake_a)' | |
44 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
45 $ mkcommit lake_c | |
46 created new head | |
47 | |
48 | |
49 Add some topics | |
50 --------------- | |
51 | |
52 A simple topic that need rebasing | |
53 | |
54 $ hg up 'desc(base_c)' | |
55 2 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
56 $ hg topic baz | |
57 $ mkcommit baz_a | |
58 $ mkcommit baz_b | |
59 | |
60 A simple topic with unstability | |
61 | |
62 $ hg up 'desc(base_d)' | |
63 1 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
64 $ hg topic fuz | |
65 $ mkcommit fuz_a | |
66 $ mkcommit fuz_b | |
67 $ mkcommit fuz_c | |
68 $ hg up 'desc(fuz_a)' | |
69 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
70 $ hg commit --amend --message 'fuz1_a' | |
71 | |
72 A topic with multiple heads | |
73 | |
74 $ hg up 'desc(base_e)' | |
75 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
76 $ hg topic bar | |
77 $ mkcommit bar_a | |
78 $ mkcommit bar_b | |
79 $ mkcommit bar_c | |
80 $ hg up 'desc(bar_b)' | |
81 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
82 $ mkcommit bar_d | |
83 $ mkcommit bar_e | |
84 $ hg up 'desc(bar_d)' | |
85 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
86 $ hg commit --amend --message 'bar1_d' | |
87 | |
88 topic 'foo' on the multi headed branch | |
89 | |
90 $ hg up 'desc(lake_a)' | |
91 1 files updated, 0 files merged, 7 files removed, 0 files unresolved | |
92 $ hg topic foo | |
93 $ mkcommit foo_a | |
94 $ mkcommit foo_b | |
95 | |
96 Summary | |
97 ------- | |
98 | |
99 $ hg summary | |
100 parent: 21:3e54b49a3113 tip | |
101 add foo_b | |
102 branch: lake | |
103 commit: (clean) | |
104 update: 2 new changesets (update) | |
105 phases: 22 draft | |
106 unstable: 3 changesets | |
107 topic: foo | |
108 $ hg log --graph -T '{desc} ({branch}) [{topic}]' | |
109 @ add foo_b (lake) [] | |
110 | | |
111 o add foo_a (lake) [] | |
112 | | |
113 | o bar1_d (default) [] | |
114 | | | |
115 | | o add bar_e (default) [] | |
116 | | | | |
117 | | x add bar_d (default) [] | |
118 | |/ | |
119 | | o add bar_c (default) [] | |
120 | |/ | |
121 | o add bar_b (default) [] | |
122 | | | |
123 | o add bar_a (default) [] | |
124 | | | |
125 | | o fuz1_a (default) [] | |
126 | | | | |
127 | | | o add fuz_c (default) [] | |
128 | | | | | |
129 | | | o add fuz_b (default) [] | |
130 | | | | | |
131 | | | x add fuz_a (default) [] | |
132 | | |/ | |
133 | | | o add baz_b (default) [] | |
134 | | | | | |
135 | | | o add baz_a (default) [] | |
136 | | | | | |
137 +-------o add lake_c (lake) [] | |
138 | | | | | |
139 +-------o add lake_b (lake) [] | |
140 | | | | | |
141 o | | | add lake_a (lake) [] | |
142 | | | | | |
143 | o | | add base_e (default) [] | |
144 | |/ / | |
145 | o / add base_d (default) [] | |
146 | |/ | |
147 | o add base_c (default) [] | |
148 | | | |
149 | o add base_b (default) [] | |
150 |/ | |
151 o add base_a (default) [] | |
152 | |
153 | |
154 Actual Testing | |
155 ============== | |
156 | |
157 basic output | |
158 | |
159 $ hg topic | |
160 bar | |
161 baz | |
162 * foo | |
163 fuz | |
164 | |
165 quiet version | |
166 | |
167 $ hg topic --quiet | |
168 bar | |
169 baz | |
170 foo | |
171 fuz | |
172 | |
173 verbose | |
174 | |
175 $ hg topic --verbose | |
176 bar (on branch: default, 5 changesets, 1 troubled, 2 heads) | |
177 baz (on branch: default, 2 changesets, 2 behind) | |
178 * foo (on branch: lake, 2 changesets, ambiguous destination) | |
179 fuz (on branch: default, 3 changesets, 2 troubled, 1 behind) | |
180 | |
181 json | |
182 | |
183 $ hg topic -T json | |
184 [ | |
185 { | |
186 "active": false, | |
187 "topic": "bar" | |
188 }, | |
189 { | |
190 "active": false, | |
191 "topic": "baz" | |
192 }, | |
193 { | |
194 "active": true, | |
195 "topic": "foo" | |
196 }, | |
197 { | |
198 "active": false, | |
199 "topic": "fuz" | |
200 } | |
201 ] | |
202 | |
203 json --verbose | |
204 | |
205 $ hg topic -T json --verbose | |
206 [ | |
207 { | |
208 "active": false, | |
209 "branches+": "default", | |
210 "changesetcount": 5, | |
211 "headcount": 2, | |
212 "topic": "bar", | |
213 "troubledcount": 1 | |
214 }, | |
215 { | |
216 "active": false, | |
217 "behindcount": 2, | |
218 "branches+": "default", | |
219 "changesetcount": 2, | |
220 "topic": "baz" | |
221 }, | |
222 { | |
223 "active": true, | |
224 "behinderror": "ambiguous destination", | |
225 "branches+": "lake", | |
226 "changesetcount": 2, | |
227 "topic": "foo" | |
228 }, | |
229 { | |
230 "active": false, | |
231 "behindcount": 1, | |
232 "branches+": "default", | |
233 "changesetcount": 3, | |
234 "topic": "fuz", | |
235 "troubledcount": 2 | |
236 } | |
237 ] | |
238 | |
239 Also test this situation with 'hg stack' | |
240 ======================================= | |
241 | |
242 $ hg stack bar | |
243 ### topic: bar (2 heads) | |
244 ### branch: default | |
245 t5: add bar_c | |
246 t2^ add bar_b (base) | |
247 t4$ add bar_e (unstable) | |
248 t3: bar1_d | |
249 t2: add bar_b | |
250 t1: add bar_a | |
251 ^ add base_e | |
252 $ hg stack baz | |
253 ### topic: baz | |
254 ### branch: default, 2 behind | |
255 t2: add baz_b | |
256 t1: add baz_a | |
257 ^ add base_c | |
258 $ hg stack foo | |
259 ### topic: foo | |
260 ### branch: lake, ambigious rebase destination | |
261 t2@ add foo_b (current) | |
262 t1: add foo_a | |
263 ^ add lake_a | |
264 $ hg stack fuz | |
265 ### topic: fuz | |
266 ### branch: default, 1 behind | |
267 t3$ add fuz_c (unstable) | |
268 t2$ add fuz_b (unstable) | |
269 t1: fuz1_a | |
270 ^ add base_d |