~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/groupcompress_repo.py

  • Committer: Samuel Bronson
  • Date: 2012-08-30 20:36:18 UTC
  • mto: (6015.57.3 2.4)
  • mto: This revision was merged to the branch mainline in revision 6558.
  • Revision ID: naesten@gmail.com-20120830203618-y2dzw91nqpvpgxvx
Update INSTALL for switch to Python 2.6 and up.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Repository formats using CHK inventories and groupcompress compression."""
18
18
 
19
 
from __future__ import absolute_import
20
 
 
21
19
import time
22
20
 
23
21
from bzrlib import (
980
978
            if record.storage_kind != 'absent':
981
979
                texts[record.key] = record.get_bytes_as('fulltext')
982
980
            else:
983
 
                texts[record.key] = None
 
981
                raise errors.NoSuchRevision(self, record.key)
984
982
        for key in keys:
985
 
            bytes = texts[key]
986
 
            if bytes is None:
987
 
                yield (None, key[-1])
988
 
            else:
989
 
                yield (inventory.CHKInventory.deserialise(
990
 
                    self.chk_bytes, bytes, key), key[-1])
 
983
            yield inventory.CHKInventory.deserialise(self.chk_bytes, texts[key], key)
991
984
 
992
 
    def _get_inventory_xml(self, revision_id):
993
 
        """Get serialized inventory as a string."""
 
985
    def _iter_inventory_xmls(self, revision_ids, ordering):
994
986
        # Without a native 'xml' inventory, this method doesn't make sense.
995
987
        # However older working trees, and older bundles want it - so we supply
996
988
        # it allowing _get_inventory_xml to work. Bundles currently use the
997
989
        # serializer directly; this also isn't ideal, but there isn't an xml
998
 
        # iteration interface offered at all for repositories.
999
 
        return self._serializer.write_inventory_to_string(
1000
 
            self.get_inventory(revision_id))
 
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
1001
995
 
1002
996
    def _find_present_inventory_keys(self, revision_keys):
1003
997
        parent_map = self.inventories.get_parent_map(revision_keys)
1390
1384
 
1391
1385
    _matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
1392
1386
 
1393
 
    @classmethod
1394
 
    def get_format_string(cls):
 
1387
    def get_format_string(self):
1395
1388
        return ('Bazaar repository format 2a (needs bzr 1.16 or later)\n')
1396
1389
 
1397
1390
    def get_format_description(self):
1413
1406
 
1414
1407
    _matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
1415
1408
 
1416
 
    @classmethod
1417
 
    def get_format_string(cls):
 
1409
    def get_format_string(self):
1418
1410
        return ('Bazaar development format 8\n')
1419
1411
 
1420
1412
    def get_format_description(self):