181
181
br_b = wt_a.bzrdir.open_branch().sprout(repo_b.bzrdir, revision_id='1')
182
182
self.assertEqual(br_b.last_revision(), '1')
184
def get_parented_branch(self):
185
wt_a = self.make_branch_and_tree('a')
186
self.build_tree(['a/one'])
188
wt_a.commit('commit one', rev_id='1')
190
branch_b = wt_a.bzrdir.sprout('b', revision_id='1').open_branch()
191
self.assertEqual(wt_a.branch.base, branch_b.get_parent())
184
194
def test_clone_branch_nickname(self):
185
195
# test the nick name is preserved always
186
196
raise TestSkipped('XXX branch cloning is not yet tested..')
188
198
def test_clone_branch_parent(self):
189
199
# test the parent is preserved always
190
raise TestSkipped('XXX branch cloning is not yet tested..')
200
branch_b = self.get_parented_branch()
201
repo_c = self.make_repository('c')
202
branch_b.repository.copy_content_into(repo_c)
203
branch_c = branch_b.clone(repo_c.bzrdir)
204
self.assertNotEqual(None, branch_c.get_parent())
205
self.assertEqual(branch_b.get_parent(), branch_c.get_parent())
207
# We can also set a specific parent, and it should be honored
208
random_parent = 'http://bazaar-vcs.org/path/to/branch'
209
branch_b.set_parent(random_parent)
210
repo_d = self.make_repository('d')
211
branch_b.repository.copy_content_into(repo_d)
212
branch_d = branch_b.clone(repo_d.bzrdir)
213
self.assertEqual(random_parent, branch_d.get_parent())
192
215
def test_sprout_branch_nickname(self):
193
216
# test the nick name is reset always
194
217
raise TestSkipped('XXX branch sprouting is not yet tested..')