~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/groupcompress_repo.py

Merge CHKInventory._iter_inventory_xml support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
795
795
            yield inventory.CHKInventory.deserialise(self.chk_bytes, texts[key], key)
796
796
 
797
797
    def _iter_inventory_xmls(self, revision_ids):
798
 
        # Without a native 'xml' inventory, this method doesn't make sense, so
799
 
        # make it raise to trap naughty direct users.
800
 
        raise NotImplementedError(self._iter_inventory_xmls)
 
798
        # Without a native 'xml' inventory, this method doesn't make sense.
 
799
        # However older working trees, and older bundles want it - so we supply
 
800
        # it allowing get_inventory_xml to work. Bundles currently use the
 
801
        # serializer directly; this also isn't ideal, but there isn't an xml
 
802
        # iteration interface offered at all for repositories. We could make
 
803
        # _iter_inventory_xmls be part of the contract, even if kept private.
 
804
        inv_to_str = self._serializer.write_inventory_to_string
 
805
        for inv in self.iter_inventories(revision_ids):
 
806
            yield inv_to_str(inv), inv.revision_id
801
807
 
802
808
    def _find_present_inventory_keys(self, revision_keys):
803
809
        parent_map = self.inventories.get_parent_map(revision_keys)