~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/groupcompress_repo.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-08-18 03:42:51 UTC
  • mfrom: (4606.5.2 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090818034251-w2biu3woo8y7bcf8
(robertc) Support iter_inventory_xml on CHKRepository. (Robert
        Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
810
810
            yield inventory.CHKInventory.deserialise(self.chk_bytes, texts[key], key)
811
811
 
812
812
    def _iter_inventory_xmls(self, revision_ids, ordering):
813
 
        # Without a native 'xml' inventory, this method doesn't make sense, so
814
 
        # make it raise to trap naughty direct users.
815
 
        raise NotImplementedError(self._iter_inventory_xmls)
 
813
        # Without a native 'xml' inventory, this method doesn't make sense.
 
814
        # However older working trees, and older bundles want it - so we supply
 
815
        # it allowing get_inventory_xml to work. Bundles currently use the
 
816
        # serializer directly; this also isn't ideal, but there isn't an xml
 
817
        # iteration interface offered at all for repositories. We could make
 
818
        # _iter_inventory_xmls be part of the contract, even if kept private.
 
819
        inv_to_str = self._serializer.write_inventory_to_string
 
820
        for inv in self.iter_inventories(revision_ids, ordering=ordering):
 
821
            yield inv_to_str(inv), inv.revision_id
816
822
 
817
823
    def _find_present_inventory_keys(self, revision_keys):
818
824
        parent_map = self.inventories.get_parent_map(revision_keys)