~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_repository.py

Merge in knit repository use of knits - still not a stable format, but can be experimented with.

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):
430
427
            pb.finished()
431
428
        repo = repo_dir.open_repository()
432
429
        self.assertTrue(isinstance(target_format, repo._format.__class__))
433