comparison tests/test-evolve-obshistory.t @ 3889:8ed81c330e82

tests: extract the obshistory lots of split test case into a separate file
author Boris Feld <boris.feld@octobus.net>
date Tue, 22 May 2018 17:40:56 +0200
parents 4e434eb1a506
children 840c48296511
comparison
equal deleted inserted replaced
3888:4e434eb1a506 3889:8ed81c330e82
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 lots of splitted commit
27 ========================================
28
29 Test setup
30 ----------
31
32 $ hg init $TESTTMP/local-lots-split
33 $ cd $TESTTMP/local-lots-split
34 $ mkcommit ROOT
35 $ echo 42 >> a
36 $ echo 43 >> b
37 $ echo 44 >> c
38 $ echo 45 >> d
39 $ hg commit -A -m "A0"
40 adding a
41 adding b
42 adding c
43 adding d
44 $ hg log --hidden -G
45 @ changeset: 1:de7290d8b885
46 | tag: tip
47 | user: test
48 | date: Thu Jan 01 00:00:00 1970 +0000
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
57 $ hg split -r 'desc(A0)' -d "0 0" << EOF
58 > y
59 > y
60 > n
61 > n
62 > n
63 > n
64 > y
65 > y
66 > n
67 > n
68 > n
69 > y
70 > y
71 > n
72 > n
73 > y
74 > y
75 > EOF
76 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
77 adding a
78 adding b
79 adding c
80 adding d
81 diff --git a/a b/a
82 new file mode 100644
83 examine changes to 'a'? [Ynesfdaq?] y
84
85 @@ -0,0 +1,1 @@
86 +42
87 record change 1/4 to 'a'? [Ynesfdaq?] y
88
89 diff --git a/b b/b
90 new file mode 100644
91 examine changes to 'b'? [Ynesfdaq?] n
92
93 diff --git a/c b/c
94 new file mode 100644
95 examine changes to 'c'? [Ynesfdaq?] n
96
97 diff --git a/d b/d
98 new file mode 100644
99 examine changes to 'd'? [Ynesfdaq?] n
100
101 created new head
102 Done splitting? [yN] n
103 diff --git a/b b/b
104 new file mode 100644
105 examine changes to 'b'? [Ynesfdaq?] y
106
107 @@ -0,0 +1,1 @@
108 +43
109 record change 1/3 to 'b'? [Ynesfdaq?] y
110
111 diff --git a/c b/c
112 new file mode 100644
113 examine changes to 'c'? [Ynesfdaq?] n
114
115 diff --git a/d b/d
116 new file mode 100644
117 examine changes to 'd'? [Ynesfdaq?] n
118
119 Done splitting? [yN] n
120 diff --git a/c b/c
121 new file mode 100644
122 examine changes to 'c'? [Ynesfdaq?] y
123
124 @@ -0,0 +1,1 @@
125 +44
126 record change 1/2 to 'c'? [Ynesfdaq?] y
127
128 diff --git a/d b/d
129 new file mode 100644
130 examine changes to 'd'? [Ynesfdaq?] n
131
132 Done splitting? [yN] n
133 diff --git a/d b/d
134 new file mode 100644
135 examine changes to 'd'? [Ynesfdaq?] y
136
137 @@ -0,0 +1,1 @@
138 +45
139 record this change to 'd'? [Ynesfdaq?] y
140
141 no more change to split
142
143 $ hg log --hidden -G
144 @ changeset: 5:c7f044602e9b
145 | tag: tip
146 | user: test
147 | date: Thu Jan 01 00:00:00 1970 +0000
148 | summary: A0
149 |
150 o changeset: 4:1ae8bc733a14
151 | user: test
152 | date: Thu Jan 01 00:00:00 1970 +0000
153 | summary: A0
154 |
155 o changeset: 3:f257fde29c7a
156 | user: test
157 | date: Thu Jan 01 00:00:00 1970 +0000
158 | summary: A0
159 |
160 o changeset: 2:337fec4d2edc
161 | parent: 0:ea207398892e
162 | user: test
163 | date: Thu Jan 01 00:00:00 1970 +0000
164 | summary: A0
165 |
166 | x changeset: 1:de7290d8b885
167 |/ user: test
168 | date: Thu Jan 01 00:00:00 1970 +0000
169 | obsolete: split using split as 2:337fec4d2edc, 3:f257fde29c7a, 4:1ae8bc733a14, 5:c7f044602e9b
170 | summary: A0
171 |
172 o changeset: 0:ea207398892e
173 user: test
174 date: Thu Jan 01 00:00:00 1970 +0000
175 summary: ROOT
176
177 Actual test
178 -----------
179
180 $ hg obslog de7290d8b885 --hidden --patch
181 x de7290d8b885 (1) A0
182 rewritten(parent, content) as 1ae8bc733a14, 337fec4d2edc, c7f044602e9b, f257fde29c7a using split by test (Thu Jan 01 00:00:00 1970 +0000)
183 (No patch available, too many successors (4))
184
185 $ hg obslog de7290d8b885 --hidden --all --patch
186 o 1ae8bc733a14 (4) A0
187 |
188 | o 337fec4d2edc (2) A0
189 |/
190 | @ c7f044602e9b (5) A0
191 |/
192 | o f257fde29c7a (3) A0
193 |/
194 x de7290d8b885 (1) A0
195 rewritten(parent, content) as 1ae8bc733a14, 337fec4d2edc, c7f044602e9b, f257fde29c7a using split by test (Thu Jan 01 00:00:00 1970 +0000)
196 (No patch available, too many successors (4))
197
198 $ hg obslog de7290d8b885 --hidden --no-graph -Tjson | python -m json.tool
199 [
200 {
201 "markers": [
202 {
203 "date": [
204 *, (glob)
205 0 (glob)
206 ],
207 "effect": [
208 "parent",
209 "content"
210 ],
211 "operation": "split",
212 "succnodes": [
213 "1ae8bc733a14",
214 "337fec4d2edc",
215 "c7f044602e9b",
216 "f257fde29c7a"
217 ],
218 "user": "test",
219 "verb": "rewritten"
220 }
221 ],
222 "node": "de7290d8b885",
223 "rev": 1,
224 "shortdescription": "A0"
225 }
226 ]
227 $ hg obslog c7f044602e9b --patch
228 @ c7f044602e9b (5) A0
229 |
230 x de7290d8b885 (1) A0
231 rewritten(parent, content) as 1ae8bc733a14, 337fec4d2edc, c7f044602e9b, f257fde29c7a using split by test (Thu Jan 01 00:00:00 1970 +0000)
232 (No patch available, too many successors (4))
233
234 $ hg obslog c7f044602e9b --no-graph -Tjson | python -m json.tool
235 [
236 {
237 "markers": [],
238 "node": "c7f044602e9b",
239 "rev": 5,
240 "shortdescription": "A0"
241 },
242 {
243 "markers": [
244 {
245 "date": [
246 *, (glob)
247 0 (glob)
248 ],
249 "effect": [
250 "parent",
251 "content"
252 ],
253 "operation": "split",
254 "succnodes": [
255 "1ae8bc733a14",
256 "337fec4d2edc",
257 "c7f044602e9b",
258 "f257fde29c7a"
259 ],
260 "user": "test",
261 "verb": "rewritten"
262 }
263 ],
264 "node": "de7290d8b885",
265 "rev": 1,
266 "shortdescription": "A0"
267 }
268 ]
269 Check that debugobshistory on all heads show a coherent graph
270 $ hg obslog 2::5 --patch
271 o 1ae8bc733a14 (4) A0
272 |
273 | o 337fec4d2edc (2) A0
274 |/
275 | @ c7f044602e9b (5) A0
276 |/
277 | o f257fde29c7a (3) A0
278 |/
279 x de7290d8b885 (1) A0
280 rewritten(parent, content) as 1ae8bc733a14, 337fec4d2edc, c7f044602e9b, f257fde29c7a using split by test (Thu Jan 01 00:00:00 1970 +0000)
281 (No patch available, too many successors (4))
282
283 $ hg obslog 5 --all --patch
284 o 1ae8bc733a14 (4) A0
285 |
286 | o 337fec4d2edc (2) A0
287 |/
288 | @ c7f044602e9b (5) A0
289 |/
290 | o f257fde29c7a (3) A0
291 |/
292 x de7290d8b885 (1) A0
293 rewritten(parent, content) as 1ae8bc733a14, 337fec4d2edc, c7f044602e9b, f257fde29c7a using split by test (Thu Jan 01 00:00:00 1970 +0000)
294 (No patch available, too many successors (4))
295
296 $ hg update de7290d8b885
297 abort: hidden revision 'de7290d8b885' was split as: 337fec4d2edc, f257fde29c7a and 2 more!
298 (use --hidden to access hidden revisions)
299 [255]
300 $ hg update --hidden 'min(desc(A0))'
301 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
302 updated to hidden changeset de7290d8b885
303 (hidden revision 'de7290d8b885' was split as: 337fec4d2edc, f257fde29c7a and 2 more)
304 working directory parent is obsolete! (de7290d8b885)
305 (use 'hg evolve' to update to its tipmost successor: 337fec4d2edc, f257fde29c7a and 2 more)
306 25
307 Test output with folded commit 26 Test output with folded commit
308 ============================== 27 ==============================
309 28
310 Test setup 29 Test setup