~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_bzrdir.py

  • Committer: Robert Collins
  • Date: 2006-02-15 08:11:37 UTC
  • mto: (1534.1.24 integration)
  • mto: This revision was merged to the branch mainline in revision 1554.
  • Revision ID: robertc@robertcollins.net-20060215081137-4c27377517e96dd1
Make format 4/5/6 branches share a single LockableFiles instance across wt/branch/repository.

Show diffs side-by-side

added added

removed removed

Lines of Context:
385
385
        self.assertEqual(checkout_base, dir.get_workingtree_transport(None).base)
386
386
        self.assertEqual(checkout_base,
387
387
                         dir.get_workingtree_transport(workingtree.WorkingTreeFormat3()).base)
 
388
 
 
389
 
 
390
class TestFormat6(TestCaseWithTransport):
 
391
    """Tests specific to the version 6 bzrdir format."""
 
392
 
 
393
    def test_same_lockfiles_between_tree_repo_branch(self):
 
394
        # this checks that only a single lockfiles instance is created 
 
395
        # for format 6 objects
 
396
        dir = bzrdir.BzrDirFormat6().initialize(self.get_url())
 
397
        def check_dir_components_use_same_lock(dir):
 
398
            ctrl_1 = dir.open_repository().control_files
 
399
            ctrl_2 = dir.open_branch().control_files
 
400
            ctrl_3 = dir.open_workingtree()._control_files
 
401
            self.assertTrue(ctrl_1 is ctrl_2)
 
402
            self.assertTrue(ctrl_2 is ctrl_3)
 
403
        check_dir_components_use_same_lock(dir)
 
404
        # and if we open it normally.
 
405
        dir = bzrdir.BzrDir.open(self.get_url())
 
406
        check_dir_components_use_same_lock(dir)