/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/per_repository/test_fetch.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:
67
67
        tree_a.add('foo', 'file1')
68
68
        tree_a.commit('rev1', rev_id='rev1')
69
69
        # create a knit-3 based format to fetch into
70
 
        f = controldir.format_registry.make_bzrdir('development-subtree')
 
70
        f = controldir.format_registry.make_controldir('development-subtree')
71
71
        try:
72
72
            format = tree_a.branch.repository._format
73
73
            format.check_conversion_target(f.repository_format)
247
247
        rev_id = tree.commit('one')
248
248
        # This needs to be a new copy of the repository, if this changes, the
249
249
        # test needs to be rewritten
250
 
        repo = tree.branch.repository.bzrdir.open_repository()
 
250
        repo = tree.branch.repository.controldir.open_repository()
251
251
        # This fetch should be a no-op see bug #158333
252
252
        tree.branch.repository.fetch(repo, None)
253
253
 
254
254
    def test_fetch_from_self(self):
255
255
        tree = self.make_branch_and_tree('.')
256
256
        rev_id = tree.commit('one')
257
 
        repo = tree.branch.repository.bzrdir.open_repository()
 
257
        repo = tree.branch.repository.controldir.open_repository()
258
258
        # This fetch should be a no-op see bug #158333
259
259
        tree.branch.repository.fetch(repo, rev_id)
260
260
 
263
263
        rev_id = tree.commit('one')
264
264
        # Even though the fetch() is a NO-OP it should assert the revision id
265
265
        # is present
266
 
        repo = tree.branch.repository.bzrdir.open_repository()
 
266
        repo = tree.branch.repository.controldir.open_repository()
267
267
        self.assertRaises(errors.NoSuchRevision, tree.branch.repository.fetch,
268
268
                          repo, 'no-such-revision')
269
269
 
337
337
    def test_fetch_into_smart_with_ghost(self):
338
338
        trans = self.make_smart_server('target')
339
339
        source_b = self.make_simple_branch_with_ghost()
340
 
        if not source_b.bzrdir._format.supports_transport(trans):
 
340
        if not source_b.controldir._format.supports_transport(trans):
341
341
            raise TestNotApplicable("format does not support transport")
342
342
        target = self.make_repository('target')
343
343
        # Re-open the repository over the smart protocol
356
356
    def test_fetch_from_smart_with_ghost(self):
357
357
        trans = self.make_smart_server('source')
358
358
        source_b = self.make_simple_branch_with_ghost()
359
 
        if not source_b.bzrdir._format.supports_transport(trans):
 
359
        if not source_b.controldir._format.supports_transport(trans):
360
360
            raise TestNotApplicable("format does not support transport")
361
361
        target = self.make_repository('target')
362
362
        target.lock_write()