comparison tests/test-evolve-obshistory.t @ 3891:11b775fddda8

tests: extract the content-divergence test case into a separate file
author Boris Feld <boris.feld@octobus.net>
date Tue, 22 May 2018 17:42:56 +0200
parents 840c48296511
children 106c871dfebc
comparison
equal deleted inserted replaced
3890:840c48296511 3891:11b775fddda8
20 @ 000000000000 (-1) 20 @ 000000000000 (-1)
21 21
22 $ hg obslog 'wdir()' 22 $ hg obslog 'wdir()'
23 abort: working directory revision cannot be specified 23 abort: working directory revision cannot be specified
24 [255] 24 [255]
25
26 Test output with divergence
27 ===========================
28
29 Test setup
30 ----------
31
32 $ hg init $TESTTMP/local-divergence
33 $ cd $TESTTMP/local-divergence
34 $ mkcommit ROOT
35 $ mkcommit A0
36 $ hg amend -m "A1"
37 $ hg log --hidden -G
38 @ changeset: 2:fdf9bde5129a
39 | tag: tip
40 | parent: 0:ea207398892e
41 | user: test
42 | date: Thu Jan 01 00:00:00 1970 +0000
43 | summary: A1
44 |
45 | x changeset: 1:471f378eab4c
46 |/ user: test
47 | date: Thu Jan 01 00:00:00 1970 +0000
48 | obsolete: reworded using amend as 2:fdf9bde5129a
49 | summary: A0
50 |
51 o changeset: 0:ea207398892e
52 user: test
53 date: Thu Jan 01 00:00:00 1970 +0000
54 summary: ROOT
55
56 $ hg update --hidden 'desc(A0)'
57 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
58 updated to hidden changeset 471f378eab4c
59 (hidden revision '471f378eab4c' was rewritten as: fdf9bde5129a)
60 working directory parent is obsolete! (471f378eab4c)
61 (use 'hg evolve' to update to its successor: fdf9bde5129a)
62 $ hg amend -m "A2"
63 2 new content-divergent changesets
64 $ hg log --hidden -G
65 @ changeset: 3:65b757b745b9
66 | tag: tip
67 | parent: 0:ea207398892e
68 | user: test
69 | date: Thu Jan 01 00:00:00 1970 +0000
70 | instability: content-divergent
71 | summary: A2
72 |
73 | * changeset: 2:fdf9bde5129a
74 |/ parent: 0:ea207398892e
75 | user: test
76 | date: Thu Jan 01 00:00:00 1970 +0000
77 | instability: content-divergent
78 | summary: A1
79 |
80 | x changeset: 1:471f378eab4c
81 |/ user: test
82 | date: Thu Jan 01 00:00:00 1970 +0000
83 | obsolete: reworded using amend as 2:fdf9bde5129a
84 | obsolete: reworded using amend as 3:65b757b745b9
85 | summary: A0
86 |
87 o changeset: 0:ea207398892e
88 user: test
89 date: Thu Jan 01 00:00:00 1970 +0000
90 summary: ROOT
91
92 Actual test
93 -----------
94
95 Check that debugobshistory on the divergent revision show both destinations
96 $ hg obslog --hidden 471f378eab4c --patch
97 x 471f378eab4c (1) A0
98 rewritten(description) as 65b757b745b9 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
99 diff -r 471f378eab4c -r 65b757b745b9 changeset-description
100 --- a/changeset-description
101 +++ b/changeset-description
102 @@ -1,1 +1,1 @@
103 -A0
104 +A2
105
106 rewritten(description) as fdf9bde5129a using amend by test (Thu Jan 01 00:00:00 1970 +0000)
107 diff -r 471f378eab4c -r fdf9bde5129a changeset-description
108 --- a/changeset-description
109 +++ b/changeset-description
110 @@ -1,1 +1,1 @@
111 -A0
112 +A1
113
114
115
116 Check that with all option, every changeset is shown
117 $ hg obslog --hidden --all 471f378eab4c --patch
118 @ 65b757b745b9 (3) A2
119 |
120 | * fdf9bde5129a (2) A1
121 |/
122 x 471f378eab4c (1) A0
123 rewritten(description) as 65b757b745b9 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
124 diff -r 471f378eab4c -r 65b757b745b9 changeset-description
125 --- a/changeset-description
126 +++ b/changeset-description
127 @@ -1,1 +1,1 @@
128 -A0
129 +A2
130
131 rewritten(description) as fdf9bde5129a using amend by test (Thu Jan 01 00:00:00 1970 +0000)
132 diff -r 471f378eab4c -r fdf9bde5129a changeset-description
133 --- a/changeset-description
134 +++ b/changeset-description
135 @@ -1,1 +1,1 @@
136 -A0
137 +A1
138
139
140 $ hg obslog --hidden 471f378eab4c --no-graph -Tjson | python -m json.tool
141 [
142 {
143 "markers": [
144 {
145 "date": [
146 *, (glob)
147 0 (glob)
148 ],
149 "effect": [
150 "description"
151 ],
152 "operation": "amend",
153 "succnodes": [
154 "65b757b745b9"
155 ],
156 "user": "test",
157 "verb": "rewritten"
158 },
159 {
160 "date": [
161 *, (glob)
162 0 (glob)
163 ],
164 "effect": [
165 "description"
166 ],
167 "operation": "amend",
168 "succnodes": [
169 "fdf9bde5129a"
170 ],
171 "user": "test",
172 "verb": "rewritten"
173 }
174 ],
175 "node": "471f378eab4c",
176 "rev": 1,
177 "shortdescription": "A0"
178 }
179 ]
180 Check that debugobshistory on the first diverged revision show the revision
181 and the diverent one
182 $ hg obslog fdf9bde5129a --patch
183 * fdf9bde5129a (2) A1
184 |
185 x 471f378eab4c (1) A0
186 rewritten(description) as 65b757b745b9 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
187 diff -r 471f378eab4c -r 65b757b745b9 changeset-description
188 --- a/changeset-description
189 +++ b/changeset-description
190 @@ -1,1 +1,1 @@
191 -A0
192 +A2
193
194 rewritten(description) as fdf9bde5129a using amend by test (Thu Jan 01 00:00:00 1970 +0000)
195 diff -r 471f378eab4c -r fdf9bde5129a changeset-description
196 --- a/changeset-description
197 +++ b/changeset-description
198 @@ -1,1 +1,1 @@
199 -A0
200 +A1
201
202
203
204 Check that all option show all of them
205 $ hg obslog fdf9bde5129a -a --patch
206 @ 65b757b745b9 (3) A2
207 |
208 | * fdf9bde5129a (2) A1
209 |/
210 x 471f378eab4c (1) A0
211 rewritten(description) as 65b757b745b9 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
212 diff -r 471f378eab4c -r 65b757b745b9 changeset-description
213 --- a/changeset-description
214 +++ b/changeset-description
215 @@ -1,1 +1,1 @@
216 -A0
217 +A2
218
219 rewritten(description) as fdf9bde5129a using amend by test (Thu Jan 01 00:00:00 1970 +0000)
220 diff -r 471f378eab4c -r fdf9bde5129a changeset-description
221 --- a/changeset-description
222 +++ b/changeset-description
223 @@ -1,1 +1,1 @@
224 -A0
225 +A1
226
227
228 Check that debugobshistory on the second diverged revision show the revision
229 and the diverent one
230 $ hg obslog 65b757b745b9 --patch
231 @ 65b757b745b9 (3) A2
232 |
233 x 471f378eab4c (1) A0
234 rewritten(description) as 65b757b745b9 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
235 diff -r 471f378eab4c -r 65b757b745b9 changeset-description
236 --- a/changeset-description
237 +++ b/changeset-description
238 @@ -1,1 +1,1 @@
239 -A0
240 +A2
241
242 rewritten(description) as fdf9bde5129a using amend by test (Thu Jan 01 00:00:00 1970 +0000)
243 diff -r 471f378eab4c -r fdf9bde5129a changeset-description
244 --- a/changeset-description
245 +++ b/changeset-description
246 @@ -1,1 +1,1 @@
247 -A0
248 +A1
249
250
251 Check that all option show all of them
252 $ hg obslog 65b757b745b9 -a --patch
253 @ 65b757b745b9 (3) A2
254 |
255 | * fdf9bde5129a (2) A1
256 |/
257 x 471f378eab4c (1) A0
258 rewritten(description) as 65b757b745b9 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
259 diff -r 471f378eab4c -r 65b757b745b9 changeset-description
260 --- a/changeset-description
261 +++ b/changeset-description
262 @@ -1,1 +1,1 @@
263 -A0
264 +A2
265
266 rewritten(description) as fdf9bde5129a using amend by test (Thu Jan 01 00:00:00 1970 +0000)
267 diff -r 471f378eab4c -r fdf9bde5129a changeset-description
268 --- a/changeset-description
269 +++ b/changeset-description
270 @@ -1,1 +1,1 @@
271 -A0
272 +A1
273
274
275 Check that debugobshistory on the both diverged revision show a coherent
276 graph
277 $ hg obslog '65b757b745b9+fdf9bde5129a' --patch
278 @ 65b757b745b9 (3) A2
279 |
280 | * fdf9bde5129a (2) A1
281 |/
282 x 471f378eab4c (1) A0
283 rewritten(description) as 65b757b745b9 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
284 diff -r 471f378eab4c -r 65b757b745b9 changeset-description
285 --- a/changeset-description
286 +++ b/changeset-description
287 @@ -1,1 +1,1 @@
288 -A0
289 +A2
290
291 rewritten(description) as fdf9bde5129a using amend by test (Thu Jan 01 00:00:00 1970 +0000)
292 diff -r 471f378eab4c -r fdf9bde5129a changeset-description
293 --- a/changeset-description
294 +++ b/changeset-description
295 @@ -1,1 +1,1 @@
296 -A0
297 +A1
298
299
300 $ hg obslog '65b757b745b9+fdf9bde5129a' --no-graph -Tjson | python -m json.tool
301 [
302 {
303 "markers": [],
304 "node": "65b757b745b9",
305 "rev": 3,
306 "shortdescription": "A2"
307 },
308 {
309 "markers": [
310 {
311 "date": [
312 *, (glob)
313 0 (glob)
314 ],
315 "effect": [
316 "description"
317 ],
318 "operation": "amend",
319 "succnodes": [
320 "65b757b745b9"
321 ],
322 "user": "test",
323 "verb": "rewritten"
324 },
325 {
326 "date": [
327 *, (glob)
328 0 (glob)
329 ],
330 "effect": [
331 "description"
332 ],
333 "operation": "amend",
334 "succnodes": [
335 "fdf9bde5129a"
336 ],
337 "user": "test",
338 "verb": "rewritten"
339 }
340 ],
341 "node": "471f378eab4c",
342 "rev": 1,
343 "shortdescription": "A0"
344 },
345 {
346 "markers": [],
347 "node": "fdf9bde5129a",
348 "rev": 2,
349 "shortdescription": "A1"
350 }
351 ]
352 $ hg update 471f378eab4c
353 abort: hidden revision '471f378eab4c' has diverged!
354 (use --hidden to access hidden revisions)
355 [255]
356 $ hg update --hidden 'desc(A0)'
357 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
358 updated to hidden changeset 471f378eab4c
359 (hidden revision '471f378eab4c' has diverged)
360 working directory parent is obsolete! (471f378eab4c)
361 (471f378eab4c has diverged, use 'hg evolve --list --content-divergent' to resolve the issue)
362 25
363 Test output with amended + folded commit 26 Test output with amended + folded commit
364 ======================================== 27 ========================================
365 28
366 Test setup 29 Test setup