~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_branch/test_branch.py

(jelmer) More fixes for the interface tests when run against foreign tests.
 (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
365
365
        self.branch_format.initialize(repo.bzrdir, name='branch2')
366
366
        self.assertEquals(2, len(repo.bzrdir.list_branches()))
367
367
 
 
368
    def test_create_append_revisions_only(self):
 
369
        try:
 
370
            repo = self.make_repository('.', shared=True)
 
371
        except errors.IncompatibleFormat:
 
372
            return
 
373
        for val in (True, False):
 
374
            try:
 
375
                branch = self.branch_format.initialize(repo.bzrdir,
 
376
                    append_revisions_only=True)
 
377
            except (errors.UninitializableFormat, errors.UpgradeRequired):
 
378
                # branch references are not default init'able and
 
379
                # not all branches support append_revisions_only
 
380
                return
 
381
            self.assertEquals(True, branch.get_append_revisions_only())
 
382
            repo.bzrdir.destroy_branch()
 
383
 
 
384
    def test_get_set_append_revisions_only(self):
 
385
        branch = self.make_branch('.')
 
386
        if branch._format.supports_set_append_revisions_only():
 
387
            branch.set_append_revisions_only(True)
 
388
            self.assertTrue(branch.get_append_revisions_only())
 
389
            branch.set_append_revisions_only(False)
 
390
            self.assertFalse(branch.get_append_revisions_only())
 
391
        else:
 
392
            self.assertRaises(errors.UpgradeRequired,
 
393
                branch.set_append_revisions_only, True)
 
394
            self.assertFalse(branch.get_append_revisions_only())
 
395
 
368
396
    def test_create_open_branch_uses_repository(self):
369
397
        try:
370
398
            repo = self.make_repository('.', shared=True)