~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_branch/test_branch.py

  • Committer: Jelmer Vernooij
  • Date: 2011-10-14 01:48:16 UTC
  • mfrom: (6213 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6214.
  • Revision ID: jelmer@samba.org-20111014014816-q61w41x9l6jvzb07
merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
    errors,
25
25
    gpg,
26
26
    merge,
 
27
    osutils,
27
28
    urlutils,
28
29
    transport,
29
30
    remote,
434
435
        tree_a = self.make_branch_and_tree('a')
435
436
        rev_id = tree_a.commit('put some content in the branch')
436
437
        # open the branch via a readonly transport
437
 
        source_branch = _mod_branch.Branch.open(self.get_readonly_url('a'))
 
438
        source_branch = _mod_branch.Branch.open(self.get_readonly_url(
 
439
            urlutils.basename(tree_a.branch.base)))
438
440
        # sanity check that the test will be valid
439
441
        self.assertRaises((errors.LockError, errors.TransportNotPossible),
440
442
            source_branch.lock_write)
446
448
        tree_a = self.make_branch_and_tree('a')
447
449
        rev_id = tree_a.commit('put some content in the branch')
448
450
        # open the branch via a readonly transport
449
 
        url = self.get_readonly_url('a')
 
451
        url = self.get_readonly_url(
 
452
            osutils.basename(tree_a.branch.base.rstrip('/')))
450
453
        t = transport.get_transport_from_url(url)
451
454
        if not tree_a.branch.bzrdir._format.supports_transport(t):
452
455
            raise tests.TestNotApplicable("format does not support transport")
868
871
            tree.add_reference(subtree)
869
872
        except errors.UnsupportedOperation:
870
873
            raise tests.TestNotApplicable('Tree cannot hold references.')
871
 
        reference_parent = tree.branch.reference_parent('subtree-id',
872
 
                                                        'subtree')
 
874
        reference_parent = tree.branch.reference_parent(
 
875
            'subtree-id',
 
876
            urlutils.relative_url(tree.branch.user_url, subtree.branch.user_url))
873
877
        self.assertEqual(subtree.branch.base, reference_parent.base)
874
878
 
875
879
    def test_reference_parent_accepts_possible_transports(self):
881
885
        except errors.UnsupportedOperation:
882
886
            raise tests.TestNotApplicable('Tree cannot hold references.')
883
887
        reference_parent = tree.branch.reference_parent('subtree-id',
884
 
            'subtree', possible_transports=[subtree.bzrdir.root_transport])
 
888
            urlutils.relative_url(
 
889
                tree.branch.user_url, subtree.branch.user_url),
 
890
            possible_transports=[subtree.bzrdir.root_transport])
885
891
 
886
892
    def test_get_reference_info(self):
887
893
        branch = self.make_branch('branch')