~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_pack_repository.py

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
266
266
        # Test that the ordering of revisions in pack repositories is
267
267
        # tip->ancestor
268
268
        format = self.get_format()
269
 
        if type(format.repository_format) is RepositoryFormatCHK1:
270
 
            raise TestSkipped("Not updated for GroupCompress internals")
271
269
        tree = self.make_branch_and_tree('.', format=format)
272
270
        trans = tree.branch.repository.bzrdir.get_repository_transport(None)
273
271
        tree.commit('start', rev_id='1')
280
278
        # revision access tends to be tip->ancestor, so ordering that way on
281
279
        # disk is a good idea.
282
280
        for _1, key, val, refs in pack.revision_index.iter_all_entries():
 
281
            if type(format.repository_format) is RepositoryFormatCHK1:
 
282
                # group_start, group_len, internal_start, internal_len
 
283
                pos = map(int, val.split())
 
284
            else:
 
285
                # eol_flag, start, len
 
286
                pos = int(val[1:].split()[0])
283
287
            if key == ('1',):
284
 
                pos_1 = int(val[1:].split()[0])
 
288
                pos_1 = pos
285
289
            else:
286
 
                pos_2 = int(val[1:].split()[0])
287
 
        self.assertTrue(pos_2 < pos_1)
 
290
                pos_2 = pos
 
291
        self.assertTrue(pos_2 < pos_1, 'rev 1 came before rev 2 %s > %s'
 
292
                                       % (pos_1, pos_2))
288
293
 
289
294
    def test_pack_repositories_support_multiple_write_locks(self):
290
295
        format = self.get_format()