1102
1103
self._repository.unlock()
1103
1104
return SuccessfulSmartServerResponse(("ok", ), )
1107
class SmartServerRepositoryIterRevisions(SmartServerRepositoryRequest):
1108
"""Stream a list of revisions.
1110
The client sends a list of newline-separated revision ids in the
1111
body of the request and the server replies with the serializer format,
1112
and a stream of bzip2-compressed revision texts (using the specified
1115
Any revisions the server does not have are omitted from the stream.
1120
def do_repository_request(self, repository):
1121
self._repository = repository
1122
# Signal there is a body
1125
def do_body(self, body_bytes):
1126
revision_ids = body_bytes.split("\n")
1127
return SuccessfulSmartServerResponse(
1128
('ok', self._repository.get_serializer_format()),
1129
body_stream=self.body_stream(self._repository, revision_ids))
1131
def body_stream(self, repository, revision_ids):
1132
self._repository.lock_read()
1134
for record in repository.revisions.get_record_stream(
1135
[(revid,) for revid in revision_ids], 'unordered', True):
1136
if record.storage_kind == 'absent':
1138
yield zlib.compress(record.get_bytes_as('fulltext'))
1140
self._repository.unlock()