17
17
"""Tests for branch.create_clone behaviour."""
19
19
from bzrlib.branch import Branch
20
from bzrlib import errors
21
from bzrlib import remote
22
from bzrlib import tests
20
23
from bzrlib.tests.branch_implementations.test_branch import TestCaseWithBranch
21
from bzrlib import remote
24
26
class TestCreateClone(TestCaseWithBranch):
57
59
self.assertEqual(revid, result.last_revision())
58
60
self.assertEqual(trunk.base, result.get_stacked_on_url())
62
def test_create_clone_of_multiple_roots(self):
64
builder = self.make_branch_builder('local')
65
except (errors.TransportNotPossible, errors.UninitializableFormat):
66
raise tests.TestNotApplicable('format not directly constructable')
67
builder.start_series()
68
builder.build_snapshot('rev1', None, [
69
('add', ('', 'root-id', 'directory', ''))])
70
builder.build_snapshot('rev2', ['rev1'], [])
71
builder.build_snapshot('other', None, [
72
('add', ('', 'root-id', 'directory', ''))])
73
builder.build_snapshot('rev3', ['rev2', 'other'], [])
74
builder.finish_series()
75
local = builder.get_branch()
76
local.bzrdir.clone(self.get_url('remote'), revision_id='rev3')
60
78
def assertBranchHookBranchIsStacked(self, pre_change_params):
61
79
# Just calling will either succeed or fail.
62
80
pre_change_params.branch.get_stacked_on_url()