~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_repository.py

  • Committer: Martin Pool
  • Date: 2007-12-14 07:35:49 UTC
  • mfrom: (3109 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3111.
  • Revision ID: mbp@sourcefrog.net-20071214073549-wpekccrsxjv77yze
Merge 1.0final back to trunk and bump to 1.1dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
929
929
        self.assertEqual(1, len(list(index.iter_all_entries())))
930
930
        self.assertEqual(2, len(tree.branch.repository.all_revision_ids()))
931
931
 
 
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()
 
939
        tree.lock_read()
 
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():
 
946
            if key == ('1',):
 
947
                pos_1 = int(val[1:].split()[0])
 
948
            else:
 
949
                pos_2 = int(val[1:].split()[0])
 
950
        self.assertTrue(pos_2 < pos_1)
 
951
 
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)