365
365
self.branch_format.initialize(repo.bzrdir, name='branch2')
366
366
self.assertEquals(2, len(repo.bzrdir.list_branches()))
368
def test_create_append_revisions_only(self):
370
repo = self.make_repository('.', shared=True)
371
except errors.IncompatibleFormat:
373
for val in (True, False):
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
381
self.assertEquals(True, branch.get_append_revisions_only())
382
repo.bzrdir.destroy_branch()
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())
392
self.assertRaises(errors.UpgradeRequired,
393
branch.set_append_revisions_only, True)
394
self.assertFalse(branch.get_append_revisions_only())
368
396
def test_create_open_branch_uses_repository(self):
370
398
repo = self.make_repository('.', shared=True)