340
340
self.assertPathDoesNotExist('a/.bzr/branch/bound')
341
341
self.assertEqual('ftp://example.com', branch.get_bound_location())
343
def test_set_revision_history(self):
344
builder = self.make_branch_builder('.', format=self.get_format_name())
345
builder.build_snapshot('foo', None,
346
[('add', ('', None, 'directory', None))],
348
builder.build_snapshot('bar', None, [], message='bar')
349
branch = builder.get_branch()
351
self.addCleanup(branch.unlock)
352
self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)),
353
branch.set_revision_history, ['foo', 'bar'])
354
self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)),
355
branch.set_revision_history, ['foo'])
356
self.assertRaises(errors.NotLefthandHistory,
357
self.applyDeprecated, symbol_versioning.deprecated_in((2, 4, 0)),
358
branch.set_revision_history, ['bar'])
360
343
def do_checkout_test(self, lightweight=False):
361
344
tree = self.make_branch_and_tree('source',
362
345
format=self.get_format_name_subtree())
569
552
def test_constructor(self):
570
553
"""Check that creating a BranchHooks instance has the right defaults."""
571
554
hooks = _mod_branch.BranchHooks()
572
self.assertTrue("set_rh" in hooks, "set_rh not in %s" % hooks)
573
555
self.assertTrue("post_push" in hooks, "post_push not in %s" % hooks)
574
556
self.assertTrue("post_commit" in hooks, "post_commit not in %s" % hooks)
575
557
self.assertTrue("pre_commit" in hooks, "pre_commit not in %s" % hooks)