/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/per_branch/test_locking.py

  • Committer: Jelmer Vernooij
  • Date: 2017-06-10 00:17:06 UTC
  • mto: (6670.4.8 move-bzr)
  • mto: This revision was merged to the branch mainline in revision 6681.
  • Revision ID: jelmer@jelmer.uk-20170610001706-xn6jiuev350246mr
Rename a number of attributes from bzrdir to controldir.

Show diffs side-by-side

added added

removed removed

Lines of Context:
329
329
                return
330
330
            different_branch_token = token + 'xxx'
331
331
 
332
 
            new_branch = branch.bzrdir.open_branch()
 
332
            new_branch = branch.controldir.open_branch()
333
333
            # We only want to test the relocking abilities of branch, so use the
334
334
            # existing repository object which is already locked.
335
335
            new_branch.repository = branch.repository
355
355
            branch.unlock()
356
356
            # Calling lock_write on a new instance for the same lockable will
357
357
            # also succeed.
358
 
            new_branch = branch.bzrdir.open_branch()
 
358
            new_branch = branch.controldir.open_branch()
359
359
            # We only want to test the relocking abilities of branch, so use the
360
360
            # existing repository object which is already locked.
361
361
            new_branch.repository = branch.repository
374
374
                # This test does not apply, because this lockable refuses
375
375
                # tokens.
376
376
                return
377
 
            new_branch = branch.bzrdir.open_branch()
 
377
            new_branch = branch.controldir.open_branch()
378
378
            # We only want to test the relocking abilities of branch, so use the
379
379
            # existing repository object which is already locked.
380
380
            new_branch.repository = branch.repository
413
413
            branch.unlock()
414
414
        # The lock should be unlocked on disk.  Verify that with a new lock
415
415
        # instance.
416
 
        new_branch = branch.bzrdir.open_branch()
 
416
        new_branch = branch.controldir.open_branch()
417
417
        # Calling lock_write now should work, rather than raise LockContention.
418
418
        new_branch.lock_write()
419
419
        new_branch.unlock()
469
469
            branch.unlock()
470
470
        # Reacquire the lock (with a different branch object) by using the
471
471
        # tokens.
472
 
        new_branch = branch.bzrdir.open_branch()
 
472
        new_branch = branch.controldir.open_branch()
473
473
        if repo_token is not None:
474
474
            # We have to explicitly lock the repository first.
475
475
            new_branch.repository.lock_write(token=repo_token)
501
501
 
502
502
    def test_lock_write_locks_repo_too(self):
503
503
        branch = self.make_branch('b')
504
 
        branch = branch.bzrdir.open_branch()
 
504
        branch = branch.controldir.open_branch()
505
505
        branch.lock_write()
506
506
        try:
507
507
            # The branch should have asked the repository to lock.
512
512
                return
513
513
            # Now the branch.repository is physically locked, so we can't lock
514
514
            # it with a new repository instance.
515
 
            new_repo = branch.bzrdir.open_repository()
 
515
            new_repo = branch.controldir.open_repository()
516
516
            self.assertRaises(errors.LockContention, new_repo.lock_write)
517
517
            # We can call lock_write on the original repository object though,
518
518
            # because it is already locked.