~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/knit.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-02-26 05:27:17 UTC
  • mfrom: (4052.1.2 bug-304841)
  • Revision ID: pqm@pqm.ubuntu.com-20090226052717-5tbzaulyew9auo7t
(robertc) Fix the root cause of bug 304841 rather than changing the
        fetch order. (Robert Collins, John Arbash-Meinel)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1517
1517
        # key = basis_parent, value = index entry to add
1518
1518
        buffered_index_entries = {}
1519
1519
        for record in stream:
 
1520
            buffered = False
1520
1521
            parents = record.parents
1521
1522
            if record.storage_kind in delta_types:
1522
1523
                # TODO: eventually the record itself should track
1568
1569
                access_memo = self._access.add_raw_records(
1569
1570
                    [(record.key, len(bytes))], bytes)[0]
1570
1571
                index_entry = (record.key, options, access_memo, parents)
1571
 
                buffered = False
1572
1572
                if 'fulltext' not in options:
1573
1573
                    # Not a fulltext, so we need to make sure the compression
1574
1574
                    # parent will also be present.
1609
1609
                except errors.RevisionAlreadyPresent:
1610
1610
                    pass
1611
1611
            # Add any records whose basis parent is now available.
1612
 
            added_keys = [record.key]
1613
 
            while added_keys:
1614
 
                key = added_keys.pop(0)
1615
 
                if key in buffered_index_entries:
1616
 
                    index_entries = buffered_index_entries[key]
1617
 
                    self._index.add_records(index_entries)
1618
 
                    added_keys.extend(
1619
 
                        [index_entry[0] for index_entry in index_entries])
1620
 
                    del buffered_index_entries[key]
 
1612
            if not buffered:
 
1613
                added_keys = [record.key]
 
1614
                while added_keys:
 
1615
                    key = added_keys.pop(0)
 
1616
                    if key in buffered_index_entries:
 
1617
                        index_entries = buffered_index_entries[key]
 
1618
                        self._index.add_records(index_entries)
 
1619
                        added_keys.extend(
 
1620
                            [index_entry[0] for index_entry in index_entries])
 
1621
                        del buffered_index_entries[key]
1621
1622
        if buffered_index_entries:
1622
1623
            # There were index entries buffered at the end of the stream,
1623
1624
            # So these need to be added (if the index supports holding such