/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/test_repository.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:
104
104
        """See RepositoryFormat.get_format_string()."""
105
105
        return "Sample .bzr repository format."
106
106
 
107
 
    def initialize(self, a_bzrdir, shared=False):
 
107
    def initialize(self, a_controldir, shared=False):
108
108
        """Initialize a repository in a BzrDir"""
109
 
        t = a_bzrdir.get_repository_transport(self)
 
109
        t = a_controldir.get_repository_transport(self)
110
110
        t.put_bytes('format', self.get_format_string())
111
111
        return 'A bzr repository dir'
112
112
 
113
113
    def is_supported(self):
114
114
        return False
115
115
 
116
 
    def open(self, a_bzrdir, _found=False):
 
116
    def open(self, a_controldir, _found=False):
117
117
        return "opened repository."
118
118
 
119
119
 
167
167
    def test_find_format_with_features(self):
168
168
        tree = self.make_branch_and_tree('.', format='2a')
169
169
        tree.branch.repository.update_feature_flags({"name": "necessity"})
170
 
        found_format = repository.RepositoryFormatMetaDir.find_format(tree.bzrdir)
 
170
        found_format = repository.RepositoryFormatMetaDir.find_format(tree.controldir)
171
171
        self.assertIsInstance(found_format, repository.RepositoryFormatMetaDir)
172
172
        self.assertEqual(found_format.features.get("name"), "necessity")
173
173
        self.assertRaises(errors.MissingFeature, found_format.check_support_status,
543
543
        index = mt.branch.repository.chk_bytes._index._graph_index._indices[0]
544
544
        self.assertEqual(btree_index._gcchk_factory, index._leaf_factory)
545
545
        # It should also work if we re-open the repo
546
 
        repo = mt.branch.repository.bzrdir.open_repository()
 
546
        repo = mt.branch.repository.controldir.open_repository()
547
547
        repo.lock_read()
548
548
        self.addCleanup(repo.unlock)
549
549
        index = repo.chk_bytes._index._graph_index._indices[0]
1540
1540
                  pack_name_with_rev_C_content)
1541
1541
        """
1542
1542
        b_source = self.make_abc_branch()
1543
 
        b_base = b_source.bzrdir.sprout('base', revision_id='A').open_branch()
1544
 
        b_stacked = b_base.bzrdir.sprout('stacked', stacked=True).open_branch()
 
1543
        b_base = b_source.controldir.sprout('base', revision_id='A').open_branch()
 
1544
        b_stacked = b_base.controldir.sprout('stacked', stacked=True).open_branch()
1545
1545
        b_stacked.lock_write()
1546
1546
        self.addCleanup(b_stacked.unlock)
1547
1547
        b_stacked.fetch(b_source, 'B')
1548
1548
        # Now re-open the stacked repo directly (no fallbacks) so that we can
1549
1549
        # fill in the A rev.
1550
 
        repo_not_stacked = b_stacked.bzrdir.open_repository()
 
1550
        repo_not_stacked = b_stacked.controldir.open_repository()
1551
1551
        repo_not_stacked.lock_write()
1552
1552
        self.addCleanup(repo_not_stacked.unlock)
1553
1553
        # Now we should have a pack file with A's inventory, but not its