##// END OF EJS Templates
branchcache: add debug output whenever cache files use truncate...
Mads Kiilerich -
r23862:7aa14055 default
parent child Browse files
Show More
@@ -414,6 +414,7 b' class revbranchcache(object):'
414 414 f.write('\0')
415 415 else:
416 416 f.close()
417 repo.ui.debug("%s changed - rewriting it\n" % _rbcnames)
417 418 self._rbcnamescount = 0
418 419 self._rbcrevslen = 0
419 420 if self._rbcnamescount == 0:
@@ -438,6 +439,7 b' class revbranchcache(object):'
438 439 # see issue3543. SEEK_END was added in 2.5
439 440 f.seek(0, 2) #os.SEEK_END
440 441 if f.tell() != start:
442 repo.ui.debug("truncating %s to %s\n" % (_rbcrevs, start))
441 443 f.seek(start)
442 444 f.truncate()
443 445 end = self._rbcrevslen * _rbcrecsize
@@ -550,6 +550,7 b' revision branch cache is created when bu'
550 550 recovery from invalid cache revs file with trailing data
551 551 $ echo >> .hg/cache/rbc-revs-v1
552 552 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
553 truncating cache/rbc-revs-v1 to 120
553 554 5
554 555 $ f --size .hg/cache/rbc-revs*
555 556 .hg/cache/rbc-revs-v1: size=120
@@ -559,6 +560,7 b' recovery from invalid cache file with pa'
559 560 $ f --size .hg/cache/rbc-revs*
560 561 .hg/cache/rbc-revs-v1: size=119
561 562 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
563 truncating cache/rbc-revs-v1 to 112
562 564 5
563 565 $ f --size .hg/cache/rbc-revs*
564 566 .hg/cache/rbc-revs-v1: size=120
@@ -580,6 +582,7 b' recovery from invalid cache file with so'
580 582 $ hg log -r 'branch(.)' -T '{rev} '
581 583 3 4 8 9 10 11 12 13 (no-eol)
582 584 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
585 truncating cache/rbc-revs-v1 to 8
583 586 5
584 587 $ f --size --hexdump --bytes=16 .hg/cache/rbc-revs*
585 588 .hg/cache/rbc-revs-v1: size=120
@@ -322,5 +322,6 b' Check that the right ancestors is used w'
322 322 files: 1/1 chunks (100.00%)
323 323 added 2 changesets with 2 changes to 1 files
324 324 invalid branchheads cache (served): tip differs
325 truncating cache/rbc-revs-v1 to 72
325 326 rebase completed
326 327 updating the branch cache
General Comments 0
You need to be logged in to leave comments. Login now