1339
1339
last_fulltext_len = None
1340
1340
max_fulltext_len = 0
1341
1341
max_fulltext_prefix = None
1342
insert_manager = None
1342
1345
for record in stream:
1343
1346
# Raise an error when a record is missing.
1344
1347
if record.storage_kind == 'absent':
1345
1348
raise errors.RevisionNotPresent(record.key, self)
1349
if record.storage_kind == 'groupcompress-block':
1350
# Insert the raw block into the target repo
1351
insert_manager = record._manager
1352
bytes = record._manager._block.to_bytes()
1353
_, start, length = self._access.add_raw_records(
1354
[(None, len(bytes))], bytes)[0]
1357
block_length = length
1358
if record.storage_kind in ('groupcompress-block',
1359
'groupcompress-block-ref'):
1360
assert insert_manager is not None
1361
assert record._manager is insert_manager
1362
value = "%d %d %d %d" % (block_start, block_length,
1363
record._start, record._end)
1364
nodes = [(record.key, value, (record.parents,))]
1365
self._index.add_records(nodes, random_id=random_id)
1347
1368
bytes = record.get_bytes_as('fulltext')
1348
1369
except errors.UnavailableRepresentation: