~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/knit.py

  • Committer: Andrew Bennetts
  • Date: 2009-02-17 00:54:19 UTC
  • mto: (4002.1.9 suspend-write-group)
  • mto: This revision was merged to the branch mainline in revision 4025.
  • Revision ID: andrew.bennetts@canonical.com-20090217005419-i9qdpanq2cwm3j59
Add test_insert_record_stream_delta_missing_basis_can_be_added_later.

Show diffs side-by-side

added added

removed removed

Lines of Context:
735
735
            self._factory = KnitPlainFactory()
736
736
        self._fallback_vfs = []
737
737
        self._reload_func = reload_func
 
738
        self._buffered_index_entries = {}
738
739
 
739
740
    def __repr__(self):
740
741
        return "%s(%r, %r)" % (
1374
1375
        # parents must be present to avoid expanding to a fulltext.
1375
1376
        #
1376
1377
        # key = basis_parent, value = index entry to add
1377
 
        buffered_index_entries = {}
 
1378
        buffered_index_entries = self._buffered_index_entries
1378
1379
        for record in stream:
1379
1380
            parents = record.parents
1380
1381
            if record.storage_kind in delta_types:
1475
1476
                    added_keys.extend(
1476
1477
                        [index_entry[0] for index_entry in index_entries])
1477
1478
                    del buffered_index_entries[key]
1478
 
        # If there were any deltas which had a missing basis parent, error.
1479
 
        if buffered_index_entries:
1480
 
            from pprint import pformat
1481
 
            raise errors.RevisionNotPresent(
1482
 
                pformat(sorted(buffered_index_entries.keys())), '<?>')
 
1479
 
 
1480
    def get_missing_compression_parent_keys(self):
 
1481
        return self._buffered_index_entries.keys()
1483
1482
 
1484
1483
    def iter_lines_added_or_present_in_keys(self, keys, pb=None):
1485
1484
        """Iterate over the lines in the versioned files from keys.