466
466
"""See VersionedFile.get_lines()."""
467
467
return self._get_content(version_id).text()
469
def iter_lines_added_or_present_in_versions(self, version_ids=None):
470
"""See VersionedFile.iter_lines_added_or_present_in_versions()."""
471
if version_ids is None:
472
version_ids = self.versions()
473
# we dont care about inclusions, the caller cares.
474
# but we need to setup a list of records to visit.
475
# we need version_id, position, length
476
version_id_records = []
477
for version_id in version_ids:
478
if not self.has_version(version_id):
479
raise RevisionNotPresent(version_id, self.filename)
480
data_pos, length = self._index.get_position(version_id)
481
version_id_records.append((version_id, data_pos, length))
482
for version_id, data, sha_value in \
483
self._data.read_records_iter(version_id_records):
484
method = self._index.get_method(version_id)
485
version_idx = self._index.lookup(version_id)
486
assert method in ('fulltext', 'line-delta')
487
if method == 'fulltext':
488
content = self.factory.parse_fulltext(data, version_idx)
489
for line in content.text():
492
delta = self.factory.parse_line_delta(data, version_idx)
493
for start, end, count, lines in delta:
494
for origin, line in lines:
469
497
def num_versions(self):
470
498
"""See VersionedFile.num_versions()."""
471
499
return self._index.num_versions()
526
554
return self.factory.lower_fulltext(KnitContent(new_lines))
556
#@deprecated_method(zero_eight)
528
557
def walk(self, version_ids):
529
558
"""See VersionedFile.walk."""
530
559
# We take the short path here, and extract all relevant texts