798
799
text_map[version_id] = text
799
800
return text_map, final_content
801
def iter_lines_added_or_present_in_versions(self, version_ids=None):
802
def iter_lines_added_or_present_in_versions(self, version_ids=None,
802
804
"""See VersionedFile.iter_lines_added_or_present_in_versions()."""
803
805
if version_ids is None:
804
806
version_ids = self.versions()
808
pb = progress.DummyProgress()
805
809
# we don't care about inclusions, the caller cares.
806
810
# but we need to setup a list of records to visit.
807
811
# we need version_id, position, length
819
823
data_pos, length = self._index.get_position(version_id)
820
824
version_id_records.append((version_id, data_pos, length))
822
pb = bzrlib.ui.ui_factory.nested_progress_bar()
824
827
total = len(version_id_records)
828
pb.update('Walking content.', count, total)
829
for version_id, data, sha_value in \
830
self._data.read_records_iter(version_id_records):
826
831
pb.update('Walking content.', count, total)
827
for version_id, data, sha_value in \
828
self._data.read_records_iter(version_id_records):
829
pb.update('Walking content.', count, total)
830
method = self._index.get_method(version_id)
831
version_idx = self._index.lookup(version_id)
832
assert method in ('fulltext', 'line-delta')
833
if method == 'fulltext':
834
content = self.factory.parse_fulltext(data, version_idx)
835
for line in content.text():
832
method = self._index.get_method(version_id)
833
version_idx = self._index.lookup(version_id)
834
assert method in ('fulltext', 'line-delta')
835
if method == 'fulltext':
836
content = self.factory.parse_fulltext(data, version_idx)
837
for line in content.text():
840
delta = self.factory.parse_line_delta(data, version_idx)
841
for start, end, count, lines in delta:
842
for origin, line in lines:
838
delta = self.factory.parse_line_delta(data, version_idx)
839
for start, end, count, lines in delta:
840
for origin, line in lines:
843
pb.update('Walking content.', total, total)
846
pb.update('Walking content.', total, total)
845
pb.update('Walking content.', total, total)
850
847
def num_versions(self):
851
848
"""See VersionedFile.num_versions()."""