comparison tests/test-tags.t @ 24760:410f3856196f

tags: change format of tags cache files .hgtags fnodes are now written to a shared cache file. They don't need to exist in the per-filter tags cache files. Stop writing them. The format of the tags cache file has changed in a backwards incompatible way. This should be acceptable, as we just established per-filter tags cache files and no client should have per-filter tags cache files that will need to be read. So no backwards compatbility concern is present. The new format has a single header line followed by resolved tags entries. The header line is similar to the old first line with a major difference: we now compute and store a hash of the filtered revisions. Before, if the set of filtered revs changed, we may return incorrect results. We now detect that. A test for verifying filtered rev change is handled properly has been added.
author Gregory Szorc <gregory.szorc@gmail.com>
date Thu, 16 Apr 2015 12:01:00 -0400
parents d082c6ef9ec3
children 1062663808ce
comparison
equal deleted inserted replaced
24759:d082c6ef9ec3 24760:410f3856196f
131 b9154636be93 tip 131 b9154636be93 tip
132 $ hg blackbox -l 5 132 $ hg blackbox -l 5
133 1970/01/01 00:00:00 bob> identify 133 1970/01/01 00:00:00 bob> identify
134 1970/01/01 00:00:00 bob> writing 48 bytes to cache/hgtagsfnodes1 134 1970/01/01 00:00:00 bob> writing 48 bytes to cache/hgtagsfnodes1
135 1970/01/01 00:00:00 bob> 0/1 cache hits/lookups in * seconds (glob) 135 1970/01/01 00:00:00 bob> 0/1 cache hits/lookups in * seconds (glob)
136 1970/01/01 00:00:00 bob> writing tags cache file with 1 heads and 1 tags 136 1970/01/01 00:00:00 bob> writing tags cache file with 1 tags
137 1970/01/01 00:00:00 bob> identify exited 0 after ?.?? seconds (glob) 137 1970/01/01 00:00:00 bob> identify exited 0 after ?.?? seconds (glob)
138 138
139 Failure to acquire lock results in no write 139 Failure to acquire lock results in no write
140 140
141 $ rm -f .hg/cache/tags-visible .hg/cache/hgtagsfnodes1 141 $ rm -f .hg/cache/tags-visible .hg/cache/hgtagsfnodes1
144 b9154636be93 tip 144 b9154636be93 tip
145 $ hg blackbox -l 5 145 $ hg blackbox -l 5
146 1970/01/01 00:00:00 bob> identify 146 1970/01/01 00:00:00 bob> identify
147 1970/01/01 00:00:00 bob> not writing .hg/cache/hgtagsfnodes1 because lock held 147 1970/01/01 00:00:00 bob> not writing .hg/cache/hgtagsfnodes1 because lock held
148 1970/01/01 00:00:00 bob> 0/1 cache hits/lookups in * seconds (glob) 148 1970/01/01 00:00:00 bob> 0/1 cache hits/lookups in * seconds (glob)
149 1970/01/01 00:00:00 bob> writing tags cache file with 1 heads and 1 tags 149 1970/01/01 00:00:00 bob> writing tags cache file with 1 tags
150 1970/01/01 00:00:00 bob> identify exited 0 after * seconds (glob) 150 1970/01/01 00:00:00 bob> identify exited 0 after * seconds (glob)
151 151
152 $ fnodescacheexists 152 $ fnodescacheexists
153 no fnodes cache 153 no fnodes cache
154 154
310 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar 310 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
311 311
312 Dump cache: 312 Dump cache:
313 313
314 $ cat .hg/cache/tags-visible 314 $ cat .hg/cache/tags-visible
315 4 0c192d7d5e6b78a714de54a2e9627952a877e25a 0c04f2a8af31de17fab7422878ee5a2dadbc943d 315 4 0c192d7d5e6b78a714de54a2e9627952a877e25a
316 3 6fa450212aeb2a21ed616a54aea39a4a27894cd7 7d3b718c964ef37b89e550ebdafd5789e76ce1b0
317 2 7a94127795a33c10a370c93f731fd9fea0b79af6 0c04f2a8af31de17fab7422878ee5a2dadbc943d
318
319 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar 316 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
320 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar 317 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
321 78391a272241d70354aa14c874552cad6b51bb42 bar 318 78391a272241d70354aa14c874552cad6b51bb42 bar
322 319
323 $ f --size --hexdump .hg/cache/hgtagsfnodes1 320 $ f --size --hexdump .hg/cache/hgtagsfnodes1
344 341
345 $ hg blackbox -l 5 342 $ hg blackbox -l 5
346 1970/01/01 00:00:00 bob> tags 343 1970/01/01 00:00:00 bob> tags
347 1970/01/01 00:00:00 bob> writing 24 bytes to cache/hgtagsfnodes1 344 1970/01/01 00:00:00 bob> writing 24 bytes to cache/hgtagsfnodes1
348 1970/01/01 00:00:00 bob> 2/3 cache hits/lookups in * seconds (glob) 345 1970/01/01 00:00:00 bob> 2/3 cache hits/lookups in * seconds (glob)
349 1970/01/01 00:00:00 bob> writing tags cache file with 3 heads and 1 tags 346 1970/01/01 00:00:00 bob> writing tags cache file with 1 tags
350 1970/01/01 00:00:00 bob> tags exited 0 after * seconds (glob) 347 1970/01/01 00:00:00 bob> tags exited 0 after * seconds (glob)
351 348
352 #if unix-permissions no-root 349 #if unix-permissions no-root
353 Errors writing to .hgtags fnodes cache are silently ignored 350 Errors writing to .hgtags fnodes cache are silently ignored
354 351
364 361
365 $ hg blackbox -l 5 362 $ hg blackbox -l 5
366 1970/01/01 00:00:00 bob> tags 363 1970/01/01 00:00:00 bob> tags
367 1970/01/01 00:00:00 bob> couldn't write cache/hgtagsfnodes1: [Errno 13] Permission denied: '$TESTTMP/t2/.hg/cache/hgtagsfnodes1' 364 1970/01/01 00:00:00 bob> couldn't write cache/hgtagsfnodes1: [Errno 13] Permission denied: '$TESTTMP/t2/.hg/cache/hgtagsfnodes1'
368 1970/01/01 00:00:00 bob> 2/3 cache hits/lookups in * seconds (glob) 365 1970/01/01 00:00:00 bob> 2/3 cache hits/lookups in * seconds (glob)
369 1970/01/01 00:00:00 bob> writing tags cache file with 3 heads and 1 tags 366 1970/01/01 00:00:00 bob> writing tags cache file with 1 tags
370 1970/01/01 00:00:00 bob> tags exited 0 after * seconds (glob) 367 1970/01/01 00:00:00 bob> tags exited 0 after * seconds (glob)
371 368
372 $ chmod a+w .hg/cache/hgtagsfnodes1 369 $ chmod a+w .hg/cache/hgtagsfnodes1
373 #endif 370 #endif
374 371
379 376
380 $ hg blackbox -l 5 377 $ hg blackbox -l 5
381 1970/01/01 00:00:00 bob> tags 378 1970/01/01 00:00:00 bob> tags
382 1970/01/01 00:00:00 bob> writing 24 bytes to cache/hgtagsfnodes1 379 1970/01/01 00:00:00 bob> writing 24 bytes to cache/hgtagsfnodes1
383 1970/01/01 00:00:00 bob> 2/3 cache hits/lookups in * seconds (glob) 380 1970/01/01 00:00:00 bob> 2/3 cache hits/lookups in * seconds (glob)
384 1970/01/01 00:00:00 bob> writing tags cache file with 3 heads and 1 tags 381 1970/01/01 00:00:00 bob> writing tags cache file with 1 tags
385 1970/01/01 00:00:00 bob> tags exited 0 after * seconds (glob) 382 1970/01/01 00:00:00 bob> tags exited 0 after * seconds (glob)
386 383
387 $ f --size .hg/cache/hgtagsfnodes1 384 $ f --size .hg/cache/hgtagsfnodes1
388 .hg/cache/hgtagsfnodes1: size=168 385 .hg/cache/hgtagsfnodes1: size=168
389 386
395 bar 1:78391a272241 392 bar 1:78391a272241
396 393
397 $ hg blackbox -l 4 394 $ hg blackbox -l 4
398 1970/01/01 00:00:00 bob> tags 395 1970/01/01 00:00:00 bob> tags
399 1970/01/01 00:00:00 bob> 3/3 cache hits/lookups in * seconds (glob) 396 1970/01/01 00:00:00 bob> 3/3 cache hits/lookups in * seconds (glob)
400 1970/01/01 00:00:00 bob> writing tags cache file with 3 heads and 1 tags 397 1970/01/01 00:00:00 bob> writing tags cache file with 1 tags
401 1970/01/01 00:00:00 bob> tags exited 0 after * seconds (glob) 398 1970/01/01 00:00:00 bob> tags exited 0 after * seconds (glob)
402 399
403 $ f --size .hg/cache/hgtagsfnodes1 400 $ f --size .hg/cache/hgtagsfnodes1
404 .hg/cache/hgtagsfnodes1: size=168 401 .hg/cache/hgtagsfnodes1: size=168
405 402
412 409
413 $ hg blackbox -l 5 410 $ hg blackbox -l 5
414 1970/01/01 00:00:00 bob> tags 411 1970/01/01 00:00:00 bob> tags
415 1970/01/01 00:00:00 bob> writing 24 bytes to cache/hgtagsfnodes1 412 1970/01/01 00:00:00 bob> writing 24 bytes to cache/hgtagsfnodes1
416 1970/01/01 00:00:00 bob> 2/3 cache hits/lookups in * seconds (glob) 413 1970/01/01 00:00:00 bob> 2/3 cache hits/lookups in * seconds (glob)
417 1970/01/01 00:00:00 bob> writing tags cache file with 3 heads and 1 tags 414 1970/01/01 00:00:00 bob> writing tags cache file with 1 tags
418 1970/01/01 00:00:00 bob> tags exited 0 after * seconds (glob) 415 1970/01/01 00:00:00 bob> tags exited 0 after * seconds (glob)
419 $ f --size .hg/cache/hgtagsfnodes1 416 $ f --size .hg/cache/hgtagsfnodes1
420 .hg/cache/hgtagsfnodes1: size=144 417 .hg/cache/hgtagsfnodes1: size=144
421 418
422 $ hg -q --config extensions.strip= strip -r 5 --no-backup 419 $ hg -q --config extensions.strip= strip -r 5 --no-backup