15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
"""Black-box tests for brz branch."""
18
"""Black-box tests for bzr branch."""
26
27
revision as _mod_revision,
29
from breezy.bzr import (
32
from breezy.bzr.knitrepo import RepositoryFormatKnit1
33
from breezy.tests import (
29
from bzrlib.repofmt.knitrepo import RepositoryFormatKnit1
30
from bzrlib.tests import TestCaseWithTransport
31
from bzrlib.tests import (
37
from breezy.tests.features import (
40
from breezy.tests.blackbox import test_switch
41
from breezy.tests.matchers import ContainsNoVfsCalls
42
from breezy.tests.test_sftp_transport import TestCaseWithSFTPServer
43
from breezy.tests.script import run_script
44
from breezy.urlutils import local_path_to_url, strip_trailing_slash
45
from breezy.workingtree import WorkingTree
48
class TestBranch(tests.TestCaseWithTransport):
50
def example_branch(self, path='.', format=None):
51
tree = self.make_branch_and_tree(path, format=format)
52
self.build_tree_contents([(path + '/hello', b'foo')])
36
from bzrlib.tests.test_sftp_transport import TestCaseWithSFTPServer
37
from bzrlib.urlutils import local_path_to_url, strip_trailing_slash
38
from bzrlib.workingtree import WorkingTree
41
class TestBranch(TestCaseWithTransport):
43
def example_branch(self, path='.'):
44
tree = self.make_branch_and_tree(path)
45
self.build_tree_contents([(path + '/hello', 'foo')])
54
47
tree.commit(message='setup')
55
self.build_tree_contents([(path + '/goodbye', b'baz')])
48
self.build_tree_contents([(path + '/goodbye', 'baz')])
56
49
tree.add('goodbye')
57
50
tree.commit(message='setup')
60
52
def test_branch(self):
61
53
"""Branch from one branch to another."""
65
57
self.run_bzr('branch a c -r 1')
66
58
# previously was erroneously created by branching
67
59
self.assertFalse(b._transport.has('branch-name'))
68
b.controldir.open_workingtree().commit(message='foo', allow_pointless=True)
70
def test_branch_no_to_location(self):
71
"""The to_location is derived from the source branch name."""
73
a = self.example_branch('something/a').branch
74
self.run_bzr('branch something/a')
75
b = branch.Branch.open('a')
76
self.assertEqual(b.last_revision_info(), a.last_revision_info())
78
def test_into_colocated(self):
79
"""Branch from a branch into a colocated branch."""
80
self.example_branch('a')
81
out, err = self.run_bzr(
82
'init --format=development-colo file:b,branch=orig')
84
"""Created a standalone tree (format: development-colo)\n""",
86
self.assertEqual('', err)
87
out, err = self.run_bzr(
88
'branch a file:b,branch=thiswasa')
89
self.assertEqual('', out)
90
self.assertEqual('Branched 2 revisions.\n', err)
91
out, err = self.run_bzr('branches b')
92
self.assertEqual(" orig\n thiswasa\n", out)
93
self.assertEqual('', err)
94
out, err = self.run_bzr('branch a file:b,branch=orig', retcode=3)
95
self.assertEqual('', out)
97
'brz: ERROR: Already a branch: "file:b,branch=orig".\n', err)
99
def test_from_colocated(self):
100
"""Branch from a colocated branch into a regular branch."""
102
tree = self.example_branch('b/a', format='development-colo')
103
tree.controldir.create_branch(name='somecolo')
104
out, err = self.run_bzr('branch %s,branch=somecolo' %
105
local_path_to_url('b/a'))
106
self.assertEqual('', out)
107
self.assertEqual('Branched 0 revisions.\n', err)
108
self.assertPathExists('a')
110
def test_from_name(self):
111
"""Branch from a colocated branch into a regular branch."""
113
tree = self.example_branch('b/a', format='development-colo')
114
tree.controldir.create_branch(name='somecolo')
115
out, err = self.run_bzr('branch -b somecolo %s' %
116
local_path_to_url('b/a'))
117
self.assertEqual('', out)
118
self.assertEqual('Branched 0 revisions.\n', err)
119
self.assertPathExists('a')
121
def test_branch_broken_pack(self):
122
"""branching with a corrupted pack file."""
123
self.example_branch('a')
124
# add some corruption
125
packs_dir = 'a/.bzr/repository/packs/'
126
fname = packs_dir + os.listdir(packs_dir)[0]
127
with open(fname, 'rb+') as f:
128
# Start from the end of the file to avoid choosing a place bigger
129
# than the file itself.
130
f.seek(-5, os.SEEK_END)
132
f.seek(-5, os.SEEK_END)
133
# Make sure we inject a value different than the one we just read
138
f.write(corrupt) # make sure we corrupt something
139
self.run_bzr_error(['Corruption while decompressing repository file'],
140
'branch a b', retcode=3)
60
b.bzrdir.open_workingtree().commit(message='foo', allow_pointless=True)
142
62
def test_branch_switch_no_branch(self):
143
63
# No branch in the current directory:
169
89
# => new branch will be created, but switch fails and the current
170
90
# branch is unmodified
171
91
self.example_branch('a')
172
tree = self.make_branch_and_tree('current')
173
c1 = tree.commit('some diverged change')
92
self.make_branch_and_tree('current')
174
93
self.run_bzr_error(['Cannot switch a branch, only a checkout'],
175
'branch --switch ../a ../b', working_dir='current')
94
'branch --switch ../a ../b', working_dir='current')
176
95
a = branch.Branch.open('a')
177
96
b = branch.Branch.open('b')
178
97
self.assertEqual(a.last_revision(), b.last_revision())
179
98
work = branch.Branch.open('current')
180
self.assertEqual(work.last_revision(), c1)
182
def test_branch_into_empty_dir(self):
183
t = self.example_branch('source')
184
self.make_controldir('target')
185
self.run_bzr("branch source target")
186
self.assertEqual(2, len(t.branch.repository.all_revision_ids()))
99
self.assertEqual(work.last_revision(), _mod_revision.NULL_REVISION)
188
101
def test_branch_switch_checkout(self):
189
102
# Checkout in the current directory:
190
103
# => new branch will be created and checkout bound to the new branch
191
104
self.example_branch('a')
192
105
self.run_bzr('checkout a current')
193
out, err = self.run_bzr('branch --switch ../a ../b',
194
working_dir='current')
106
out, err = self.run_bzr('branch --switch ../a ../b', working_dir='current')
195
107
a = branch.Branch.open('a')
196
108
b = branch.Branch.open('b')
197
109
self.assertEqual(a.last_revision(), b.last_revision())
222
133
shared_repo.set_make_working_trees(True)
224
135
def make_shared_tree(path):
225
shared_repo.controldir.root_transport.mkdir(path)
226
controldir.ControlDir.create_branch_convenience('repo/' + path)
136
shared_repo.bzrdir.root_transport.mkdir(path)
137
shared_repo.bzrdir.create_branch_convenience('repo/' + path)
227
138
return WorkingTree.open('repo/' + path)
228
139
tree_a = make_shared_tree('a')
229
140
self.build_tree(['repo/a/file'])
230
141
tree_a.add('file')
231
tree_a.commit('commit a-1', rev_id=b'a-1')
232
with open('repo/a/file', 'ab') as f:
233
f.write(b'more stuff\n')
234
tree_a.commit('commit a-2', rev_id=b'a-2')
142
tree_a.commit('commit a-1', rev_id='a-1')
143
f = open('repo/a/file', 'ab')
144
f.write('more stuff\n')
146
tree_a.commit('commit a-2', rev_id='a-2')
236
148
tree_b = make_shared_tree('b')
237
149
self.build_tree(['repo/b/file'])
238
150
tree_b.add('file')
239
tree_b.commit('commit b-1', rev_id=b'b-1')
151
tree_b.commit('commit b-1', rev_id='b-1')
241
self.assertTrue(shared_repo.has_revision(b'a-1'))
242
self.assertTrue(shared_repo.has_revision(b'a-2'))
243
self.assertTrue(shared_repo.has_revision(b'b-1'))
153
self.assertTrue(shared_repo.has_revision('a-1'))
154
self.assertTrue(shared_repo.has_revision('a-2'))
155
self.assertTrue(shared_repo.has_revision('b-1'))
245
157
# Now that we have a repository with shared files, make sure
246
158
# that things aren't copied out by a 'branch'
247
159
self.run_bzr('branch repo/b branch-b')
248
160
pushed_tree = WorkingTree.open('branch-b')
249
161
pushed_repo = pushed_tree.branch.repository
250
self.assertFalse(pushed_repo.has_revision(b'a-1'))
251
self.assertFalse(pushed_repo.has_revision(b'a-2'))
252
self.assertTrue(pushed_repo.has_revision(b'b-1'))
162
self.assertFalse(pushed_repo.has_revision('a-1'))
163
self.assertFalse(pushed_repo.has_revision('a-2'))
164
self.assertTrue(pushed_repo.has_revision('b-1'))
254
166
def test_branch_hardlink(self):
255
167
self.requireFeature(HardlinkFeature)
292
181
b = branch.Branch.open('repo/target')
293
182
expected_repo_path = os.path.abspath('repo/target/.bzr/repository')
294
183
self.assertEqual(strip_trailing_slash(b.repository.base),
295
strip_trailing_slash(local_path_to_url(expected_repo_path)))
184
strip_trailing_slash(local_path_to_url(expected_repo_path)))
297
186
def test_branch_no_tree(self):
298
187
self.example_branch('source')
299
188
self.run_bzr('branch --no-tree source target')
300
self.assertPathDoesNotExist('target/hello')
301
self.assertPathDoesNotExist('target/goodbye')
189
self.failIfExists('target/hello')
190
self.failIfExists('target/goodbye')
303
192
def test_branch_into_existing_dir(self):
304
193
self.example_branch('a')
305
# existing dir with similar files but no .brz dir
194
# existing dir with similar files but no .bzr dir
306
195
self.build_tree_contents([('b/',)])
307
self.build_tree_contents([('b/hello', b'bar')]) # different content
308
self.build_tree_contents([('b/goodbye', b'baz')]) # same content
196
self.build_tree_contents([('b/hello', 'bar')]) # different content
197
self.build_tree_contents([('b/goodbye', 'baz')])# same content
309
198
# fails without --use-existing-dir
310
out, err = self.run_bzr('branch a b', retcode=3)
199
out,err = self.run_bzr('branch a b', retcode=3)
311
200
self.assertEqual('', out)
312
self.assertEqual('brz: ERROR: Target directory "b" already exists.\n',
201
self.assertEqual('bzr: ERROR: Target directory "b" already exists.\n',
314
203
# force operation
315
204
self.run_bzr('branch a b --use-existing-dir')
316
205
# check conflicts
317
self.assertPathExists('b/hello.moved')
318
self.assertPathDoesNotExist('b/godbye.moved')
206
self.failUnlessExists('b/hello.moved')
207
self.failIfExists('b/godbye.moved')
319
208
# we can't branch into branch
320
out, err = self.run_bzr('branch a b --use-existing-dir', retcode=3)
209
out,err = self.run_bzr('branch a b --use-existing-dir', retcode=3)
321
210
self.assertEqual('', out)
322
self.assertEqual('brz: ERROR: Already a branch: "b".\n', err)
211
self.assertEqual('bzr: ERROR: Already a branch: "b".\n', err)
324
213
def test_branch_bind(self):
325
214
self.example_branch('a')
351
240
def test_lightweight_checkout_with_post_branch_init_hook(self):
353
242
branch.Branch.hooks.install_named_hook('post_branch_init',
355
244
self.assertLength(0, calls)
356
245
self.example_branch('a')
357
246
self.assertLength(1, calls)
358
247
self.run_bzr('checkout --lightweight a b')
359
248
self.assertLength(2, calls)
361
def test_branch_fetches_all_tags(self):
362
builder = self.make_branch_builder('source')
363
source, rev1, rev2 = fixtures.build_branch_with_non_ancestral_rev(
365
source.tags.set_tag('tag-a', rev2)
366
source.get_config_stack().set('branch.fetch_tags', True)
367
# Now source has a tag not in its ancestry. Make a branch from it.
368
self.run_bzr('branch source new-branch')
369
new_branch = branch.Branch.open('new-branch')
370
# The tag is present, and so is its revision.
371
self.assertEqual(rev2, new_branch.tags.lookup_tag('tag-a'))
372
new_branch.repository.get_revision(rev2)
374
def test_branch_with_nested_trees(self):
375
orig = self.make_branch_and_tree('source', format='development-subtree')
376
subtree = self.make_branch_and_tree('source/subtree')
377
self.build_tree(['source/subtree/a'])
379
subtree.commit('add subtree contents')
380
orig.add_reference(subtree)
381
orig.set_reference_info('subtree', subtree.branch.user_url)
382
orig.commit('add subtree')
384
self.run_bzr('branch source target')
386
target = WorkingTree.open('target')
387
target_subtree = WorkingTree.open('target/subtree')
388
self.assertTreesEqual(orig, target)
389
self.assertTreesEqual(subtree, target_subtree)
391
def test_branch_with_nested_trees_reference_unset(self):
392
orig = self.make_branch_and_tree('source', format='development-subtree')
393
subtree = self.make_branch_and_tree('source/subtree')
394
self.build_tree(['source/subtree/a'])
396
subtree.commit('add subtree contents')
397
orig.add_reference(subtree)
398
orig.commit('add subtree')
400
self.run_bzr('branch source target')
402
target = WorkingTree.open('target')
403
self.assertRaises(errors.NotBranchError, WorkingTree.open, 'target/subtree')
405
def test_branch_with_nested_trees_no_recurse(self):
406
orig = self.make_branch_and_tree('source', format='development-subtree')
407
subtree = self.make_branch_and_tree('source/subtree')
408
self.build_tree(['source/subtree/a'])
410
subtree.commit('add subtree contents')
411
orig.add_reference(subtree)
412
orig.commit('add subtree')
414
self.run_bzr('branch --no-recurse-nested source target')
416
target = WorkingTree.open('target')
417
self.addCleanup(subtree.lock_read().unlock)
418
basis = subtree.basis_tree()
419
self.addCleanup(basis.lock_read().unlock)
420
self.assertRaises(errors.NotBranchError, WorkingTree.open, 'target/subtree')
423
class TestBranchStacked(tests.TestCaseWithTransport):
251
class TestBranchStacked(TestCaseWithTransport):
424
252
"""Tests for branch --stacked"""
426
254
def assertRevisionInRepository(self, repo_path, revid):
427
"""Check that a revision is in a repo, disregarding stacking."""
428
repo = controldir.ControlDir.open(repo_path).open_repository()
255
"""Check that a revision is in a repository, disregarding stacking."""
256
repo = bzrdir.BzrDir.open(repo_path).open_repository()
429
257
self.assertTrue(repo.has_revision(revid))
431
259
def assertRevisionNotInRepository(self, repo_path, revid):
432
"""Check that a revision is not in a repo, disregarding stacking."""
433
repo = controldir.ControlDir.open(repo_path).open_repository()
260
"""Check that a revision is not in a repository, disregarding stacking."""
261
repo = bzrdir.BzrDir.open(repo_path).open_repository()
434
262
self.assertFalse(repo.has_revision(revid))
436
264
def assertRevisionsInBranchRepository(self, revid_list, branch_path):
437
265
repo = branch.Branch.open(branch_path).repository
438
266
self.assertEqual(set(revid_list),
439
repo.has_revisions(revid_list))
267
repo.has_revisions(revid_list))
441
269
def test_branch_stacked_branch_not_stacked(self):
442
270
"""Branching a stacked branch is not stacked by default"""
443
271
# We have a mainline
444
272
trunk_tree = self.make_branch_and_tree('target',
446
274
trunk_tree.commit('mainline')
447
275
# and a branch from it which is stacked
448
276
branch_tree = self.make_branch_and_tree('branch',
450
278
branch_tree.branch.set_stacked_on_url(trunk_tree.branch.base)
451
279
# with some work on it
452
work_tree = trunk_tree.branch.controldir.sprout(
453
'local').open_workingtree()
280
work_tree = trunk_tree.branch.bzrdir.sprout('local').open_workingtree()
454
281
work_tree.commit('moar work plz')
455
282
work_tree.branch.push(branch_tree.branch)
456
283
# branching our local branch gives us a new stacked branch pointing at
458
285
out, err = self.run_bzr(['branch', 'branch', 'newbranch'])
459
286
self.assertEqual('', out)
460
self.assertEqual('Branched 2 revisions.\n',
287
self.assertEqual('Branched 2 revision(s).\n',
462
289
# it should have preserved the branch format, and so it should be
463
290
# capable of supporting stacking, but not actually have a stacked_on
464
291
# branch configured
465
292
self.assertRaises(errors.NotStacked,
466
controldir.ControlDir.open('newbranch').open_branch().get_stacked_on_url)
293
bzrdir.BzrDir.open('newbranch').open_branch().get_stacked_on_url)
468
295
def test_branch_stacked_branch_stacked(self):
469
296
"""Asking to stack on a stacked branch does work"""
470
297
# We have a mainline
471
298
trunk_tree = self.make_branch_and_tree('target',
473
300
trunk_revid = trunk_tree.commit('mainline')
474
301
# and a branch from it which is stacked
475
302
branch_tree = self.make_branch_and_tree('branch',
477
304
branch_tree.branch.set_stacked_on_url(trunk_tree.branch.base)
478
305
# with some work on it
479
work_tree = trunk_tree.branch.controldir.sprout(
480
'local').open_workingtree()
306
work_tree = trunk_tree.branch.bzrdir.sprout('local').open_workingtree()
481
307
branch_revid = work_tree.commit('moar work plz')
482
308
work_tree.branch.push(branch_tree.branch)
483
309
# you can chain branches on from there
484
310
out, err = self.run_bzr(['branch', 'branch', '--stacked', 'branch2'])
485
311
self.assertEqual('', out)
486
312
self.assertEqual('Created new stacked branch referring to %s.\n' %
487
branch_tree.branch.base, err)
313
branch_tree.branch.base, err)
488
314
self.assertEqual(branch_tree.branch.base,
489
branch.Branch.open('branch2').get_stacked_on_url())
315
branch.Branch.open('branch2').get_stacked_on_url())
490
316
branch2_tree = WorkingTree.open('branch2')
491
317
branch2_revid = work_tree.commit('work on second stacked branch')
492
318
work_tree.branch.push(branch2_tree.branch)
580
400
t.commit(message='commit %d' % count)
581
401
self.reset_smart_call_log()
582
402
out, err = self.run_bzr(['branch', self.get_url('from'),
584
404
# This figure represent the amount of work to perform this use case. It
585
405
# is entirely ok to reduce this number if a test fails due to rpc_count
586
406
# being too low. If rpc_count increases, more network roundtrips have
587
407
# become necessary for this use case. Please do not adjust this number
588
408
# upwards without agreement from bzr's network support maintainers.
589
self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
590
self.assertLength(11, self.hpss_calls)
591
self.assertLength(1, self.hpss_connections)
409
self.assertLength(10, self.hpss_calls)
593
411
def test_branch_from_trivial_stacked_branch_streaming_acceptance(self):
594
412
self.setup_smart_server_with_call_log()
595
413
t = self.make_branch_and_tree('trunk')
596
414
for count in range(8):
597
415
t.commit(message='commit %d' % count)
598
tree2 = t.branch.controldir.sprout('feature', stacked=True
600
local_tree = t.branch.controldir.sprout(
601
'local-working').open_workingtree()
416
tree2 = t.branch.bzrdir.sprout('feature', stacked=True
418
local_tree = t.branch.bzrdir.sprout('local-working').open_workingtree()
602
419
local_tree.commit('feature change')
603
420
local_tree.branch.push(tree2.branch)
604
421
self.reset_smart_call_log()
605
422
out, err = self.run_bzr(['branch', self.get_url('feature'),
607
# This figure represent the amount of work to perform this use case. It
608
# is entirely ok to reduce this number if a test fails due to rpc_count
609
# being too low. If rpc_count increases, more network roundtrips have
610
# become necessary for this use case. Please do not adjust this number
611
# upwards without agreement from bzr's network support maintainers.
612
self.assertLength(16, self.hpss_calls)
613
self.assertLength(1, self.hpss_connections)
614
self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
616
def test_branch_from_branch_with_tags(self):
617
self.setup_smart_server_with_call_log()
618
builder = self.make_branch_builder('source')
619
source, rev1, rev2 = fixtures.build_branch_with_non_ancestral_rev(
621
source.get_config_stack().set('branch.fetch_tags', True)
622
source.tags.set_tag('tag-a', rev2)
623
source.tags.set_tag('tag-missing', b'missing-rev')
624
# Now source has a tag not in its ancestry. Make a branch from it.
625
self.reset_smart_call_log()
626
out, err = self.run_bzr(['branch', self.get_url('source'), 'target'])
627
# This figure represent the amount of work to perform this use case. It
628
# is entirely ok to reduce this number if a test fails due to rpc_count
629
# being too low. If rpc_count increases, more network roundtrips have
630
# become necessary for this use case. Please do not adjust this number
631
# upwards without agreement from bzr's network support maintainers.
632
self.assertLength(11, self.hpss_calls)
633
self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
634
self.assertLength(1, self.hpss_connections)
636
def test_branch_to_stacked_from_trivial_branch_streaming_acceptance(self):
637
self.setup_smart_server_with_call_log()
638
t = self.make_branch_and_tree('from')
639
for count in range(9):
640
t.commit(message='commit %d' % count)
641
self.reset_smart_call_log()
642
out, err = self.run_bzr(['branch', '--stacked', self.get_url('from'),
644
# XXX: the number of hpss calls for this case isn't deterministic yet,
645
# so we can't easily assert about the number of calls.
646
#self.assertLength(XXX, self.hpss_calls)
647
# We can assert that none of the calls were readv requests for rix
648
# files, though (demonstrating that at least get_parent_map calls are
649
# not using VFS RPCs).
650
readvs_of_rix_files = [
651
c for c in self.hpss_calls
652
if c.call.method == 'readv' and c.call.args[-1].endswith('.rix')]
653
self.assertLength(1, self.hpss_connections)
654
self.assertLength(0, readvs_of_rix_files)
655
self.expectFailure("branching to stacked requires VFS access",
656
self.assertThat, self.hpss_calls, ContainsNoVfsCalls)
658
def test_branch_from_branch_with_ghosts(self):
659
self.setup_smart_server_with_call_log()
660
t = self.make_branch_and_tree('from')
661
for count in range(9):
662
t.commit(message='commit %d' % count)
663
t.set_parent_ids([t.last_revision(), b'ghost'])
664
t.commit(message='add commit with parent')
665
self.reset_smart_call_log()
666
out, err = self.run_bzr(['branch', self.get_url('from'),
668
# This figure represent the amount of work to perform this use case. It
669
# is entirely ok to reduce this number if a test fails due to rpc_count
670
# being too low. If rpc_count increases, more network roundtrips have
671
# become necessary for this use case. Please do not adjust this number
672
# upwards without agreement from bzr's network support maintainers.
673
self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
674
self.assertLength(12, self.hpss_calls)
675
self.assertLength(1, self.hpss_connections)
424
# This figure represent the amount of work to perform this use case. It
425
# is entirely ok to reduce this number if a test fails due to rpc_count
426
# being too low. If rpc_count increases, more network roundtrips have
427
# become necessary for this use case. Please do not adjust this number
428
# upwards without agreement from bzr's network support maintainers.
429
self.assertLength(15, self.hpss_calls)
678
432
class TestRemoteBranch(TestCaseWithSFTPServer):
698
452
# Ensure that no working tree what created remotely
699
453
self.assertFalse(t.has('remote/file'))
702
class TestBranchParentLocation(test_switch.TestSwitchParentLocationBase):
704
def _checkout_and_branch(self, option=''):
705
self.script_runner.run_script(self, '''
706
$ brz checkout %(option)s repo/trunk checkout
708
$ brz branch --switch ../repo/trunk ../repo/branched
709
2>Branched 0 revisions.
710
2>Tree is up to date at revision 0.
711
2>Switched to branch:...branched...
714
bound_branch = branch.Branch.open_containing('checkout')[0]
715
master_branch = branch.Branch.open_containing('repo/branched')[0]
716
return (bound_branch, master_branch)
718
def test_branch_switch_parent_lightweight(self):
719
"""Lightweight checkout using brz branch --switch."""
720
bb, mb = self._checkout_and_branch(option='--lightweight')
721
self.assertParent('repo/trunk', bb)
722
self.assertParent('repo/trunk', mb)
724
def test_branch_switch_parent_heavyweight(self):
725
"""Heavyweight checkout using brz branch --switch."""
726
bb, mb = self._checkout_and_branch()
727
self.assertParent('repo/trunk', bb)
728
self.assertParent('repo/trunk', mb)