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