##// END OF EJS Templates
revbranchcache: write cache even during read operations...
Durham Goode -
r24378:9347c15d default
parent child Browse files
Show More
@@ -97,9 +97,6 b' def updatecache(repo):'
97 partial.update(repo, revs)
97 partial.update(repo, revs)
98 partial.write(repo)
98 partial.write(repo)
99
99
100 if repo._revbranchcache is not None:
101 repo._revbranchcache.write()
102
103 assert partial.validfor(repo), filtername
100 assert partial.validfor(repo), filtername
104 repo._branchcaches[repo.filtername] = partial
101 repo._branchcaches[repo.filtername] = partial
105
102
@@ -303,7 +303,11 b' class localrepository(object):'
303 self.names = namespaces.namespaces()
303 self.names = namespaces.namespaces()
304
304
305 def close(self):
305 def close(self):
306 pass
306 self._writecaches()
307
308 def _writecaches(self):
309 if self._revbranchcache:
310 self._revbranchcache.write()
307
311
308 def _restrictcapabilities(self, caps):
312 def _restrictcapabilities(self, caps):
309 # bundle2 is not ready for prime time, drop it unless explicitly
313 # bundle2 is not ready for prime time, drop it unless explicitly
@@ -561,8 +561,8 b' no errors when revbranchcache is not wri'
561 recovery from invalid cache revs file with trailing data
561 recovery from invalid cache revs file with trailing data
562 $ echo >> .hg/cache/rbc-revs-v1
562 $ echo >> .hg/cache/rbc-revs-v1
563 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
563 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
564 5
564 truncating cache/rbc-revs-v1 to 120
565 truncating cache/rbc-revs-v1 to 120
565 5
566 $ f --size .hg/cache/rbc-revs*
566 $ f --size .hg/cache/rbc-revs*
567 .hg/cache/rbc-revs-v1: size=120
567 .hg/cache/rbc-revs-v1: size=120
568 recovery from invalid cache file with partial last record
568 recovery from invalid cache file with partial last record
@@ -571,8 +571,8 b' recovery from invalid cache file with pa'
571 $ f --size .hg/cache/rbc-revs*
571 $ f --size .hg/cache/rbc-revs*
572 .hg/cache/rbc-revs-v1: size=119
572 .hg/cache/rbc-revs-v1: size=119
573 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
573 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
574 5
574 truncating cache/rbc-revs-v1 to 112
575 truncating cache/rbc-revs-v1 to 112
575 5
576 $ f --size .hg/cache/rbc-revs*
576 $ f --size .hg/cache/rbc-revs*
577 .hg/cache/rbc-revs-v1: size=120
577 .hg/cache/rbc-revs-v1: size=120
578 recovery from invalid cache file with missing record - no truncation
578 recovery from invalid cache file with missing record - no truncation
@@ -590,11 +590,11 b' recovery from invalid cache file with so'
590 $ f -qDB 112 rbc-revs-v1 >> .hg/cache/rbc-revs-v1
590 $ f -qDB 112 rbc-revs-v1 >> .hg/cache/rbc-revs-v1
591 $ f --size .hg/cache/rbc-revs*
591 $ f --size .hg/cache/rbc-revs*
592 .hg/cache/rbc-revs-v1: size=120
592 .hg/cache/rbc-revs-v1: size=120
593 $ hg log -r 'branch(.)' -T '{rev} '
593 $ hg log -r 'branch(.)' -T '{rev} ' --debug
594 3 4 8 9 10 11 12 13 (no-eol)
594 3 4 8 9 10 11 12 13 truncating cache/rbc-revs-v1 to 8
595 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
595 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
596 truncating cache/rbc-revs-v1 to 8
597 5
596 5
597 truncating cache/rbc-revs-v1 to 104
598 $ f --size --hexdump --bytes=16 .hg/cache/rbc-revs*
598 $ f --size --hexdump --bytes=16 .hg/cache/rbc-revs*
599 .hg/cache/rbc-revs-v1: size=120
599 .hg/cache/rbc-revs-v1: size=120
600 0000: 19 70 9c 5a 00 00 00 00 dd 6b 44 0d 00 00 00 01 |.p.Z.....kD.....|
600 0000: 19 70 9c 5a 00 00 00 00 dd 6b 44 0d 00 00 00 01 |.p.Z.....kD.....|
@@ -322,6 +322,6 b' Check that the right ancestors is used w'
322 files: 1/1 chunks (100.00%)
322 files: 1/1 chunks (100.00%)
323 added 2 changesets with 2 changes to 1 files
323 added 2 changesets with 2 changes to 1 files
324 invalid branchheads cache (served): tip differs
324 invalid branchheads cache (served): tip differs
325 truncating cache/rbc-revs-v1 to 72
326 rebase completed
325 rebase completed
327 updating the branch cache
326 updating the branch cache
327 truncating cache/rbc-revs-v1 to 72
General Comments 0
You need to be logged in to leave comments. Login now