~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bundle/serializer/v4.py

Clarify some comments, fix up a debugging change.

Show diffs side-by-side

added added

removed removed

Lines of Context:
147
147
    body
148
148
    """
149
149
 
150
 
    def __init__(self, fileobj, stream_input=False):
 
150
    def __init__(self, fileobj, stream_input=True):
151
151
        """Constructor
152
152
 
153
153
        :param fileobj: a file containing a bzip-encoded container
608
608
        for key, metadata, bytes in records:
609
609
            revision_id = key[-1]
610
610
            parent_ids = metadata['parents']
611
 
            # Note that this assumes the local ghosts are identical to the
612
 
            # ghosts in the source. But the Bundle serialization format doesn't
613
 
            # record any info that would help us figure that stuff out.
614
 
            # We start by going directly to the inventory vf, because the
615
 
            # revisions have not been installed yet, so repo.get_parent_map
616
 
            # would think that more things are ghosts than really are.
 
611
            # Note: This assumes the local ghosts are identical to the ghosts
 
612
            #       in the source, as the Bundle serialization format doesn't
 
613
            #       record ghosts.
 
614
            # Find out what is present in the local inventory vf (don't use
 
615
            # revisions vf as those haven't been installed yet.)
617
616
            parent_keys = [(r,) for r in parent_ids]
618
617
            present_parent_map = self._repository.inventories.get_parent_map(
619
618
                                        parent_keys)
620
619
            present_parent_ids = [p_id for p_id in parent_ids
621
620
                                        if (p_id,) in present_parent_map]
622
621
            # TODO: This doesn't do any sort of caching, etc, so expect it to
623
 
            #       perform rather poorly.
 
622
            #       perform rather poorly. When transmitting many inventories,
 
623
            #       it will be re-reading and serializing to bytes the
 
624
            #       inventories that it just wrote.
624
625
            parent_invs = list(self._repository.iter_inventories(
625
626
                                present_parent_ids))
626
627
            p_texts = [self._source_serializer.write_inventory_to_string(p)