929
929
self.assertEqual(1, len(list(index.iter_all_entries())))
930
930
self.assertEqual(2, len(tree.branch.repository.all_revision_ids()))
932
def test_pack_layout(self):
933
format = self.get_format()
934
tree = self.make_branch_and_tree('.', format=format)
935
trans = tree.branch.repository.bzrdir.get_repository_transport(None)
936
tree.commit('start', rev_id='1')
937
tree.commit('more work', rev_id='2')
938
tree.branch.repository.pack()
940
self.addCleanup(tree.unlock)
941
pack = tree.branch.repository._pack_collection.get_pack_by_name(
942
tree.branch.repository._pack_collection.names()[0])
943
# revision access tends to be tip->ancestor, so ordering that way on
944
# disk is a good idea.
945
for _1, key, val, refs in pack.revision_index.iter_all_entries():
947
pos_1 = int(val[1:].split()[0])
949
pos_2 = int(val[1:].split()[0])
950
self.assertTrue(pos_2 < pos_1)
932
952
def test_pack_repositories_support_multiple_write_locks(self):
933
953
format = self.get_format()
934
954
self.make_repository('.', shared=True, format=format)