Show More
@@ -607,8 +607,8 b' class obsstore(object):' | |||||
607 | offset = f.tell() |
|
607 | offset = f.tell() | |
608 | transaction.add('obsstore', offset) |
|
608 | transaction.add('obsstore', offset) | |
609 | # offset == 0: new file - add the version header |
|
609 | # offset == 0: new file - add the version header | |
610 |
|
|
610 | data = b''.join(encodemarkers(new, offset == 0, self._version)) | |
611 |
|
|
611 | f.write(data) | |
612 | finally: |
|
612 | finally: | |
613 | # XXX: f.close() == filecache invalidation == obsstore rebuilt. |
|
613 | # XXX: f.close() == filecache invalidation == obsstore rebuilt. | |
614 | # call 'filecacheentry.refresh()' here |
|
614 | # call 'filecacheentry.refresh()' here | |
@@ -616,7 +616,7 b' class obsstore(object):' | |||||
616 | addedmarkers = transaction.changes.get('obsmarkers') |
|
616 | addedmarkers = transaction.changes.get('obsmarkers') | |
617 | if addedmarkers is not None: |
|
617 | if addedmarkers is not None: | |
618 | addedmarkers.update(new) |
|
618 | addedmarkers.update(new) | |
619 | self._addmarkers(new) |
|
619 | self._addmarkers(new, data) | |
620 | # new marker *may* have changed several set. invalidate the cache. |
|
620 | # new marker *may* have changed several set. invalidate the cache. | |
621 | self.caches.clear() |
|
621 | self.caches.clear() | |
622 | # records the number of new markers for the transaction hooks |
|
622 | # records the number of new markers for the transaction hooks | |
@@ -673,8 +673,9 b' class obsstore(object):' | |||||
673 | def _cached(self, attr): |
|
673 | def _cached(self, attr): | |
674 | return attr in self.__dict__ |
|
674 | return attr in self.__dict__ | |
675 |
|
675 | |||
676 | def _addmarkers(self, markers): |
|
676 | def _addmarkers(self, markers, rawdata): | |
677 | markers = list(markers) # to allow repeated iteration |
|
677 | markers = list(markers) # to allow repeated iteration | |
|
678 | self._data = self._data + rawdata | |||
678 | self._all.extend(markers) |
|
679 | self._all.extend(markers) | |
679 | if self._cached('successors'): |
|
680 | if self._cached('successors'): | |
680 | _addsuccessors(self.successors, markers) |
|
681 | _addsuccessors(self.successors, markers) |
General Comments 0
You need to be logged in to leave comments.
Login now