Rev 2761: Split out more common code for making index maps in http://sourcefrog.net/bzr/pack-repository
Martin Pool
mbp at sourcefrog.net
Fri Sep 21 09:21:42 BST 2007
At http://sourcefrog.net/bzr/pack-repository
------------------------------------------------------------
revno: 2761
revision-id: mbp at sourcefrog.net-20070921082141-9334ez9op3439jvj
parent: mbp at sourcefrog.net-20070921080858-gwydequ77jjaxxz8
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: pack-repository
timestamp: Fri 2007-09-21 18:21:41 +1000
message:
Split out more common code for making index maps
modified:
bzrlib/repofmt/pack_repo.py pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
=== modified file 'bzrlib/repofmt/pack_repo.py'
--- a/bzrlib/repofmt/pack_repo.py 2007-09-21 08:08:58 +0000
+++ b/bzrlib/repofmt/pack_repo.py 2007-09-21 08:21:41 +0000
@@ -904,7 +904,6 @@
"""Get the revision versioned file object."""
if getattr(self.repo, '_revision_knit', None) is not None:
return self.repo._revision_knit
- self.repo._packs.ensure_loaded()
pack_map, indices = self.repo._packs._make_index_map('.rix')
if self.repo.is_in_write_group():
# allow writing: queue writes to a new index
@@ -933,15 +932,7 @@
"""Get the signature versioned file object."""
if getattr(self.repo, '_signature_knit', None) is not None:
return self.repo._signature_knit
- indices = []
- self.repo._packs.ensure_loaded()
- pack_map = {}
- for name in self.repo._packs.names():
- # TODO: maybe this should expose size to us to allow
- # sorting of the indices for better performance ?
- index_name = self.name_to_signature_index_name(name)
- indices.append(GraphIndex(self.transport, index_name))
- pack_map[indices[-1]] = (self.repo._packs._pack_tuple(name))
+ pack_map, indices = self.repo._packs._make_index_map('.six')
if self.repo.is_in_write_group():
# allow writing: queue writes to a new index
indices.insert(0, self.repo._signature_write_index)
@@ -1095,15 +1086,8 @@
"""Create the combined index for all texts."""
if getattr(self.repo, '_text_all_indices', None) is not None:
return
- indices = []
- self.repo._packs.ensure_loaded()
- self.repo._text_pack_map = {}
- for name in self.repo._packs.names():
- # TODO: maybe this should expose size to us to allow
- # sorting of the indices for better performance ?
- index_name = self.name_to_text_index_name(name)
- indices.append(GraphIndex(self.transport, index_name))
- self.repo._text_pack_map[indices[-1]] = (self.repo._packs._pack_tuple(name))
+ pack_map, indices = self.repo._packs._make_index_map('.tix')
+ self.repo._text_pack_map = pack_map
if for_write or self.repo.is_in_write_group():
# allow writing: queue writes to a new index
indices.insert(0, self.repo._text_write_index)
More information about the bazaar-commits
mailing list