~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_repository.py

MergeĀ fromĀ mainline

Show diffs side-by-side

added added

removed removed

Lines of Context:
259
259
                             t.get('format').read())
260
260
        # XXX: no locks left when unlocked at the moment
261
261
        # self.assertEqualDiff('', t.get('lock').read())
262
 
        self.assertTrue(S_ISDIR(t.stat('revision-store').st_mode))
263
262
        self.assertTrue(S_ISDIR(t.stat('knits').st_mode))
264
 
        self.assertTrue(S_ISDIR(t.stat('lock').st_mode))
265
 
        # cheating and using a weave for now.
266
 
        self.assertEqualDiff('# bzr weave file v5\n'
267
 
                             'w\n'
268
 
                             'W\n',
269
 
                             t.get('inventory.weave').read())
 
263
        self.check_knits(t)
 
264
 
 
265
    def check_knits(self, t):
 
266
        """check knit content for a repository."""
 
267
        self.assertEqualDiff('# bzr knit index 7\n',
 
268
                             t.get('inventory.kndx').read())
 
269
        # no default content
 
270
        self.assertTrue(t.has('inventory.knit'))
 
271
        self.assertEqualDiff('# bzr knit index 7\n',
 
272
                             t.get('revisions.kndx').read())
 
273
        # no default content
 
274
        self.assertTrue(t.has('revisions.knit'))
 
275
        self.assertEqualDiff('# bzr knit index 7\n',
 
276
                             t.get('signatures.kndx').read())
 
277
        # no default content
 
278
        self.assertTrue(t.has('signatures.knit'))
270
279
 
271
280
    def test_shared_disk_layout(self):
272
281
        control = bzrdir.BzrDirMetaFormat1().initialize(self.get_url())
284
293
        # XXX: no locks left when unlocked at the moment
285
294
        # self.assertEqualDiff('', t.get('lock').read())
286
295
        self.assertEqualDiff('', t.get('shared-storage').read())
287
 
        self.assertTrue(S_ISDIR(t.stat('revision-store').st_mode))
288
296
        self.assertTrue(S_ISDIR(t.stat('knits').st_mode))
289
 
        self.assertTrue(S_ISDIR(t.stat('lock').st_mode))
290
 
        # cheating and using a weave for now.
291
 
        self.assertEqualDiff('# bzr weave file v5\n'
292
 
                             'w\n'
293
 
                             'W\n',
294
 
                             t.get('inventory.weave').read())
 
297
        self.check_knits(t)
295
298
 
296
299
    def test_shared_no_tree_disk_layout(self):
297
300
        control = bzrdir.BzrDirMetaFormat1().initialize(self.get_url())
313
316
        self.assertEqualDiff('', t.get('no-working-trees').read())
314
317
        repo.set_make_working_trees(True)
315
318
        self.assertFalse(t.has('no-working-trees'))
316
 
        self.assertTrue(S_ISDIR(t.stat('revision-store').st_mode))
317
319
        self.assertTrue(S_ISDIR(t.stat('knits').st_mode))
318
 
        self.assertTrue(S_ISDIR(t.stat('lock').st_mode))
319
 
        # cheating and using a weave for now.
320
 
        self.assertEqualDiff('# bzr weave file v5\n'
321
 
                             'w\n'
322
 
                             'W\n',
323
 
                             t.get('inventory.weave').read())
 
320
        self.check_knits(t)
324
321
 
325
322
 
326
323
class InterString(repository.InterRepository):
422
419
        repo_dir = bzrdir.BzrDirMetaFormat1().initialize('repository')
423
420
        repo = repository.RepositoryFormat7().initialize(repo_dir)
424
421
        target_format = repository.RepositoryFormatKnit1()
425
 
        pb = bzrlib.ui.ui_factory.progress_bar()
426
 
 
427
422
        converter = repository.CopyConverter(target_format)
428
 
        converter.convert(repo, pb)
 
423
        pb = bzrlib.ui.ui_factory.nested_progress_bar()
 
424
        try:
 
425
            converter.convert(repo, pb)
 
426
        finally:
 
427
            pb.finished()
429
428
        repo = repo_dir.open_repository()
430
429
        self.assertTrue(isinstance(target_format, repo._format.__class__))
431