Rev 2806: Generate the inventory_index_map for packing during the core operation, from the pack objects. in http://people.ubuntu.com/~robertc/baz2.0/repository

Robert Collins robertc at robertcollins.net
Wed Oct 10 09:11:11 BST 2007


At http://people.ubuntu.com/~robertc/baz2.0/repository

------------------------------------------------------------
revno: 2806
revision-id: robertc at robertcollins.net-20071010081102-6agu3iikmkyl2zd2
parent: robertc at robertcollins.net-20071010080610-8yhs1je76gsccaw8
committer: Robert Collins <robertc at robertcollins.net>
branch nick: repository
timestamp: Wed 2007-10-10 18:11:02 +1000
message:
  Generate the inventory_index_map for packing during the core operation, from the pack objects.
modified:
  bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
  bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
=== modified file 'bzrlib/repofmt/pack_repo.py'
--- a/bzrlib/repofmt/pack_repo.py	2007-10-10 08:06:10 +0000
+++ b/bzrlib/repofmt/pack_repo.py	2007-10-10 08:11:02 +0000
@@ -268,7 +268,7 @@
         return True
 
     def create_pack_from_packs(self, packs,
-        inventory_index_map, text_index_map, signature_index_map, suffix,
+        text_index_map, signature_index_map, suffix,
         revision_ids=None):
         """Create a new pack by reading data from other packs.
 
@@ -279,7 +279,6 @@
         source packs are not altered.
 
         :param packs: An iterable of Packs to combine.
-        :param inventory_index_map: A inventory index map.
         :param text_index_map: A text index map.
         :param signature_index_map: A signature index map.
         :param revision_ids: Either None, to copy all data, or a list
@@ -354,6 +353,8 @@
         # querying for keys here could introduce a bug where an inventory item
         # is missed, so do not change it to query separately without cross
         # checking like the text key check below.
+        inventory_index_map = self._packs_list_to_pack_map_and_index_list(
+            packs, 'inventory_index')[0]
         inv_nodes = self._index_contents(inventory_index_map, inv_keys)
         # copy inventory keys and adjust values
         # XXX: Should be a helper function to allow different inv representation
@@ -592,13 +593,11 @@
             in use.
         :return: None
         """
-        # select inventory keys
-        inv_index_map = self._inv_index_map(pack_details)
         # select text keys
         text_index_map = self._text_index_map(pack_details)
         # select signature keys
         signature_index_map = self._signature_index_map(pack_details)
-        self.create_pack_from_packs(packs, inv_index_map,
+        self.create_pack_from_packs(packs,
             text_index_map, signature_index_map, '.autopack')
 
     def _copy_nodes(self, nodes, index_map, writer, write_index):

=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py	2007-10-10 08:06:10 +0000
+++ b/bzrlib/repository.py	2007-10-10 08:11:02 +0000
@@ -2344,12 +2344,10 @@
                 raise errors.InstallFailed([revision_id])
         packs = self.source._packs.all_pack_details()
         _packs = self.source._packs.all_packs()
-        inventory_index_map = self.source._packs._inv_index_map(packs)
         text_index_map = self.source._packs._text_index_map(packs)
         signature_index_map = self.source._packs._signature_index_map(packs)
         pack = self.target._packs.create_pack_from_packs(
             _packs,
-            inventory_index_map,
             text_index_map,
             signature_index_map,
             '.fetch',



More information about the bazaar-commits mailing list