Mercurial > evolve
comparison tests/test-evolve-obshistory-amend.t @ 3914:96945ea908df stable
branching: merge default into stable
The stable branch of Mercurial core now contains Mercurial 4.7 so evolve branch
policy requires this merge. The @ bookmark is in the right location, so people
doing clone will get to the latest release.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 31 Jul 2018 12:52:06 +0200 |
parents | 7c624b45fe60 |
children | f7afd3a158e3 c16fed4908d8 |
comparison
equal
deleted
inserted
replaced
3901:f2b8429db565 | 3914:96945ea908df |
---|---|
1 This test file test the various messages when accessing obsolete | |
2 revisions. | |
3 | |
4 Global setup | |
5 ============ | |
6 | |
7 $ . $TESTDIR/testlib/obshistory_setup.sh | |
8 | |
9 | |
10 Test output on amended commit | |
11 ============================= | |
12 | |
13 Test setup | |
14 ---------- | |
15 | |
16 $ hg init $TESTTMP/local-amend | |
17 $ hg init $TESTTMP/server | |
18 $ cd $TESTTMP/local-amend | |
19 $ mkcommit ROOT | |
20 $ sync | |
21 $ mkcommit A0 . | |
22 $ echo 42 >> A0 | |
23 $ hg amend -m "A1 | |
24 > | |
25 > Better commit message" | |
26 $ sync | |
27 $ hg log --hidden -G | |
28 @ changeset: 2:4ae3a4151de9 | |
29 | tag: tip | |
30 | parent: 0:ea207398892e | |
31 | user: test | |
32 | date: Thu Jan 01 00:00:00 1970 +0000 | |
33 | summary: A1 | |
34 | | |
35 | x changeset: 1:471f378eab4c | |
36 |/ user: test | |
37 | date: Thu Jan 01 00:00:00 1970 +0000 | |
38 | obsolete: rewritten using amend as 2:4ae3a4151de9 | |
39 | summary: A0 | |
40 | | |
41 o changeset: 0:ea207398892e | |
42 user: test | |
43 date: Thu Jan 01 00:00:00 1970 +0000 | |
44 summary: ROOT | |
45 | |
46 Check output on the client side | |
47 ------------------------------- | |
48 $ hg obslog --patch 4ae3a4151de9 | |
49 @ 4ae3a4151de9 (2) A1 | |
50 | | |
51 x 471f378eab4c (1) A0 | |
52 rewritten(description, content) as 4ae3a4151de9 using amend by test (*) (glob) | |
53 diff -r 471f378eab4c -r 4ae3a4151de9 changeset-description | |
54 --- a/changeset-description | |
55 +++ b/changeset-description | |
56 @@ -1,1 +1,3 @@ | |
57 -A0 | |
58 +A1 | |
59 + | |
60 +Better commit message | |
61 | |
62 diff -r 471f378eab4c -r 4ae3a4151de9 A0 | |
63 --- a/A0 Thu Jan 01 00:00:00 1970 +0000 | |
64 +++ b/A0 Thu Jan 01 00:00:00 1970 +0000 | |
65 @@ -1,1 +1,2 @@ | |
66 A0 | |
67 +42 | |
68 | |
69 | |
70 $ hg obslog --patch --color debug | |
71 @ [evolve.node|4ae3a4151de9] [evolve.rev|(2)] [evolve.short_description|A1] | |
72 | | |
73 x [evolve.node|471f378eab4c] [evolve.rev|(1)] [evolve.short_description|A0] | |
74 [evolve.verb|rewritten](description, content) as [evolve.node|4ae3a4151de9] using [evolve.operation|amend] by [evolve.user|test] [evolve.date|(Thu Jan 01 00:00:00 1970 +0000)] | |
75 [diff.diffline|diff -r 471f378eab4c -r 4ae3a4151de9 changeset-description] | |
76 [diff.file_a|--- a/changeset-description] | |
77 [diff.file_b|+++ b/changeset-description] | |
78 [diff.hunk|@@ -1,1 +1,3 @@] | |
79 [diff.deleted|-A0] | |
80 [diff.inserted|+A1] | |
81 [diff.inserted|+] | |
82 [diff.inserted|+Better commit message] | |
83 | |
84 [diff.diffline|diff -r 471f378eab4c -r 4ae3a4151de9 A0] | |
85 [diff.file_a|--- a/A0 Thu Jan 01 00:00:00 1970 +0000] | |
86 [diff.file_b|+++ b/A0 Thu Jan 01 00:00:00 1970 +0000] | |
87 [diff.hunk|@@ -1,1 +1,2 @@] | |
88 A0 | |
89 [diff.inserted|+42] | |
90 | |
91 | |
92 | |
93 $ hg obslog --no-graph --patch 4ae3a4151de9 | |
94 4ae3a4151de9 (2) A1 | |
95 471f378eab4c (1) A0 | |
96 rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000) | |
97 diff -r 471f378eab4c -r 4ae3a4151de9 changeset-description | |
98 --- a/changeset-description | |
99 +++ b/changeset-description | |
100 @@ -1,1 +1,3 @@ | |
101 -A0 | |
102 +A1 | |
103 + | |
104 +Better commit message | |
105 | |
106 diff -r 471f378eab4c -r 4ae3a4151de9 A0 | |
107 --- a/A0 Thu Jan 01 00:00:00 1970 +0000 | |
108 +++ b/A0 Thu Jan 01 00:00:00 1970 +0000 | |
109 @@ -1,1 +1,2 @@ | |
110 A0 | |
111 +42 | |
112 | |
113 | |
114 $ hg obslog 4ae3a4151de9 --graph -T'{label("log.summary", shortdescription)} {if(markers, join(markers % "at {date|hgdate} by {user|person} ", " also "))}' | |
115 @ A1 | |
116 | | |
117 x A0 at 0 0 by test | |
118 | |
119 $ hg obslog 4ae3a4151de9 --no-graph -Tjson | python -m json.tool | |
120 [ | |
121 { | |
122 "markers": [], | |
123 "node": "4ae3a4151de9", | |
124 "rev": 2, | |
125 "shortdescription": "A1" | |
126 }, | |
127 { | |
128 "markers": [ | |
129 { | |
130 "date": [ | |
131 *, (glob) | |
132 0 (glob) | |
133 ], | |
134 "effect": [ | |
135 "description", | |
136 "content" | |
137 ], | |
138 "operation": "amend", | |
139 "succnodes": [ | |
140 "4ae3a4151de9" | |
141 ], | |
142 "user": "test", | |
143 "verb": "rewritten" | |
144 } | |
145 ], | |
146 "node": "471f378eab4c", | |
147 "rev": 1, | |
148 "shortdescription": "A0" | |
149 } | |
150 ] | |
151 $ hg obslog --hidden --patch 471f378eab4c | |
152 x 471f378eab4c (1) A0 | |
153 rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000) | |
154 diff -r 471f378eab4c -r 4ae3a4151de9 changeset-description | |
155 --- a/changeset-description | |
156 +++ b/changeset-description | |
157 @@ -1,1 +1,3 @@ | |
158 -A0 | |
159 +A1 | |
160 + | |
161 +Better commit message | |
162 | |
163 diff -r 471f378eab4c -r 4ae3a4151de9 A0 | |
164 --- a/A0 Thu Jan 01 00:00:00 1970 +0000 | |
165 +++ b/A0 Thu Jan 01 00:00:00 1970 +0000 | |
166 @@ -1,1 +1,2 @@ | |
167 A0 | |
168 +42 | |
169 | |
170 | |
171 $ hg obslog --hidden 471f378eab4c --no-graph -Tjson | python -m json.tool | |
172 [ | |
173 { | |
174 "markers": [ | |
175 { | |
176 "date": [ | |
177 *, (glob) | |
178 0 (glob) | |
179 ], | |
180 "effect": [ | |
181 *, (glob) | |
182 "content" | |
183 ], | |
184 "operation": "amend", | |
185 "succnodes": [ | |
186 "4ae3a4151de9" | |
187 ], | |
188 "user": "test", | |
189 "verb": "rewritten" | |
190 } | |
191 ], | |
192 "node": "471f378eab4c", | |
193 "rev": 1, | |
194 "shortdescription": "A0" | |
195 } | |
196 ] | |
197 $ hg update 471f378eab4c | |
198 abort: hidden revision '471f378eab4c' was rewritten as: 4ae3a4151de9! | |
199 (use --hidden to access hidden revisions) | |
200 [255] | |
201 $ hg update --hidden "desc(A0)" | |
202 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
203 updated to hidden changeset 471f378eab4c | |
204 (hidden revision '471f378eab4c' was rewritten as: 4ae3a4151de9) | |
205 working directory parent is obsolete! (471f378eab4c) | |
206 (use 'hg evolve' to update to its successor: 4ae3a4151de9) | |
207 | |
208 Check output on the server side | |
209 ------------------------------- | |
210 | |
211 $ hg obslog -R $TESTTMP/server --patch 4ae3a4151de9 | |
212 o 4ae3a4151de9 (1) A1 | |
213 | | |
214 x 471f378eab4c | |
215 rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000) | |
216 (No patch available, context is not local) | |
217 | |
218 $ hg obslog -R $TESTTMP/server -f --patch 4ae3a4151de9 | |
219 o 4ae3a4151de9 (1) A1 | |
220 | |
221 $ hg obslog -R $TESTTMP/server --no-graph --patch 4ae3a4151de9 | |
222 4ae3a4151de9 (1) A1 | |
223 471f378eab4c | |
224 rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000) | |
225 (No patch available, context is not local) | |
226 | |
227 $ hg obslog -R $TESTTMP/server --no-graph -f --patch 4ae3a4151de9 | |
228 4ae3a4151de9 (1) A1 | |
229 471f378eab4c | |
230 rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000) | |
231 (No patch available, context is not local) | |
232 | |
233 Amend two more times | |
234 ==================== | |
235 | |
236 Amend again | |
237 ----------- | |
238 $ hg log --hidden -G | |
239 o changeset: 2:4ae3a4151de9 | |
240 | tag: tip | |
241 | parent: 0:ea207398892e | |
242 | user: test | |
243 | date: Thu Jan 01 00:00:00 1970 +0000 | |
244 | summary: A1 | |
245 | | |
246 | @ changeset: 1:471f378eab4c | |
247 |/ user: test | |
248 | date: Thu Jan 01 00:00:00 1970 +0000 | |
249 | obsolete: rewritten using amend as 2:4ae3a4151de9 | |
250 | summary: A0 | |
251 | | |
252 o changeset: 0:ea207398892e | |
253 user: test | |
254 date: Thu Jan 01 00:00:00 1970 +0000 | |
255 summary: ROOT | |
256 | |
257 $ hg up tip | |
258 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
259 $ hg amend -m "A2 | |
260 > | |
261 > Better better commit message" | |
262 $ hg amend -m "A3 | |
263 > | |
264 > Better better better commit message" | |
265 $ sync | |
266 $ hg log --hidden -G | |
267 @ changeset: 4:92210308515b | |
268 | tag: tip | |
269 | parent: 0:ea207398892e | |
270 | user: test | |
271 | date: Thu Jan 01 00:00:00 1970 +0000 | |
272 | summary: A3 | |
273 | | |
274 | x changeset: 3:4f1685185907 | |
275 |/ parent: 0:ea207398892e | |
276 | user: test | |
277 | date: Thu Jan 01 00:00:00 1970 +0000 | |
278 | obsolete: reworded using amend as 4:92210308515b | |
279 | summary: A2 | |
280 | | |
281 | x changeset: 2:4ae3a4151de9 | |
282 |/ parent: 0:ea207398892e | |
283 | user: test | |
284 | date: Thu Jan 01 00:00:00 1970 +0000 | |
285 | obsolete: reworded using amend as 3:4f1685185907 | |
286 | summary: A1 | |
287 | | |
288 | x changeset: 1:471f378eab4c | |
289 |/ user: test | |
290 | date: Thu Jan 01 00:00:00 1970 +0000 | |
291 | obsolete: rewritten using amend as 2:4ae3a4151de9 | |
292 | summary: A0 | |
293 | | |
294 o changeset: 0:ea207398892e | |
295 user: test | |
296 date: Thu Jan 01 00:00:00 1970 +0000 | |
297 summary: ROOT | |
298 | |
299 Check the output on the client | |
300 ------------------------------ | |
301 | |
302 $ hg obslog --patch 92210308515b | |
303 @ 92210308515b (4) A3 | |
304 | | |
305 x 4f1685185907 (3) A2 | |
306 | rewritten(description) as 92210308515b using amend by test (Thu Jan 01 00:00:00 1970 +0000) | |
307 | diff -r 4f1685185907 -r 92210308515b changeset-description | |
308 | --- a/changeset-description | |
309 | +++ b/changeset-description | |
310 | @@ -1,3 +1,3 @@ | |
311 | -A2 | |
312 | +A3 | |
313 | | |
314 | -Better better commit message | |
315 | +Better better better commit message | |
316 | | |
317 | | |
318 x 4ae3a4151de9 (2) A1 | |
319 | rewritten(description) as 4f1685185907 using amend by test (Thu Jan 01 00:00:00 1970 +0000) | |
320 | diff -r 4ae3a4151de9 -r 4f1685185907 changeset-description | |
321 | --- a/changeset-description | |
322 | +++ b/changeset-description | |
323 | @@ -1,3 +1,3 @@ | |
324 | -A1 | |
325 | +A2 | |
326 | | |
327 | -Better commit message | |
328 | +Better better commit message | |
329 | | |
330 | | |
331 x 471f378eab4c (1) A0 | |
332 rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000) | |
333 diff -r 471f378eab4c -r 4ae3a4151de9 changeset-description | |
334 --- a/changeset-description | |
335 +++ b/changeset-description | |
336 @@ -1,1 +1,3 @@ | |
337 -A0 | |
338 +A1 | |
339 + | |
340 +Better commit message | |
341 | |
342 diff -r 471f378eab4c -r 4ae3a4151de9 A0 | |
343 --- a/A0 Thu Jan 01 00:00:00 1970 +0000 | |
344 +++ b/A0 Thu Jan 01 00:00:00 1970 +0000 | |
345 @@ -1,1 +1,2 @@ | |
346 A0 | |
347 +42 | |
348 | |
349 | |
350 Check the output on the server | |
351 ------------------------------ | |
352 | |
353 $ hg obslog -R $TESTTMP/server --patch 92210308515b | |
354 o 92210308515b (2) A3 | |
355 | | |
356 x 4f1685185907 | |
357 | rewritten(description) as 92210308515b using amend by test (Thu Jan 01 00:00:00 1970 +0000) | |
358 | (No patch available, context is not local) | |
359 | | |
360 x 4ae3a4151de9 (1) A1 | |
361 | rewritten(description) as 4f1685185907 using amend by test (Thu Jan 01 00:00:00 1970 +0000) | |
362 | (No patch available, successor is unknown locally) | |
363 | | |
364 x 471f378eab4c | |
365 rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000) | |
366 (No patch available, context is not local) | |
367 | |
368 $ hg obslog -R $TESTTMP/server -f --patch 92210308515b | |
369 o 92210308515b (2) A3 | |
370 | | |
371 x 4ae3a4151de9 (1) A1 | |
372 reworded(description) as 92210308515b using amend by test (at Thu Jan 01 00:00:00 1970 +0000) | |
373 diff -r 4ae3a4151de9 -r 92210308515b changeset-description | |
374 --- a/changeset-description | |
375 +++ b/changeset-description | |
376 @@ -1,3 +1,3 @@ | |
377 -A1 | |
378 +A3 | |
379 | |
380 -Better commit message | |
381 +Better better better commit message | |
382 | |
383 | |
384 $ hg obslog -R $TESTTMP/server --no-graph --patch 92210308515b | |
385 92210308515b (2) A3 | |
386 4f1685185907 | |
387 rewritten(description) as 92210308515b using amend by test (Thu Jan 01 00:00:00 1970 +0000) | |
388 (No patch available, context is not local) | |
389 4ae3a4151de9 (1) A1 | |
390 rewritten(description) as 4f1685185907 using amend by test (Thu Jan 01 00:00:00 1970 +0000) | |
391 (No patch available, successor is unknown locally) | |
392 471f378eab4c | |
393 rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000) | |
394 (No patch available, context is not local) | |
395 | |
396 $ hg obslog -R $TESTTMP/server --no-graph -f --patch 92210308515b | |
397 92210308515b (2) A3 | |
398 4f1685185907 | |
399 rewritten(description) as 92210308515b using amend by test (Thu Jan 01 00:00:00 1970 +0000) | |
400 (No patch available, context is not local) | |
401 4ae3a4151de9 (1) A1 | |
402 rewritten(description) as 4f1685185907 using amend by test (Thu Jan 01 00:00:00 1970 +0000) | |
403 (No patch available, successor is unknown locally) | |
404 471f378eab4c | |
405 rewritten(description, content) as 4ae3a4151de9 using amend by test (Thu Jan 01 00:00:00 1970 +0000) | |
406 (No patch available, context is not local) |