1418
1399
repo_branch=repo_branch,
1419
1400
verbose=True, light_checkout=True)
1421
with lco_tree.branch.repository.lock_write():
1402
lco_tree.branch.repository.lock_write()
1422
1404
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1423
1405
lco_tree, repo_branch=repo_branch,
1424
1406
repo_locked=True, verbose=True, light_checkout=True)
1408
lco_tree.branch.repository.unlock()
1426
with lco_tree.branch.lock_write():
1410
lco_tree.branch.lock_write()
1427
1412
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1429
1414
branch_locked=True,
1430
1415
repo_locked=True,
1431
1416
repo_branch=repo_branch,
1419
lco_tree.branch.unlock()
1434
with lco_tree.lock_write():
1421
lco_tree.lock_write()
1435
1423
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1436
1424
lco_tree, repo_branch=repo_branch,
1437
1425
tree_locked=True,
1438
1426
branch_locked=True,
1439
1427
repo_locked=True,
1442
with lco_tree.lock_write(), lco_tree.branch.repository.unlock():
1432
lco_tree.lock_write()
1433
lco_tree.branch.repository.unlock()
1443
1435
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1444
1436
lco_tree, repo_branch=repo_branch,
1445
1437
tree_locked=True,
1446
1438
branch_locked=True,
1441
lco_tree.branch.repository.lock_write()
1449
with lco_tree.lock_write(), lco_tree.branch.unlock():
1444
lco_tree.lock_write()
1445
lco_tree.branch.unlock()
1450
1447
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1451
1448
lco_tree, repo_branch=repo_branch,
1452
1449
tree_locked=True,
1452
lco_tree.branch.lock_write()
1455
with lco_tree.lock_write(), lco_tree.branch.unlock(), \
1456
lco_tree.branch.repository.lock_write():
1455
lco_tree.lock_write()
1456
lco_tree.branch.unlock()
1457
lco_tree.branch.repository.lock_write()
1457
1459
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1458
1460
lco_tree, repo_branch=repo_branch,
1459
1461
tree_locked=True,
1460
1462
repo_locked=True,
1465
lco_tree.branch.repository.unlock()
1466
lco_tree.branch.lock_write()
1463
with lco_tree.branch.lock_write(), lco_tree.branch.repository.unlock():
1469
lco_tree.branch.lock_write()
1470
lco_tree.branch.repository.unlock()
1464
1472
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1465
1473
lco_tree, repo_branch=repo_branch,
1466
1474
branch_locked=True,
1477
lco_tree.branch.repository.lock_write()
1478
lco_tree.branch.unlock()
1469
1480
if sys.platform == 'win32':
1470
1481
self.knownFailure('Win32 cannot run "brz info"'
1552
1562
self.assertEqual("", err)
1565
class TestSmartServerInfo(tests.TestCaseWithTransport):
1567
def test_simple_branch_info(self):
1568
self.setup_smart_server_with_call_log()
1569
t = self.make_branch_and_tree('branch')
1570
self.build_tree_contents([('branch/foo', b'thecontents')])
1573
self.reset_smart_call_log()
1574
out, err = self.run_bzr(['info', self.get_url('branch')])
1575
# This figure represent the amount of work to perform this use case. It
1576
# is entirely ok to reduce this number if a test fails due to rpc_count
1577
# being too low. If rpc_count increases, more network roundtrips have
1578
# become necessary for this use case. Please do not adjust this number
1579
# upwards without agreement from bzr's network support maintainers.
1580
self.assertLength(10, self.hpss_calls)
1581
self.assertLength(1, self.hpss_connections)
1582
self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
1584
def test_verbose_branch_info(self):
1585
self.setup_smart_server_with_call_log()
1586
t = self.make_branch_and_tree('branch')
1587
self.build_tree_contents([('branch/foo', b'thecontents')])
1590
self.reset_smart_call_log()
1591
out, err = self.run_bzr(['info', '-v', self.get_url('branch')])
1592
# This figure represent the amount of work to perform this use case. It
1593
# is entirely ok to reduce this number if a test fails due to rpc_count
1594
# being too low. If rpc_count increases, more network roundtrips have
1595
# become necessary for this use case. Please do not adjust this number
1596
# upwards without agreement from bzr's network support maintainers.
1597
self.assertLength(14, self.hpss_calls)
1598
self.assertLength(1, self.hpss_connections)
1599
self.assertThat(self.hpss_calls, ContainsNoVfsCalls)