1399
1399
repo_branch=repo_branch,
1400
1400
verbose=True, light_checkout=True)
1402
lco_tree.branch.repository.lock_write()
1402
with lco_tree.branch.repository.lock_write():
1404
1403
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1405
1404
lco_tree, repo_branch=repo_branch,
1406
1405
repo_locked=True, verbose=True, light_checkout=True)
1408
lco_tree.branch.repository.unlock()
1410
lco_tree.branch.lock_write()
1407
with lco_tree.branch.lock_write():
1412
1408
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1414
1410
branch_locked=True,
1415
1411
repo_locked=True,
1416
1412
repo_branch=repo_branch,
1419
lco_tree.branch.unlock()
1421
lco_tree.lock_write()
1415
with lco_tree.lock_write():
1423
1416
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1424
1417
lco_tree, repo_branch=repo_branch,
1425
1418
tree_locked=True,
1426
1419
branch_locked=True,
1427
1420
repo_locked=True,
1432
lco_tree.lock_write()
1433
lco_tree.branch.repository.unlock()
1423
with lco_tree.lock_write(), lco_tree.branch.repository.unlock():
1435
1424
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1436
1425
lco_tree, repo_branch=repo_branch,
1437
1426
tree_locked=True,
1438
1427
branch_locked=True,
1441
lco_tree.branch.repository.lock_write()
1444
lco_tree.lock_write()
1445
lco_tree.branch.unlock()
1430
with lco_tree.lock_write(), lco_tree.branch.unlock():
1447
1431
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1448
1432
lco_tree, repo_branch=repo_branch,
1449
1433
tree_locked=True,
1452
lco_tree.branch.lock_write()
1455
lco_tree.lock_write()
1456
lco_tree.branch.unlock()
1457
lco_tree.branch.repository.lock_write()
1436
with lco_tree.lock_write(), lco_tree.branch.unlock(), \
1437
lco_tree.branch.repository.lock_write():
1459
1438
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1460
1439
lco_tree, repo_branch=repo_branch,
1461
1440
tree_locked=True,
1462
1441
repo_locked=True,
1465
lco_tree.branch.repository.unlock()
1466
lco_tree.branch.lock_write()
1469
lco_tree.branch.lock_write()
1470
lco_tree.branch.repository.unlock()
1444
with lco_tree.branch.lock_write(), lco_tree.branch.repository.unlock():
1472
1445
self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1473
1446
lco_tree, repo_branch=repo_branch,
1474
1447
branch_locked=True,
1477
lco_tree.branch.repository.lock_write()
1478
lco_tree.branch.unlock()
1480
1450
if sys.platform == 'win32':
1481
1451
self.knownFailure('Win32 cannot run "brz info"'