Rev 5087: Call the sub-groups 'sections', since we won't require them to be indexes. in http://bzr.arbash-meinel.com/branches/bzr/lp/2.2.0b2-contained-pack
John Arbash Meinel
john at arbash-meinel.com
Fri Mar 5 20:03:51 GMT 2010
At http://bzr.arbash-meinel.com/branches/bzr/lp/2.2.0b2-contained-pack
------------------------------------------------------------
revno: 5087
revision-id: john at arbash-meinel.com-20100305200318-403egkuei1iiv0zt
parent: john at arbash-meinel.com-20100305200212-8wsj04zltj8r7dba
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.2.0b2-contained-pack
timestamp: Fri 2010-03-05 14:03:18 -0600
message:
Call the sub-groups 'sections', since we won't require them to be indexes.
-------------- next part --------------
=== modified file 'bzrlib/sack.py'
--- a/bzrlib/sack.py 2010-03-05 20:02:12 +0000
+++ b/bzrlib/sack.py 2010-03-05 20:03:18 +0000
@@ -69,7 +69,7 @@
self.version = _VERSION
self._sections = {}
- def add_index_info(self, index_type, start, length):
+ def add_section_info(self, index_type, start, length):
# Note: bzr-search uses a ContainerWriter to write out the bytes, and
# then adjusts the offsets so that it skips the 'Pack' overhead bytes.
# I guess I don't really see the benefit versus the crufty overhead...
=== modified file 'bzrlib/tests/test_sack.py'
--- a/bzrlib/tests/test_sack.py 2010-03-05 20:02:12 +0000
+++ b/bzrlib/tests/test_sack.py 2010-03-05 20:03:18 +0000
@@ -76,9 +76,9 @@
def test_with_content(self):
builder = sack.TrailingIndexBuilder(start_offset=500)
- builder.add_index_info('revisions', 0, 100)
- builder.add_index_info('inventories', 100, 50)
- builder.add_index_info('texts', 150, 350)
+ builder.add_section_info('revisions', 0, 100)
+ builder.add_section_info('inventories', 100, 50)
+ builder.add_section_info('texts', 150, 350)
self.assertAsBytes({'revisions': (0, 100),
'inventories': (100, 50),
'texts': (150, 350),
@@ -103,7 +103,7 @@
# We should be able to bootstrap all info starting with just a path on
# disk
builder = sack.TrailingIndexBuilder(start_offset=500)
- builder.add_index_info('texts', 150, 350)
+ builder.add_section_info('texts', 150, 350)
content = builder.finish()
t = memory.MemoryTransport('')
t.put_bytes('test.sack', ' '*500 + content)
@@ -119,7 +119,7 @@
trail_start = len(text_idx_content)
trailing_builder = sack.TrailingIndexBuilder(
start_offset=trail_start)
- trailing_builder.add_index_info('texts', 0, trail_start)
+ trailing_builder.add_section_info('texts', 0, trail_start)
trailing_content = trailing_builder.finish()
content = text_idx_content + trailing_content
t = memory.MemoryTransport('')
More information about the bazaar-commits
mailing list