~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Andrew Bennetts
  • Date: 2009-07-01 00:49:06 UTC
  • mto: (4476.3.44 inventory-delta)
  • mto: This revision was merged to the branch mainline in revision 4608.
  • Revision ID: andrew.bennetts@canonical.com-20090701004906-r2k4pr3gnlrfltek
Network serialisation, and most tests passing with InterDifferingSerializer commented out.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2239
2239
    @needs_read_lock
2240
2240
    def get_inventory_xml(self, revision_id):
2241
2241
        """Get inventory XML as a file object."""
2242
 
        texts = self._iter_inventory_xmls([revision_id])
 
2242
        texts = self._iter_inventory_xmls([revision_id], 'unordered')
2243
2243
        try:
2244
2244
            text, revision_id = texts.next()
2245
2245
        except StopIteration:
3764
3764
        return basis_id, basis_tree
3765
3765
 
3766
3766
 
3767
 
InterRepository.register_optimiser(InterDifferingSerializer)
 
3767
#InterRepository.register_optimiser(InterDifferingSerializer)
3768
3768
InterRepository.register_optimiser(InterSameDataRepository)
3769
3769
InterRepository.register_optimiser(InterWeaveRepo)
3770
3770
InterRepository.register_optimiser(InterKnitRepo)
3992
3992
        # if the src and target's flags are different, so long as it's a
3993
3993
        # compatible transition (i.e. inserting into a target with richer info
3994
3994
        # that the source).
3995
 
        delta_deserializer = inventory_delta.InventoryDeltaSerializer(
3996
 
            src_format.rich_root_data,
3997
 
            src_format.supports_tree_reference)
 
3995
        delta_deserializer = inventory_delta.InventoryDeltaSerializer()
3998
3996
        for substream_type, substream in stream:
3999
3997
            if substream_type == 'texts':
4000
3998
                self.target_repo.texts.insert_record_stream(substream)
4370
4368
        inventories = self.from_repository.iter_inventories(
4371
4369
            revision_ids, 'topological')
4372
4370
        # XXX: ideally these flags would be per-revision, not per-repo...
4373
 
        flags = (from_repo.rich_root_data, from_repo.supports_tree_reference)
 
4371
        flags = (from_repo._format.rich_root_data, from_repo._format.supports_tree_reference)
4374
4372
        for inv in inventories:
4375
4373
            key = (inv.revision_id,)
4376
4374
            parents = parent_map.get(key, ())
4378
4376
                # no parent, stream as fulltext
4379
4377
                as_bytes = from_serializer.write_inventory_to_string(inv)
4380
4378
                yield versionedfile.FulltextContentFactory(
4381
 
                    key, parent_keys, None, as_bytes)
 
4379
                    key, parents, None, as_bytes)
4382
4380
            else:
4383
4381
                # make as a delta against its left-most parent
4384
4382
                # XXX: sometimes a non-left-hand parent would give smaller
4388
4386
                parent_inv = from_repo.get_inventory(parent_id)
4389
4387
                delta = inv._make_delta(parent_inv)
4390
4388
                yield versionedfile.InventoryDeltaContentFactory(
4391
 
                    key, parent_keys, None, delta, parent_id, flags)
 
4389
                    key, parents, None, delta, parent_id, flags)
4392
4390
 
4393
4391
    def _stream_invs_as_fulltexts(self, revision_ids):
4394
4392
        from_repo = self.from_repository