~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

Branch now uses BzrDir reasonably sanely.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
# little as possible, so this should be used rarely if it's added at all.
22
22
# (Suggestion from j-a-meinel, 2005-11-24)
23
23
 
 
24
import codecs
24
25
from cStringIO import StringIO
25
26
import difflib
26
27
import errno
33
34
import tempfile
34
35
import unittest
35
36
import time
36
 
import codecs
 
37
 
37
38
 
38
39
import bzrlib.branch
39
40
import bzrlib.commands
729
730
 
730
731
    def make_branch(self, relpath):
731
732
        """Create a branch on the transport at relpath."""
 
733
        repo = self.make_repository(relpath)
 
734
        return repo.bzrdir.create_branch()
 
735
 
 
736
    def make_repository(self, relpath):
 
737
        """Create a repository on our default transport at relpath."""
732
738
        try:
733
739
            url = self.get_url(relpath)
734
 
            segments = relpath.split('/')
 
740
            segments = url.split('/')
735
741
            if segments and segments[-1] not in ('', '.'):
736
 
                parent = self.get_url('/'.join(segments[:-1]))
 
742
                parent = '/'.join(segments[:-1])
737
743
                t = bzrlib.transport.get_transport(parent)
738
744
                try:
739
745
                    t.mkdir(segments[-1])
740
746
                except FileExists:
741
747
                    pass
742
 
            return bzrlib.branch.Branch.create(url)
 
748
            return bzrlib.bzrdir.BzrDir.create_repository(url)
743
749
        except UninitializableFormat:
744
750
            raise TestSkipped("Format %s is not initializable.")
745
751
 
846
852
                   'bzrlib.tests.test_diff',
847
853
                   'bzrlib.tests.test_decorators',
848
854
                   'bzrlib.tests.test_fetch',
849
 
                   'bzrlib.tests.test_fileid_involved',
850
855
                   'bzrlib.tests.test_gpg',
851
856
                   'bzrlib.tests.test_graph',
852
857
                   'bzrlib.tests.test_hashcache',
863
868
                   'bzrlib.tests.test_nonascii',
864
869
                   'bzrlib.tests.test_options',
865
870
                   'bzrlib.tests.test_osutils',
866
 
                   'bzrlib.tests.test_parent',
867
871
                   'bzrlib.tests.test_permissions',
868
872
                   'bzrlib.tests.test_plugins',
869
873
                   'bzrlib.tests.test_repository',