comparison tests/test-evolve-obshistory-fold.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 83e8803e1cf1
children f7afd3a158e3 f16274729530
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 Test output with folded commit
10 ==============================
11
12 Test setup
13 ----------
14
15 $ hg init $TESTTMP/local-fold
16 $ hg init $TESTTMP/server
17 $ cd $TESTTMP/local-fold
18 $ mkcommit ROOT
19 $ mkcommit A0
20 $ sync
21 $ mkcommit B0
22 $ hg log --hidden -G
23 @ changeset: 2:0dec01379d3b
24 | tag: tip
25 | user: test
26 | date: Thu Jan 01 00:00:00 1970 +0000
27 | summary: B0
28 |
29 o changeset: 1:471f378eab4c
30 | user: test
31 | date: Thu Jan 01 00:00:00 1970 +0000
32 | summary: A0
33 |
34 o changeset: 0:ea207398892e
35 user: test
36 date: Thu Jan 01 00:00:00 1970 +0000
37 summary: ROOT
38
39 $ hg fold --exact -r 'desc(A0) + desc(B0)' --date "0 0" -m "C0"
40 2 changesets folded
41 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
42 $ hg log --hidden -G
43 @ changeset: 3:eb5a0daa2192
44 | tag: tip
45 | parent: 0:ea207398892e
46 | user: test
47 | date: Thu Jan 01 00:00:00 1970 +0000
48 | summary: C0
49 |
50 | x changeset: 2:0dec01379d3b
51 | | user: test
52 | | date: Thu Jan 01 00:00:00 1970 +0000
53 | | obsolete: rewritten using fold as 3:eb5a0daa2192
54 | | summary: B0
55 | |
56 | x changeset: 1:471f378eab4c
57 |/ user: test
58 | date: Thu Jan 01 00:00:00 1970 +0000
59 | obsolete: rewritten using fold as 3:eb5a0daa2192
60 | summary: A0
61 |
62 o changeset: 0:ea207398892e
63 user: test
64 date: Thu Jan 01 00:00:00 1970 +0000
65 summary: ROOT
66
67
68 $ sync
69 Check output of the client
70 --------------------------
71
72 Check that debugobshistory on the first folded revision show only
73 the revision with the target
74 $ hg obslog --hidden 471f378eab4c --patch
75 x 471f378eab4c (1) A0
76 rewritten(description, content) as eb5a0daa2192 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
77 diff -r 471f378eab4c -r eb5a0daa2192 changeset-description
78 --- a/changeset-description
79 +++ b/changeset-description
80 @@ -1,1 +1,1 @@
81 -A0
82 +C0
83
84 diff -r 471f378eab4c -r eb5a0daa2192 B0
85 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
86 +++ b/B0 Thu Jan 01 00:00:00 1970 +0000
87 @@ -0,0 +1,1 @@
88 +B0
89
90
91 Check that with all option, all changesets are shown
92 $ hg obslog --hidden --all 471f378eab4c --patch
93 @ eb5a0daa2192 (3) C0
94 |\
95 x | 0dec01379d3b (2) B0
96 / rewritten(description, parent, content) as eb5a0daa2192 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
97 | (No patch available, changesets rebased)
98 |
99 x 471f378eab4c (1) A0
100 rewritten(description, content) as eb5a0daa2192 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
101 diff -r 471f378eab4c -r eb5a0daa2192 changeset-description
102 --- a/changeset-description
103 +++ b/changeset-description
104 @@ -1,1 +1,1 @@
105 -A0
106 +C0
107
108 diff -r 471f378eab4c -r eb5a0daa2192 B0
109 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
110 +++ b/B0 Thu Jan 01 00:00:00 1970 +0000
111 @@ -0,0 +1,1 @@
112 +B0
113
114
115 Check that debugobshistory on the second folded revision show only
116 the revision with the target
117 $ hg obslog --hidden 0dec01379d3b --patch
118 x 0dec01379d3b (2) B0
119 rewritten(description, parent, content) as eb5a0daa2192 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
120 (No patch available, changesets rebased)
121
122 Check that with all option, all changesets are shown
123 $ hg obslog --hidden --all 0dec01379d3b --patch
124 @ eb5a0daa2192 (3) C0
125 |\
126 x | 0dec01379d3b (2) B0
127 / rewritten(description, parent, content) as eb5a0daa2192 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
128 | (No patch available, changesets rebased)
129 |
130 x 471f378eab4c (1) A0
131 rewritten(description, content) as eb5a0daa2192 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
132 diff -r 471f378eab4c -r eb5a0daa2192 changeset-description
133 --- a/changeset-description
134 +++ b/changeset-description
135 @@ -1,1 +1,1 @@
136 -A0
137 +C0
138
139 diff -r 471f378eab4c -r eb5a0daa2192 B0
140 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
141 +++ b/B0 Thu Jan 01 00:00:00 1970 +0000
142 @@ -0,0 +1,1 @@
143 +B0
144
145
146 Check that debugobshistory on the successor revision show a coherent
147 graph
148 $ hg obslog eb5a0daa2192 --patch
149 @ eb5a0daa2192 (3) C0
150 |\
151 x | 0dec01379d3b (2) B0
152 / rewritten(description, parent, content) as eb5a0daa2192 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
153 | (No patch available, changesets rebased)
154 |
155 x 471f378eab4c (1) A0
156 rewritten(description, content) as eb5a0daa2192 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
157 diff -r 471f378eab4c -r eb5a0daa2192 changeset-description
158 --- a/changeset-description
159 +++ b/changeset-description
160 @@ -1,1 +1,1 @@
161 -A0
162 +C0
163
164 diff -r 471f378eab4c -r eb5a0daa2192 B0
165 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
166 +++ b/B0 Thu Jan 01 00:00:00 1970 +0000
167 @@ -0,0 +1,1 @@
168 +B0
169
170
171 $ hg obslog eb5a0daa2192 --no-graph -Tjson | python -m json.tool
172 [
173 {
174 "markers": [],
175 "node": "eb5a0daa2192",
176 "rev": 3,
177 "shortdescription": "C0"
178 },
179 {
180 "markers": [
181 {
182 "date": [
183 *, (glob)
184 0 (glob)
185 ],
186 "effect": [
187 "description",
188 "content"
189 ],
190 "operation": "fold",
191 "succnodes": [
192 "eb5a0daa2192"
193 ],
194 "user": "test",
195 "verb": "rewritten"
196 }
197 ],
198 "node": "471f378eab4c",
199 "rev": 1,
200 "shortdescription": "A0"
201 },
202 {
203 "markers": [
204 {
205 "date": [
206 *, (glob)
207 0 (glob)
208 ],
209 "effect": [
210 "description",
211 "parent",
212 "content"
213 ],
214 "operation": "fold",
215 "succnodes": [
216 "eb5a0daa2192"
217 ],
218 "user": "test",
219 "verb": "rewritten"
220 }
221 ],
222 "node": "0dec01379d3b",
223 "rev": 2,
224 "shortdescription": "B0"
225 }
226 ]
227 $ hg update 471f378eab4c
228 abort: hidden revision '471f378eab4c' was rewritten as: eb5a0daa2192!
229 (use --hidden to access hidden revisions)
230 [255]
231 $ hg update --hidden 'desc(A0)'
232 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
233 updated to hidden changeset 471f378eab4c
234 (hidden revision '471f378eab4c' was rewritten as: eb5a0daa2192)
235 working directory parent is obsolete! (471f378eab4c)
236 (use 'hg evolve' to update to its successor: eb5a0daa2192)
237 $ hg update 0dec01379d3b
238 abort: hidden revision '0dec01379d3b' was rewritten as: eb5a0daa2192!
239 (use --hidden to access hidden revisions)
240 [255]
241 $ hg update --hidden 'desc(B0)'
242 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
243 updated to hidden changeset 0dec01379d3b
244 (hidden revision '0dec01379d3b' was rewritten as: eb5a0daa2192)
245 working directory parent is obsolete! (0dec01379d3b)
246 (use 'hg evolve' to update to its successor: eb5a0daa2192)
247
248 Check output of the server
249 --------------------------
250
251 $ hg obslog -R $TESTTMP/server --patch tip --all
252 o eb5a0daa2192 (2) C0
253 |\
254 x | 0dec01379d3b
255 / rewritten(description, parent, content) as eb5a0daa2192 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
256 | (No patch available, context is not local)
257 |
258 x 471f378eab4c (1) A0
259 rewritten(description, content) as eb5a0daa2192 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
260 diff -r 471f378eab4c -r eb5a0daa2192 changeset-description
261 --- a/changeset-description
262 +++ b/changeset-description
263 @@ -1,1 +1,1 @@
264 -A0
265 +C0
266
267 diff -r 471f378eab4c -r eb5a0daa2192 B0
268 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
269 +++ b/B0 Thu Jan 01 00:00:00 1970 +0000
270 @@ -0,0 +1,1 @@
271 +B0
272
273
274 $ hg obslog -R $TESTTMP/server -f --all --patch tip
275 o eb5a0daa2192 (2) C0
276 |
277 x 471f378eab4c (1) A0
278 rewritten(description, content) as eb5a0daa2192 using fold by test (at Thu Jan 01 00:00:00 1970 +0000)
279 diff -r 471f378eab4c -r eb5a0daa2192 changeset-description
280 --- a/changeset-description
281 +++ b/changeset-description
282 @@ -1,1 +1,1 @@
283 -A0
284 +C0
285
286 diff -r 471f378eab4c -r eb5a0daa2192 B0
287 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
288 +++ b/B0 Thu Jan 01 00:00:00 1970 +0000
289 @@ -0,0 +1,1 @@
290 +B0
291
292
293
294 $ hg obslog -R $TESTTMP/server --all --patch 471f378eab4c --hidden
295 o eb5a0daa2192 (2) C0
296 |\
297 x | 0dec01379d3b
298 / rewritten(description, parent, content) as eb5a0daa2192 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
299 | (No patch available, context is not local)
300 |
301 x 471f378eab4c (1) A0
302 rewritten(description, content) as eb5a0daa2192 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
303 diff -r 471f378eab4c -r eb5a0daa2192 changeset-description
304 --- a/changeset-description
305 +++ b/changeset-description
306 @@ -1,1 +1,1 @@
307 -A0
308 +C0
309
310 diff -r 471f378eab4c -r eb5a0daa2192 B0
311 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
312 +++ b/B0 Thu Jan 01 00:00:00 1970 +0000
313 @@ -0,0 +1,1 @@
314 +B0
315
316
317 $ hg obslog -R $TESTTMP/server -f --all --patch 471f378eab4c --hidden
318 o eb5a0daa2192 (2) C0
319 |
320 x 471f378eab4c (1) A0
321 rewritten(description, content) as eb5a0daa2192 using fold by test (at Thu Jan 01 00:00:00 1970 +0000)
322 diff -r 471f378eab4c -r eb5a0daa2192 changeset-description
323 --- a/changeset-description
324 +++ b/changeset-description
325 @@ -1,1 +1,1 @@
326 -A0
327 +C0
328
329 diff -r 471f378eab4c -r eb5a0daa2192 B0
330 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
331 +++ b/B0 Thu Jan 01 00:00:00 1970 +0000
332 @@ -0,0 +1,1 @@
333 +B0
334
335