/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 16:40:42 UTC
  • mfrom: (6653.6.7 rename-controldir)
  • mto: This revision was merged to the branch mainline in revision 6690.
  • Revision ID: jelmer@jelmer.uk-20170610164042-zrxqgy2htyduvke2
MergeĀ rename-controldirĀ branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
        """See RepositoryFormat.get_format_string()."""
108
108
        return "Sample .bzr repository format."
109
109
 
110
 
    def initialize(self, a_bzrdir, shared=False):
 
110
    def initialize(self, a_controldir, shared=False):
111
111
        """Initialize a repository in a BzrDir"""
112
 
        t = a_bzrdir.get_repository_transport(self)
 
112
        t = a_controldir.get_repository_transport(self)
113
113
        t.put_bytes('format', self.get_format_string())
114
114
        return 'A bzr repository dir'
115
115
 
116
116
    def is_supported(self):
117
117
        return False
118
118
 
119
 
    def open(self, a_bzrdir, _found=False):
 
119
    def open(self, a_controldir, _found=False):
120
120
        return "opened repository."
121
121
 
122
122
 
170
170
    def test_find_format_with_features(self):
171
171
        tree = self.make_branch_and_tree('.', format='2a')
172
172
        tree.branch.repository.update_feature_flags({"name": "necessity"})
173
 
        found_format = bzrrepository.RepositoryFormatMetaDir.find_format(tree.bzrdir)
 
173
        found_format = bzrrepository.RepositoryFormatMetaDir.find_format(tree.controldir)
174
174
        self.assertIsInstance(found_format, bzrrepository.RepositoryFormatMetaDir)
175
175
        self.assertEqual(found_format.features.get("name"), "necessity")
176
176
        self.assertRaises(errors.MissingFeature, found_format.check_support_status,
546
546
        index = mt.branch.repository.chk_bytes._index._graph_index._indices[0]
547
547
        self.assertEqual(btree_index._gcchk_factory, index._leaf_factory)
548
548
        # It should also work if we re-open the repo
549
 
        repo = mt.branch.repository.bzrdir.open_repository()
 
549
        repo = mt.branch.repository.controldir.open_repository()
550
550
        repo.lock_read()
551
551
        self.addCleanup(repo.unlock)
552
552
        index = repo.chk_bytes._index._graph_index._indices[0]
978
978
class TestRepositoryPackCollection(TestCaseWithTransport):
979
979
 
980
980
    def get_format(self):
981
 
        return controldir.format_registry.make_bzrdir('pack-0.92')
 
981
        return controldir.format_registry.make_controldir('pack-0.92')
982
982
 
983
983
    def get_packs(self):
984
984
        format = self.get_format()
1543
1543
                  pack_name_with_rev_C_content)
1544
1544
        """
1545
1545
        b_source = self.make_abc_branch()
1546
 
        b_base = b_source.bzrdir.sprout('base', revision_id='A').open_branch()
1547
 
        b_stacked = b_base.bzrdir.sprout('stacked', stacked=True).open_branch()
 
1546
        b_base = b_source.controldir.sprout('base', revision_id='A').open_branch()
 
1547
        b_stacked = b_base.controldir.sprout('stacked', stacked=True).open_branch()
1548
1548
        b_stacked.lock_write()
1549
1549
        self.addCleanup(b_stacked.unlock)
1550
1550
        b_stacked.fetch(b_source, 'B')
1551
1551
        # Now re-open the stacked repo directly (no fallbacks) so that we can
1552
1552
        # fill in the A rev.
1553
 
        repo_not_stacked = b_stacked.bzrdir.open_repository()
 
1553
        repo_not_stacked = b_stacked.controldir.open_repository()
1554
1554
        repo_not_stacked.lock_write()
1555
1555
        self.addCleanup(repo_not_stacked.unlock)
1556
1556
        # Now we should have a pack file with A's inventory, but not its