/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/fetch.py

Insert a single stream with all inventories being fetched, not one per inventory.

Show diffs side-by-side

added added

removed removed

Lines of Context:
310
310
            True) # We need them as full-texts so we can find their references
311
311
        uninteresting_chk_roots = set()
312
312
        interesting_chk_roots = set()
313
 
        for record in inv_stream:
314
 
            bytes = record.get_bytes_as('fulltext')
315
 
            chk_inv = inventory.CHKInventory.deserialise(
316
 
                self.from_repository.chk_bytes, bytes, record.key)
317
 
            if record.key == start_rev_key:
318
 
                uninteresting_chk_roots.add(chk_inv.id_to_entry.key())
319
 
                p_id_map = chk_inv.parent_id_basename_to_file_id
320
 
                if p_id_map is not None:
321
 
                    uninteresting_chk_roots.add(p_id_map.key())
322
 
            else:
323
 
                self.to_repository.inventories.insert_record_stream([record])
324
 
                interesting_chk_roots.add(chk_inv.id_to_entry.key())
325
 
                p_id_map = chk_inv.parent_id_basename_to_file_id
326
 
                if p_id_map is not None:
327
 
                    interesting_chk_roots.add(p_id_map.key())
 
313
        def filter_inv_stream(inv_stream):
 
314
            for record in inv_stream:
 
315
                bytes = record.get_bytes_as('fulltext')
 
316
                chk_inv = inventory.CHKInventory.deserialise(
 
317
                    self.from_repository.chk_bytes, bytes, record.key)
 
318
                if record.key == start_rev_key:
 
319
                    uninteresting_chk_roots.add(chk_inv.id_to_entry.key())
 
320
                    p_id_map = chk_inv.parent_id_basename_to_file_id
 
321
                    if p_id_map is not None:
 
322
                        uninteresting_chk_roots.add(p_id_map.key())
 
323
                else:
 
324
                    yield record
 
325
                    interesting_chk_roots.add(chk_inv.id_to_entry.key())
 
326
                    p_id_map = chk_inv.parent_id_basename_to_file_id
 
327
                    if p_id_map is not None:
 
328
                        interesting_chk_roots.add(p_id_map.key())
 
329
        self.to_repository.inventories.insert_record_stream(filter_inv_stream(inv_stream))
328
330
        # Now that we have worked out all of the interesting root nodes, grab
329
331
        # all of the interesting pages and insert them
330
332
        interesting = chk_map.iter_interesting_nodes(