~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/pack_repo.py

  • Committer: Alexander Belchenko
  • Date: 2007-11-19 22:54:30 UTC
  • mfrom: (3006 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3008.
  • Revision ID: bialix@ukr.net-20071119225430-x0ewosrsagis0yno
merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
708
708
        """Copy knit nodes between packs.
709
709
 
710
710
        :param output_lines: Return lines present in the copied data as
711
 
            an iterator.
 
711
            an iterator of line,version_id.
712
712
        """
713
713
        pb = ui.ui_factory.nested_progress_bar()
714
714
        try:
754
754
            for (names, read_func), (_1, _2, (key, eol_flag, references)) in \
755
755
                izip(reader.iter_records(), pack_readv_requests):
756
756
                raw_data = read_func(None)
 
757
                version_id = key[-1]
757
758
                if output_lines:
758
759
                    # read the entire thing
759
 
                    content, _ = knit_data._parse_record(key[-1], raw_data)
 
760
                    content, _ = knit_data._parse_record(version_id, raw_data)
760
761
                    if len(references[-1]) == 0:
761
762
                        line_iterator = factory.get_fulltext_content(content)
762
763
                    else:
763
764
                        line_iterator = factory.get_linedelta_content(content)
764
765
                    for line in line_iterator:
765
 
                        yield line
 
766
                        yield line, version_id
766
767
                else:
767
768
                    # check the header only
768
 
                    df, _ = knit_data._parse_record_header(key[-1], raw_data)
 
769
                    df, _ = knit_data._parse_record_header(version_id, raw_data)
769
770
                    df.close()
770
771
                pos, size = writer.add_bytes_record(raw_data, names)
771
772
                write_index.add_node(key, eol_flag + "%d %d" % (pos, size), references)