/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_workingtree.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:
139
139
        """See WorkingTreeFormat.get_format_string()."""
140
140
        return "Sample tree format."
141
141
 
142
 
    def initialize(self, a_bzrdir, revision_id=None, from_branch=None,
 
142
    def initialize(self, a_controldir, revision_id=None, from_branch=None,
143
143
                   accelerator_tree=None, hardlink=False):
144
144
        """Sample branches cannot be created."""
145
 
        t = a_bzrdir.get_workingtree_transport(self)
 
145
        t = a_controldir.get_workingtree_transport(self)
146
146
        t.put_bytes('format', self.get_format_string())
147
147
        return 'A tree'
148
148
 
162
162
        # Not usable in a metadir, so no format string
163
163
        return None
164
164
 
165
 
    def initialize(self, a_bzrdir, revision_id=None, from_branch=None,
 
165
    def initialize(self, a_controldir, revision_id=None, from_branch=None,
166
166
                   accelerator_tree=None, hardlink=False):
167
167
        raise NotImplementedError(self.initialize)
168
168
 
180
180
        # is the right format object found for a working tree?
181
181
        branch = self.make_branch('branch')
182
182
        self.assertRaises(errors.NoWorkingTree,
183
 
            workingtree.WorkingTreeFormatMetaDir.find_format_string, branch.bzrdir)
184
 
        transport = branch.bzrdir.get_workingtree_transport(None)
 
183
            workingtree.WorkingTreeFormatMetaDir.find_format_string, branch.controldir)
 
184
        transport = branch.controldir.get_workingtree_transport(None)
185
185
        transport.mkdir('.')
186
186
        transport.put_bytes("format", "some format name")
187
187
        # The format does not have to be known by Bazaar,
188
188
        # find_format_string just retrieves the name
189
189
        self.assertEqual("some format name",
190
 
            workingtree.WorkingTreeFormatMetaDir.find_format_string(branch.bzrdir))
 
190
            workingtree.WorkingTreeFormatMetaDir.find_format_string(branch.controldir))
191
191
 
192
192
    def test_find_format(self):
193
193
        # is the right format object found for a working tree?
222
222
        tree = self.make_branch_and_tree('.', format='2a')
223
223
        tree.update_feature_flags({"name": "necessity"})
224
224
        found_format = workingtree.WorkingTreeFormatMetaDir.find_format(
225
 
            tree.bzrdir)
 
225
            tree.controldir)
226
226
        self.assertIsInstance(found_format, workingtree.WorkingTreeFormat)
227
227
        self.assertEqual(found_format.features.get("name"), "necessity")
228
228
        self.assertRaises(errors.MissingFeature, found_format.check_support_status,
425
425
                                  ('this-tree/foo/bar', 'bar')])
426
426
        this_tree.add(['foo', 'foo/bar'])
427
427
        this_tree.commit('created foo/bar')
428
 
        other_tree = this_tree.bzrdir.sprout('other-tree').open_workingtree()
 
428
        other_tree = this_tree.controldir.sprout('other-tree').open_workingtree()
429
429
        self.build_tree_contents([('other-tree/foo/bar', 'baz')])
430
430
        other_tree.commit('changed bar')
431
431
        self.build_tree_contents([('this-tree/foo/bar', 'qux')])
443
443
        self.build_tree_contents([('base/hello', 'Hello')])
444
444
        base.add('hello', 'hello_id')
445
445
        base.commit('Hello')
446
 
        other = base.bzrdir.sprout('other').open_workingtree()
 
446
        other = base.controldir.sprout('other').open_workingtree()
447
447
        self.build_tree_contents([('other/hello', 'hELLO')])
448
448
        other.commit('Case switch')
449
 
        this = base.bzrdir.sprout('this').open_workingtree()
 
449
        this = base.controldir.sprout('this').open_workingtree()
450
450
        self.assertPathExists('this/hello')
451
451
        self.build_tree_contents([('this/hello', 'Hello World')])
452
452
        this.commit('Add World')