comparison tests/test-branches-obsolete.t @ 51528:88b0e07dd2cd

branchcache: show the cache file content in test-branches-obsoletes.t This help to track the changes in format between v2 and v3.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 06 Mar 2024 12:07:31 +0100
parents 5f9350956c03
children 4141d12de073
comparison
equal deleted inserted replaced
51527:fa9e3976a5a0 51528:88b0e07dd2cd
20 #if v3 20 #if v3
21 $ cat <<EOF >> $HGRCPATH 21 $ cat <<EOF >> $HGRCPATH
22 > [experimental] 22 > [experimental]
23 > branch-cache-v3=yes 23 > branch-cache-v3=yes
24 > EOF 24 > EOF
25 $ CACHE_PREFIX=branch3
25 #else 26 #else
26 $ cat <<EOF >> $HGRCPATH 27 $ cat <<EOF >> $HGRCPATH
27 > [experimental] 28 > [experimental]
28 > branch-cache-v3=no 29 > branch-cache-v3=no
29 > EOF 30 > EOF
30 #endif 31 $ CACHE_PREFIX=branch2
32 #endif
33
34 $ show_cache() {
35 > for cache_file in .hg/cache/$CACHE_PREFIX*; do
36 > echo "##### $cache_file"
37 > cat $cache_file
38 > done
39 > }
31 40
32 Setup graph 41 Setup graph
33 ############# 42 #############
34 43
35 $ . $RUNTESTDIR/testlib/common.sh 44 $ . $RUNTESTDIR/testlib/common.sh
137 o root 146 o root
138 147
139 $ hg heads -T '{desc}\n' 148 $ hg heads -T '{desc}\n'
140 A_3 149 A_3
141 B_1 150 B_1
151 #if v2
152 $ show_cache
153 ##### .hg/cache/branch2-served
154 7c29ff2453bf38c75ee8982935739103c38a9284 7 f8006d64a10d35c011a5c5fa88be1e25c5929514
155 550bb31f072912453ccbb503de1d554616911e88 o default
156 7c29ff2453bf38c75ee8982935739103c38a9284 o default
157 #else
158 $ show_cache
159 ##### .hg/cache/branch3-served
160 filtered-hash=f8006d64a10d35c011a5c5fa88be1e25c5929514 tip-node=7c29ff2453bf38c75ee8982935739103c38a9284 tip-rev=7
161 550bb31f072912453ccbb503de1d554616911e88 o default
162 7c29ff2453bf38c75ee8982935739103c38a9284 o default
163 #endif
142 $ cd .. 164 $ cd ..
143 165
144 166
145 Actual testing 167 Actual testing
146 ############## 168 ##############
173 o root 195 o root
174 196
175 $ hg heads -T '{desc}\n' 197 $ hg heads -T '{desc}\n'
176 A_3 198 A_3
177 B_1 199 B_1
200 #if v2
201 $ show_cache
202 ##### .hg/cache/branch2
203 3d808bbc94408ea19da905596d4079357a1f28be 8 a943c3355ad9e93654d58b1c934c7c4329a5d1d4
204 550bb31f072912453ccbb503de1d554616911e88 o default
205 7c29ff2453bf38c75ee8982935739103c38a9284 o default
206 ##### .hg/cache/branch2-served
207 3d808bbc94408ea19da905596d4079357a1f28be 8 a943c3355ad9e93654d58b1c934c7c4329a5d1d4
208 550bb31f072912453ccbb503de1d554616911e88 o default
209 7c29ff2453bf38c75ee8982935739103c38a9284 o default
210 #else
211 $ show_cache
212 ##### .hg/cache/branch3
213 filtered-hash=a943c3355ad9e93654d58b1c934c7c4329a5d1d4 tip-node=3d808bbc94408ea19da905596d4079357a1f28be tip-rev=8
214 550bb31f072912453ccbb503de1d554616911e88 o default
215 7c29ff2453bf38c75ee8982935739103c38a9284 o default
216 ##### .hg/cache/branch3-served
217 filtered-hash=a943c3355ad9e93654d58b1c934c7c4329a5d1d4 tip-node=3d808bbc94408ea19da905596d4079357a1f28be tip-rev=8
218 550bb31f072912453ccbb503de1d554616911e88 o default
219 7c29ff2453bf38c75ee8982935739103c38a9284 o default
220 #endif
178 221
179 Even when computing branches from scratch 222 Even when computing branches from scratch
180 223
181 $ rm -rf .hg/cache/branch* 224 $ rm -rf .hg/cache/branch*
182 $ rm -rf .hg/wcache/branch* 225 $ rm -rf .hg/wcache/branch*
183 $ hg heads -T '{desc}\n' 226 $ hg heads -T '{desc}\n'
184 A_3 227 A_3
185 B_1 228 B_1
229 #if v2
230 $ show_cache
231 ##### .hg/cache/branch2-served
232 3d808bbc94408ea19da905596d4079357a1f28be 8 a943c3355ad9e93654d58b1c934c7c4329a5d1d4
233 550bb31f072912453ccbb503de1d554616911e88 o default
234 7c29ff2453bf38c75ee8982935739103c38a9284 o default
235 #else
236 $ show_cache
237 ##### .hg/cache/branch3-served
238 filtered-hash=a943c3355ad9e93654d58b1c934c7c4329a5d1d4 tip-node=3d808bbc94408ea19da905596d4079357a1f28be tip-rev=8
239 550bb31f072912453ccbb503de1d554616911e88 o default
240 7c29ff2453bf38c75ee8982935739103c38a9284 o default
241 #endif
186 242
187 And we can get back to normal 243 And we can get back to normal
188 244
189 $ hg update null --quiet 245 $ hg update null --quiet
190 $ hg heads -T '{desc}\n' 246 $ hg heads -T '{desc}\n'
191 A_3 247 A_3
192 B_1 248 B_1
249 #if v2
250 $ show_cache
251 ##### .hg/cache/branch2-served
252 7c29ff2453bf38c75ee8982935739103c38a9284 7 f8006d64a10d35c011a5c5fa88be1e25c5929514
253 550bb31f072912453ccbb503de1d554616911e88 o default
254 7c29ff2453bf38c75ee8982935739103c38a9284 o default
255 #else
256 $ show_cache
257 ##### .hg/cache/branch3-served
258 filtered-hash=f8006d64a10d35c011a5c5fa88be1e25c5929514 tip-node=7c29ff2453bf38c75ee8982935739103c38a9284 tip-rev=7
259 550bb31f072912453ccbb503de1d554616911e88 o default
260 7c29ff2453bf38c75ee8982935739103c38a9284 o default
261 #endif
193 262
194 $ cd .. 263 $ cd ..
195 $ rm -rf tmp-repo 264 $ rm -rf tmp-repo
196 265
197 Revealing changeset in the middle of the changelog 266 Revealing changeset in the middle of the changelog
220 o root 289 o root
221 290
222 $ hg heads -T '{desc}\n' 291 $ hg heads -T '{desc}\n'
223 A_3 292 A_3
224 B_1 293 B_1
294 #if v2
295 $ show_cache
296 ##### .hg/cache/branch2
297 3d808bbc94408ea19da905596d4079357a1f28be 8 a943c3355ad9e93654d58b1c934c7c4329a5d1d4
298 550bb31f072912453ccbb503de1d554616911e88 o default
299 7c29ff2453bf38c75ee8982935739103c38a9284 o default
300 ##### .hg/cache/branch2-served
301 7c29ff2453bf38c75ee8982935739103c38a9284 7 f8006d64a10d35c011a5c5fa88be1e25c5929514
302 550bb31f072912453ccbb503de1d554616911e88 o default
303 7c29ff2453bf38c75ee8982935739103c38a9284 o default
304 #else
305 $ show_cache
306 ##### .hg/cache/branch3
307 filtered-hash=a943c3355ad9e93654d58b1c934c7c4329a5d1d4 tip-node=3d808bbc94408ea19da905596d4079357a1f28be tip-rev=8
308 550bb31f072912453ccbb503de1d554616911e88 o default
309 7c29ff2453bf38c75ee8982935739103c38a9284 o default
310 ##### .hg/cache/branch3-served
311 filtered-hash=f8006d64a10d35c011a5c5fa88be1e25c5929514 tip-node=7c29ff2453bf38c75ee8982935739103c38a9284 tip-rev=7
312 550bb31f072912453ccbb503de1d554616911e88 o default
313 7c29ff2453bf38c75ee8982935739103c38a9284 o default
314 #endif
225 315
226 Even when computing branches from scratch 316 Even when computing branches from scratch
227 317
228 $ rm -rf .hg/cache/branch* 318 $ rm -rf .hg/cache/branch*
229 $ rm -rf .hg/wcache/branch* 319 $ rm -rf .hg/wcache/branch*
230 $ hg heads -T '{desc}\n' 320 $ hg heads -T '{desc}\n'
231 A_3 321 A_3
232 B_1 322 B_1
323 #if v2
324 $ show_cache
325 ##### .hg/cache/branch2-served
326 7c29ff2453bf38c75ee8982935739103c38a9284 7 f8006d64a10d35c011a5c5fa88be1e25c5929514
327 550bb31f072912453ccbb503de1d554616911e88 o default
328 7c29ff2453bf38c75ee8982935739103c38a9284 o default
329 #else
330 $ show_cache
331 ##### .hg/cache/branch3-served
332 filtered-hash=f8006d64a10d35c011a5c5fa88be1e25c5929514 tip-node=7c29ff2453bf38c75ee8982935739103c38a9284 tip-rev=7
333 550bb31f072912453ccbb503de1d554616911e88 o default
334 7c29ff2453bf38c75ee8982935739103c38a9284 o default
335 #endif
233 336
234 And we can get back to normal 337 And we can get back to normal
235 338
236 $ hg update null --quiet 339 $ hg update null --quiet
237 $ hg heads -T '{desc}\n' 340 $ hg heads -T '{desc}\n'
238 A_3 341 A_3
239 B_1 342 B_1
343 #if v2
344 $ show_cache
345 ##### .hg/cache/branch2-served
346 7c29ff2453bf38c75ee8982935739103c38a9284 7 f8006d64a10d35c011a5c5fa88be1e25c5929514
347 550bb31f072912453ccbb503de1d554616911e88 o default
348 7c29ff2453bf38c75ee8982935739103c38a9284 o default
349 #else
350 $ show_cache
351 ##### .hg/cache/branch3-served
352 filtered-hash=f8006d64a10d35c011a5c5fa88be1e25c5929514 tip-node=7c29ff2453bf38c75ee8982935739103c38a9284 tip-rev=7
353 550bb31f072912453ccbb503de1d554616911e88 o default
354 7c29ff2453bf38c75ee8982935739103c38a9284 o default
355 #endif
240 356
241 $ cd .. 357 $ cd ..
242 $ rm -rf tmp-repo 358 $ rm -rf tmp-repo
243 359
244 Getting the obsolescence marker after the fact for the tip rev 360 Getting the obsolescence marker after the fact for the tip rev
278 branch head are okay 394 branch head are okay
279 395
280 $ hg heads -T '{desc}\n' 396 $ hg heads -T '{desc}\n'
281 A_3 397 A_3
282 B_4 398 B_4
399 #if v2
400 $ show_cache
401 ##### .hg/cache/branch2-served
402 3d808bbc94408ea19da905596d4079357a1f28be 8 ac5282439f301518f362f37547fcd52bcc670373
403 63ba7cd843d1e95aac1a24435befeb1909c53619 o default
404 7c29ff2453bf38c75ee8982935739103c38a9284 o default
405 #else
406 $ show_cache
407 ##### .hg/cache/branch3-served
408 filtered-hash=ac5282439f301518f362f37547fcd52bcc670373 tip-node=3d808bbc94408ea19da905596d4079357a1f28be tip-rev=8
409 63ba7cd843d1e95aac1a24435befeb1909c53619 o default
410 7c29ff2453bf38c75ee8982935739103c38a9284 o default
411 #endif
283 412
284 Even when computing branches from scratch 413 Even when computing branches from scratch
285 414
286 $ rm -rf .hg/cache/branch* 415 $ rm -rf .hg/cache/branch*
287 $ rm -rf .hg/wcache/branch* 416 $ rm -rf .hg/wcache/branch*
288 $ hg heads -T '{desc}\n' 417 $ hg heads -T '{desc}\n'
289 A_3 418 A_3
290 B_4 419 B_4
420 #if v2
421 $ show_cache
422 ##### .hg/cache/branch2-served
423 3d808bbc94408ea19da905596d4079357a1f28be 8 ac5282439f301518f362f37547fcd52bcc670373
424 63ba7cd843d1e95aac1a24435befeb1909c53619 o default
425 7c29ff2453bf38c75ee8982935739103c38a9284 o default
426 #else
427 $ show_cache
428 ##### .hg/cache/branch3-served
429 filtered-hash=ac5282439f301518f362f37547fcd52bcc670373 tip-node=3d808bbc94408ea19da905596d4079357a1f28be tip-rev=8
430 63ba7cd843d1e95aac1a24435befeb1909c53619 o default
431 7c29ff2453bf38c75ee8982935739103c38a9284 o default
432 #endif
291 433
292 And we can get back to normal 434 And we can get back to normal
293 435
294 $ hg update null --quiet 436 $ hg update null --quiet
295 $ hg heads -T '{desc}\n' 437 $ hg heads -T '{desc}\n'
296 A_3 438 A_3
297 B_4 439 B_4
440 #if v2
441 $ show_cache
442 ##### .hg/cache/branch2-served
443 7c29ff2453bf38c75ee8982935739103c38a9284 7
444 63ba7cd843d1e95aac1a24435befeb1909c53619 o default
445 7c29ff2453bf38c75ee8982935739103c38a9284 o default
446 #else
447 $ show_cache
448 ##### .hg/cache/branch3-served
449 tip-node=7c29ff2453bf38c75ee8982935739103c38a9284 tip-rev=7
450 63ba7cd843d1e95aac1a24435befeb1909c53619 o default
451 7c29ff2453bf38c75ee8982935739103c38a9284 o default
452 #endif
298 453
299 $ cd .. 454 $ cd ..
300 $ rm -rf tmp-repo 455 $ rm -rf tmp-repo
301 456
302 Getting the obsolescence marker after the fact for another rev 457 Getting the obsolescence marker after the fact for another rev
325 o root 480 o root
326 481
327 $ hg heads -T '{desc}\n' 482 $ hg heads -T '{desc}\n'
328 A_4 483 A_4
329 B_4 484 B_4
485 #if v2
486 $ show_cache
487 ##### .hg/cache/branch2-served
488 3d808bbc94408ea19da905596d4079357a1f28be 8
489 63ba7cd843d1e95aac1a24435befeb1909c53619 o default
490 3d808bbc94408ea19da905596d4079357a1f28be o default
491 #else
492 $ show_cache
493 ##### .hg/cache/branch3-served
494 tip-node=3d808bbc94408ea19da905596d4079357a1f28be tip-rev=8
495 63ba7cd843d1e95aac1a24435befeb1909c53619 o default
496 3d808bbc94408ea19da905596d4079357a1f28be o default
497 #endif
498
330 $ hg pull --rev `cat ../main-single-branch-node_B4` --remote-hidden 499 $ hg pull --rev `cat ../main-single-branch-node_B4` --remote-hidden
331 pulling from $TESTTMP/main-single-branch 500 pulling from $TESTTMP/main-single-branch
332 no changes found 501 no changes found
333 3 new obsolescence markers 502 3 new obsolescence markers
334 obsoleted 3 changesets 503 obsoleted 3 changesets
336 branch head are okay 505 branch head are okay
337 506
338 $ hg heads -T '{desc}\n' 507 $ hg heads -T '{desc}\n'
339 A_4 508 A_4
340 B_1 509 B_1
510 #if v2
511 $ show_cache
512 ##### .hg/cache/branch2-served
513 3d808bbc94408ea19da905596d4079357a1f28be 8 f8006d64a10d35c011a5c5fa88be1e25c5929514
514 550bb31f072912453ccbb503de1d554616911e88 o default
515 3d808bbc94408ea19da905596d4079357a1f28be o default
516 #else
517 $ show_cache
518 ##### .hg/cache/branch3-served
519 filtered-hash=f8006d64a10d35c011a5c5fa88be1e25c5929514 tip-node=3d808bbc94408ea19da905596d4079357a1f28be tip-rev=8
520 550bb31f072912453ccbb503de1d554616911e88 o default
521 3d808bbc94408ea19da905596d4079357a1f28be o default
522 #endif
341 523
342 Even when computing branches from scratch 524 Even when computing branches from scratch
343 525
344 $ rm -rf .hg/cache/branch* 526 $ rm -rf .hg/cache/branch*
345 $ rm -rf .hg/wcache/branch* 527 $ rm -rf .hg/wcache/branch*
346 $ hg heads -T '{desc}\n' 528 $ hg heads -T '{desc}\n'
347 A_4 529 A_4
348 B_1 530 B_1
531 #if v2
532 $ show_cache
533 ##### .hg/cache/branch2-served
534 3d808bbc94408ea19da905596d4079357a1f28be 8 f8006d64a10d35c011a5c5fa88be1e25c5929514
535 550bb31f072912453ccbb503de1d554616911e88 o default
536 3d808bbc94408ea19da905596d4079357a1f28be o default
537 #else
538 $ show_cache
539 ##### .hg/cache/branch3-served
540 filtered-hash=f8006d64a10d35c011a5c5fa88be1e25c5929514 tip-node=3d808bbc94408ea19da905596d4079357a1f28be tip-rev=8
541 550bb31f072912453ccbb503de1d554616911e88 o default
542 3d808bbc94408ea19da905596d4079357a1f28be o default
543 #endif
349 544
350 And we can get back to normal 545 And we can get back to normal
351 546
352 $ hg update null --quiet 547 $ hg update null --quiet
353 $ hg heads -T '{desc}\n' 548 $ hg heads -T '{desc}\n'
354 A_4 549 A_4
355 B_1 550 B_1
551 #if v2
552 $ show_cache
553 ##### .hg/cache/branch2-served
554 3d808bbc94408ea19da905596d4079357a1f28be 8 f8006d64a10d35c011a5c5fa88be1e25c5929514
555 550bb31f072912453ccbb503de1d554616911e88 o default
556 3d808bbc94408ea19da905596d4079357a1f28be o default
557 #else
558 $ show_cache
559 ##### .hg/cache/branch3-served
560 filtered-hash=f8006d64a10d35c011a5c5fa88be1e25c5929514 tip-node=3d808bbc94408ea19da905596d4079357a1f28be tip-rev=8
561 550bb31f072912453ccbb503de1d554616911e88 o default
562 3d808bbc94408ea19da905596d4079357a1f28be o default
563 #endif
356 564
357 $ cd .. 565 $ cd ..
358 $ rm -rf tmp-repo 566 $ rm -rf tmp-repo