953
955
basis_tree = self.revision_tree(basis_revision_id)
954
956
basis_tree.lock_read()
955
basis_inv = basis_tree.inventory
957
basis_inv = basis_tree.root_inventory
957
959
result = basis_inv.create_by_apply_delta(delta, new_revision_id,
958
960
propagate_caches=propagate_caches)
978
980
if record.storage_kind != 'absent':
979
981
texts[record.key] = record.get_bytes_as('fulltext')
981
raise errors.NoSuchRevision(self, record.key)
983
texts[record.key] = None
983
yield inventory.CHKInventory.deserialise(self.chk_bytes, texts[key], key)
987
yield (None, key[-1])
989
yield (inventory.CHKInventory.deserialise(
990
self.chk_bytes, bytes, key), key[-1])
985
def _iter_inventory_xmls(self, revision_ids, ordering):
992
def _get_inventory_xml(self, revision_id):
993
"""Get serialized inventory as a string."""
986
994
# Without a native 'xml' inventory, this method doesn't make sense.
987
995
# However older working trees, and older bundles want it - so we supply
988
996
# it allowing _get_inventory_xml to work. Bundles currently use the
989
997
# 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
998
# iteration interface offered at all for repositories.
999
return self._serializer.write_inventory_to_string(
1000
self.get_inventory(revision_id))
996
1002
def _find_present_inventory_keys(self, revision_keys):
997
1003
parent_map = self.inventories.get_parent_map(revision_keys)
1377
1383
pack_compresses = True
1379
1385
def _get_matching_bzrdir(self):
1380
return bzrdir.format_registry.make_bzrdir('2a')
1386
return controldir.format_registry.make_bzrdir('2a')
1382
1388
def _ignore_setting_bzrdir(self, format):
1385
1391
_matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
1387
def get_format_string(self):
1394
def get_format_string(cls):
1388
1395
return ('Bazaar repository format 2a (needs bzr 1.16 or later)\n')
1390
1397
def get_format_description(self):
1401
1408
def _get_matching_bzrdir(self):
1402
return bzrdir.format_registry.make_bzrdir('development-subtree')
1409
return controldir.format_registry.make_bzrdir('development-subtree')
1404
1411
def _ignore_setting_bzrdir(self, format):
1407
1414
_matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
1409
def get_format_string(self):
1417
def get_format_string(cls):
1410
1418
return ('Bazaar development format 8\n')
1412
1420
def get_format_description(self):