84
83
' checkout of branch: target\n')
85
84
self.assertEqual(err, '')
86
def test_info_colocated(self):
87
br = self.make_branch_and_tree('target', format='development-colo')
88
target = br.controldir.create_branch(name='dichtbij')
89
br.controldir.set_branch_reference(target)
90
out, err = self.run_bzr('info target')
92
'Standalone tree (format: development-colo)\n'
94
' light checkout root: target\n'
95
' checkout of co-located branch: dichtbij\n')
96
self.assertEqual(err, '')
87
98
def test_info_standalone(self):
88
99
transport = self.get_transport()
1387
1418
repo_branch=repo_branch,
1388
1419
verbose=True, light_checkout=True)
1390
lco_tree.branch.repository.lock_write()
1421
with lco_tree.branch.repository.lock_write():
1392
1422
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1393
1423
lco_tree, repo_branch=repo_branch,
1394
1424
repo_locked=True, verbose=True, light_checkout=True)
1396
lco_tree.branch.repository.unlock()
1398
lco_tree.branch.lock_write()
1426
with lco_tree.branch.lock_write():
1400
1427
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1402
1429
branch_locked=True,
1403
1430
repo_locked=True,
1404
1431
repo_branch=repo_branch,
1407
lco_tree.branch.unlock()
1409
lco_tree.lock_write()
1434
with lco_tree.lock_write():
1411
1435
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1412
1436
lco_tree, repo_branch=repo_branch,
1413
1437
tree_locked=True,
1414
1438
branch_locked=True,
1415
1439
repo_locked=True,
1420
lco_tree.lock_write()
1421
lco_tree.branch.repository.unlock()
1442
with lco_tree.lock_write(), lco_tree.branch.repository.unlock():
1423
1443
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1424
1444
lco_tree, repo_branch=repo_branch,
1425
1445
tree_locked=True,
1426
1446
branch_locked=True,
1429
lco_tree.branch.repository.lock_write()
1432
lco_tree.lock_write()
1433
lco_tree.branch.unlock()
1449
with lco_tree.lock_write(), lco_tree.branch.unlock():
1435
1450
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1436
1451
lco_tree, repo_branch=repo_branch,
1437
1452
tree_locked=True,
1440
lco_tree.branch.lock_write()
1443
lco_tree.lock_write()
1444
lco_tree.branch.unlock()
1445
lco_tree.branch.repository.lock_write()
1455
with lco_tree.lock_write(), lco_tree.branch.unlock(), \
1456
lco_tree.branch.repository.lock_write():
1447
1457
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1448
1458
lco_tree, repo_branch=repo_branch,
1449
1459
tree_locked=True,
1450
1460
repo_locked=True,
1453
lco_tree.branch.repository.unlock()
1454
lco_tree.branch.lock_write()
1457
lco_tree.branch.lock_write()
1458
lco_tree.branch.repository.unlock()
1463
with lco_tree.branch.lock_write(), lco_tree.branch.repository.unlock():
1460
1464
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1461
1465
lco_tree, repo_branch=repo_branch,
1462
1466
branch_locked=True,
1465
lco_tree.branch.repository.lock_write()
1466
lco_tree.branch.unlock()
1468
1469
if sys.platform == 'win32':
1469
1470
self.knownFailure('Win32 cannot run "brz info"'
1550
1552
self.assertEqual("", err)
1553
class TestSmartServerInfo(tests.TestCaseWithTransport):
1555
def test_simple_branch_info(self):
1556
self.setup_smart_server_with_call_log()
1557
t = self.make_branch_and_tree('branch')
1558
self.build_tree_contents([('branch/foo', b'thecontents')])
1561
self.reset_smart_call_log()
1562
out, err = self.run_bzr(['info', self.get_url('branch')])
1563
# This figure represent the amount of work to perform this use case. It
1564
# is entirely ok to reduce this number if a test fails due to rpc_count
1565
# being too low. If rpc_count increases, more network roundtrips have
1566
# become necessary for this use case. Please do not adjust this number
1567
# upwards without agreement from bzr's network support maintainers.
1568
self.assertLength(10, self.hpss_calls)
1569
self.assertLength(1, self.hpss_connections)
1570
self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
1572
def test_verbose_branch_info(self):
1573
self.setup_smart_server_with_call_log()
1574
t = self.make_branch_and_tree('branch')
1575
self.build_tree_contents([('branch/foo', b'thecontents')])
1578
self.reset_smart_call_log()
1579
out, err = self.run_bzr(['info', '-v', self.get_url('branch')])
1580
# This figure represent the amount of work to perform this use case. It
1581
# is entirely ok to reduce this number if a test fails due to rpc_count
1582
# being too low. If rpc_count increases, more network roundtrips have
1583
# become necessary for this use case. Please do not adjust this number
1584
# upwards without agreement from bzr's network support maintainers.
1585
self.assertLength(14, self.hpss_calls)
1586
self.assertLength(1, self.hpss_connections)
1587
self.assertThat(self.hpss_calls, ContainsNoVfsCalls)