/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/blackbox/test_info.py

  • Committer: Jelmer Vernooij
  • Date: 2019-08-11 13:21:03 UTC
  • mfrom: (7379 work)
  • mto: This revision was merged to the branch mainline in revision 7388.
  • Revision ID: jelmer@jelmer.uk-20190811132103-u3ne03yf37c1h57n
merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1399
1399
                                        repo_branch=repo_branch,
1400
1400
                                        verbose=True, light_checkout=True)
1401
1401
        # U U L
1402
 
        lco_tree.branch.repository.lock_write()
1403
 
        try:
 
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)
1407
 
        finally:
1408
 
            lco_tree.branch.repository.unlock()
1409
1406
        # U L L
1410
 
        lco_tree.branch.lock_write()
1411
 
        try:
 
1407
        with lco_tree.branch.lock_write():
1412
1408
            self.assertCheckoutStatusOutput('-v tree/lightcheckout',
1413
1409
                                            lco_tree,
1414
1410
                                            branch_locked=True,
1415
1411
                                            repo_locked=True,
1416
1412
                                            repo_branch=repo_branch,
1417
1413
                                            verbose=True)
1418
 
        finally:
1419
 
            lco_tree.branch.unlock()
1420
1414
        # L L L
1421
 
        lco_tree.lock_write()
1422
 
        try:
 
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,
1428
1421
                                            verbose=True)
1429
 
        finally:
1430
 
            lco_tree.unlock()
1431
1422
        # L L U
1432
 
        lco_tree.lock_write()
1433
 
        lco_tree.branch.repository.unlock()
1434
 
        try:
 
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,
1439
1428
                                            verbose=True)
1440
 
        finally:
1441
 
            lco_tree.branch.repository.lock_write()
1442
 
            lco_tree.unlock()
1443
1429
        # L U U
1444
 
        lco_tree.lock_write()
1445
 
        lco_tree.branch.unlock()
1446
 
        try:
 
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,
1450
1434
                                            verbose=True)
1451
 
        finally:
1452
 
            lco_tree.branch.lock_write()
1453
 
            lco_tree.unlock()
1454
1435
        # L U L
1455
 
        lco_tree.lock_write()
1456
 
        lco_tree.branch.unlock()
1457
 
        lco_tree.branch.repository.lock_write()
1458
 
        try:
 
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,
1463
1442
                                            verbose=True)
1464
 
        finally:
1465
 
            lco_tree.branch.repository.unlock()
1466
 
            lco_tree.branch.lock_write()
1467
 
            lco_tree.unlock()
1468
1443
        # U L U
1469
 
        lco_tree.branch.lock_write()
1470
 
        lco_tree.branch.repository.unlock()
1471
 
        try:
 
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,
1475
1448
                                            verbose=True)
1476
 
        finally:
1477
 
            lco_tree.branch.repository.lock_write()
1478
 
            lco_tree.branch.unlock()
1479
1449
 
1480
1450
        if sys.platform == 'win32':
1481
1451
            self.knownFailure('Win32 cannot run "brz info"'