~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_remote.py

  • Committer: Jelmer Vernooij
  • Date: 2012-04-02 01:44:26 UTC
  • mfrom: (6518 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6519.
  • Revision ID: jelmer@samba.org-20120402014426-0o5qtysohyl006b2
merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
121
121
        self.local_wt.commit(message='test commit', rev_id=revid)
122
122
        self.assertTrue(repo.has_revision(revid))
123
123
 
124
 
    def test_remote_branch_revision_history(self):
125
 
        b = BzrDir.open_from_transport(self.transport).open_branch()
126
 
        self.assertEqual([],
127
 
            self.applyDeprecated(deprecated_in((2, 5, 0)), b.revision_history))
128
 
        r1 = self.local_wt.commit('1st commit')
129
 
        r2 = self.local_wt.commit('1st commit', rev_id=u'\xc8'.encode('utf8'))
130
 
        self.assertEqual([r1, r2],
131
 
            self.applyDeprecated(deprecated_in((2, 5, 0)), b.revision_history))
132
 
 
133
124
    def test_find_correct_format(self):
134
125
        """Should open a RemoteBzrDir over a RemoteTransport"""
135
126
        fmt = BzrDirFormat.find_format(self.transport)
349
340
class TestRemote(tests.TestCaseWithMemoryTransport):
350
341
 
351
342
    def get_branch_format(self):
352
 
        reference_bzrdir_format = bzrdir.format_registry.get('default')()
 
343
        reference_bzrdir_format = controldir.format_registry.get('default')()
353
344
        return reference_bzrdir_format.get_branch_format()
354
345
 
355
346
    def get_repo_format(self):
356
 
        reference_bzrdir_format = bzrdir.format_registry.get('default')()
 
347
        reference_bzrdir_format = controldir.format_registry.get('default')()
357
348
        return reference_bzrdir_format.repository_format
358
349
 
359
350
    def assertFinished(self, fake_client):
475
466
        transport = transport.clone('quack')
476
467
        self.make_bzrdir('quack')
477
468
        client = FakeClient(transport.base)
478
 
        reference_bzrdir_format = bzrdir.format_registry.get('default')()
 
469
        reference_bzrdir_format = controldir.format_registry.get('default')()
479
470
        control_name = reference_bzrdir_format.network_name()
480
471
        client.add_expected_call(
481
472
            'BzrDir.cloning_metadir', ('quack/', 'False'),
509
500
    def test__get_checkout_format(self):
510
501
        transport = MemoryTransport()
511
502
        client = FakeClient(transport.base)
512
 
        reference_bzrdir_format = bzrdir.format_registry.get('default')()
 
503
        reference_bzrdir_format = controldir.format_registry.get('default')()
513
504
        control_name = reference_bzrdir_format.network_name()
514
505
        client.add_expected_call(
515
506
            'BzrDir.checkout_metadir', ('quack/', ),
546
537
    def test_get_branches(self):
547
538
        transport = MemoryTransport()
548
539
        client = FakeClient(transport.base)
549
 
        reference_bzrdir_format = bzrdir.format_registry.get('default')()
 
540
        reference_bzrdir_format = controldir.format_registry.get('default')()
550
541
        branch_name = reference_bzrdir_format.get_branch_format().network_name()
551
542
        client.add_success_response_with_body(
552
543
            bencode.bencode({
854
845
        transport = transport.clone('quack')
855
846
        self.make_repository('quack')
856
847
        client = FakeClient(transport.base)
857
 
        reference_bzrdir_format = bzrdir.format_registry.get('default')()
 
848
        reference_bzrdir_format = controldir.format_registry.get('default')()
858
849
        reference_format = reference_bzrdir_format.get_branch_format()
859
850
        network_name = reference_format.network_name()
860
851
        reference_repo_fmt = reference_bzrdir_format.repository_format
882
873
        # Client's medium rooted a transport root (not at the bzrdir)
883
874
        client = FakeClient(transport.base)
884
875
        transport = transport.clone('quack')
885
 
        reference_bzrdir_format = bzrdir.format_registry.get('default')()
 
876
        reference_bzrdir_format = controldir.format_registry.get('default')()
886
877
        reference_format = reference_bzrdir_format.get_branch_format()
887
878
        network_name = reference_format.network_name()
888
879
        reference_repo_fmt = reference_bzrdir_format.repository_format
918
909
        transport = transport.clone('quack')
919
910
        self.make_bzrdir('quack')
920
911
        client = FakeClient(transport.base)
921
 
        reference_bzrdir_format = bzrdir.format_registry.get('default')()
 
912
        reference_bzrdir_format = controldir.format_registry.get('default')()
922
913
        reference_format = reference_bzrdir_format.repository_format
923
914
        network_name = reference_format.network_name()
924
915
        client.add_expected_call(
3964
3955
        :result: The revision ids in the stream, in the order seen,
3965
3956
            the topological order of revisions in the source.
3966
3957
        """
3967
 
        unordered_format = bzrdir.format_registry.get(format)()
 
3958
        unordered_format = controldir.format_registry.get(format)()
3968
3959
        target_repository_format = unordered_format.repository_format
3969
3960
        # Cross check
3970
3961
        self.assertEqual(order, target_repository_format._fetch_order)
4273
4264
    def test_single_empty(self):
4274
4265
        transport_path = 'quack'
4275
4266
        repo, client = self.setup_fake_client_and_repository(transport_path)
4276
 
        fmt = bzrdir.format_registry.get('2a')().repository_format
 
4267
        fmt = controldir.format_registry.get('2a')().repository_format
4277
4268
        repo._format = fmt
4278
4269
        stream = [('inventory-deltas', [
4279
4270
            versionedfile.FulltextContentFactory('somerevid', None, None,