Show More
@@ -476,25 +476,21 b' class revbranchcache(object):' | |||||
476 | if self._rbcnamescount < len(self._names): |
|
476 | if self._rbcnamescount < len(self._names): | |
477 | step = ' names' |
|
477 | step = ' names' | |
478 | wlock = repo.wlock(wait=False) |
|
478 | wlock = repo.wlock(wait=False) | |
479 | if True: |
|
|||
480 |
|
|
479 | if self._rbcnamescount != 0: | |
481 |
|
|
480 | f = repo.vfs.open(_rbcnames, 'ab') | |
482 |
|
|
481 | if f.tell() == self._rbcsnameslen: | |
483 |
|
|
482 | f.write('\0') | |
484 |
|
|
483 | else: | |
485 |
|
|
484 | f.close() | |
486 |
|
|
485 | repo.ui.debug("%s changed - rewriting it\n" % _rbcnames) | |
487 | % _rbcnames) |
|
|||
488 |
|
|
486 | self._rbcnamescount = 0 | |
489 |
|
|
487 | self._rbcrevslen = 0 | |
490 |
|
|
488 | if self._rbcnamescount == 0: | |
491 |
|
|
489 | # before rewriting names, make sure references are removed | |
492 | # removed |
|
|||
493 |
|
|
490 | repo.vfs.unlinkpath(_rbcrevs, ignoremissing=True) | |
494 |
|
|
491 | f = repo.vfs.open(_rbcnames, 'wb') | |
495 |
|
|
492 | f.write('\0'.join(encoding.fromlocal(b) | |
496 |
|
|
493 | for b in self._names[self._rbcnamescount:])) | |
497 | )) |
|
|||
498 |
|
|
494 | self._rbcsnameslen = f.tell() | |
499 |
|
|
495 | f.close() | |
500 | self._rbcnamescount = len(self._names) |
|
496 | self._rbcnamescount = len(self._names) | |
@@ -506,11 +502,9 b' class revbranchcache(object):' | |||||
506 | wlock = repo.wlock(wait=False) |
|
502 | wlock = repo.wlock(wait=False) | |
507 | revs = min(len(repo.changelog), |
|
503 | revs = min(len(repo.changelog), | |
508 | len(self._rbcrevs) // _rbcrecsize) |
|
504 | len(self._rbcrevs) // _rbcrecsize) | |
509 | if True: |
|
|||
510 |
|
|
505 | f = repo.vfs.open(_rbcrevs, 'ab') | |
511 |
|
|
506 | if f.tell() != start: | |
512 |
|
|
507 | repo.ui.debug("truncating %s to %s\n" % (_rbcrevs, start)) | |
513 | % (_rbcrevs, start)) |
|
|||
514 |
|
|
508 | f.seek(start) | |
515 |
|
|
509 | if f.tell() != start: | |
516 |
|
|
510 | start = 0 |
General Comments 0
You need to be logged in to leave comments.
Login now