Show More
@@ -1455,18 +1455,29 b' class manifestfulltextcache(util.lrucach' | |||||
1455 | if not self._dirty or self._opener is None: |
|
1455 | if not self._dirty or self._opener is None: | |
1456 | return |
|
1456 | return | |
1457 | # rotate backwards to the first used node |
|
1457 | # rotate backwards to the first used node | |
1458 | with self._opener( |
|
1458 | try: | |
1459 | self._file, b'w', atomictemp=True, checkambig=True |
|
1459 | with self._opener( | |
1460 | ) as fp: |
|
1460 | self._file, b'w', atomictemp=True, checkambig=True | |
1461 | node = self._head.prev |
|
1461 | ) as fp: | |
1462 | while True: |
|
1462 | node = self._head.prev | |
1463 | if node.key in self._cache: |
|
1463 | while True: | |
1464 |
|
|
1464 | if node.key in self._cache: | |
1465 |
fp.write( |
|
1465 | fp.write(node.key) | |
1466 | fp.write(node.value) |
|
1466 | fp.write(struct.pack(b'>L', len(node.value))) | |
1467 | if node is self._head: |
|
1467 | fp.write(node.value) | |
1468 |
|
|
1468 | if node is self._head: | |
1469 |
|
|
1469 | break | |
|
1470 | node = node.prev | |||
|
1471 | except IOError: | |||
|
1472 | # We could not write the cache (eg: permission error) | |||
|
1473 | # the content can be missing. | |||
|
1474 | # | |||
|
1475 | # We could try harder and see if we could recreate a wcache | |||
|
1476 | # directory were we coudl write too. | |||
|
1477 | # | |||
|
1478 | # XXX the error pass silently, having some way to issue an error | |||
|
1479 | # log `ui.log` would be nice. | |||
|
1480 | pass | |||
1470 |
|
1481 | |||
1471 | def __len__(self): |
|
1482 | def __len__(self): | |
1472 | if not self._read: |
|
1483 | if not self._read: |
General Comments 0
You need to be logged in to leave comments.
Login now