~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/groupcompress_repo.py

  • Committer: Patch Queue Manager
  • Date: 2011-12-05 11:58:57 UTC
  • mfrom: (6339.1.1 kill-history-missing)
  • Revision ID: pqm@pqm.ubuntu.com-20111205115857-eakx9wlixnx2wpwz
(jelmer) Remove the HistoryMissing exception. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
978
978
            if record.storage_kind != 'absent':
979
979
                texts[record.key] = record.get_bytes_as('fulltext')
980
980
            else:
981
 
                raise errors.NoSuchRevision(self, record.key)
 
981
                texts[record.key] = None
982
982
        for key in keys:
983
 
            yield inventory.CHKInventory.deserialise(self.chk_bytes, texts[key], key)
 
983
            bytes = texts[key]
 
984
            if bytes is None:
 
985
                yield (None, key[-1])
 
986
            else:
 
987
                yield (inventory.CHKInventory.deserialise(
 
988
                    self.chk_bytes, bytes, key), key[-1])
984
989
 
985
 
    def _iter_inventory_xmls(self, revision_ids, ordering):
 
990
    def _get_inventory_xml(self, revision_id):
 
991
        """Get serialized inventory as a string."""
986
992
        # Without a native 'xml' inventory, this method doesn't make sense.
987
993
        # However older working trees, and older bundles want it - so we supply
988
994
        # it allowing _get_inventory_xml to work. Bundles currently use the
989
995
        # serializer directly; this also isn't ideal, but there isn't an xml
990
 
        # iteration interface offered at all for repositories. We could make
991
 
        # _iter_inventory_xmls be part of the contract, even if kept private.
992
 
        inv_to_str = self._serializer.write_inventory_to_string
993
 
        for inv in self.iter_inventories(revision_ids, ordering=ordering):
994
 
            yield inv_to_str(inv), inv.revision_id
 
996
        # iteration interface offered at all for repositories.
 
997
        return self._serializer.write_inventory_to_string(
 
998
            self.get_inventory(revision_id))
995
999
 
996
1000
    def _find_present_inventory_keys(self, revision_keys):
997
1001
        parent_map = self.inventories.get_parent_map(revision_keys)