45
from brzlib.branchfmt.fullhistory import BzrBranchFormat5
46
from brzlib.errors import (
45
from breezy.branchfmt.fullhistory import BzrBranchFormat5
46
from breezy.errors import (
48
48
NoColocatedBranchSupport,
49
49
UnknownFormatError,
50
50
UnsupportedFormatError,
52
from brzlib.tests import (
52
from breezy.tests import (
54
54
TestCaseWithMemoryTransport,
55
55
TestCaseWithTransport,
58
from brzlib.tests import(
58
from breezy.tests import(
62
from brzlib.tests.test_http import TestWithTransport_pycurl
63
from brzlib.transport import (
62
from breezy.tests.test_http import TestWithTransport_pycurl
63
from breezy.transport import (
67
from brzlib.transport.http._urllib import HttpTransport_urllib
68
from brzlib.transport.nosmart import NoSmartTransportDecorator
69
from brzlib.transport.readonly import ReadonlyTransportDecorator
70
from brzlib.repofmt import knitrepo, knitpack_repo
67
from breezy.transport.http._urllib import HttpTransport_urllib
68
from breezy.transport.nosmart import NoSmartTransportDecorator
69
from breezy.transport.readonly import ReadonlyTransportDecorator
70
from breezy.repofmt import knitrepo, knitpack_repo
73
73
class TestDefaultFormat(TestCase):
97
97
my_format_registry.register('deprecated', DeprecatedBzrDirFormat,
98
98
'Some format. Slower and unawesome and deprecated.',
100
my_format_registry.register_lazy('lazy', 'brzlib.tests.test_bzrdir',
100
my_format_registry.register_lazy('lazy', 'breezy.tests.test_bzrdir',
101
101
'DeprecatedBzrDirFormat', 'Format registered lazily',
103
103
bzrdir.register_metadir(my_format_registry, 'knit',
104
'brzlib.repofmt.knitrepo.RepositoryFormatKnit1',
104
'breezy.repofmt.knitrepo.RepositoryFormatKnit1',
105
105
'Format using knits',
107
107
my_format_registry.set_default('knit')
108
108
bzrdir.register_metadir(my_format_registry,
110
'brzlib.repofmt.knitrepo.RepositoryFormatKnit3',
110
'breezy.repofmt.knitrepo.RepositoryFormatKnit3',
111
111
'Experimental successor to knit. Use at your own risk.',
112
branch_format='brzlib.branch.BzrBranchFormat6',
112
branch_format='breezy.branch.BzrBranchFormat6',
113
113
experimental=True)
114
114
bzrdir.register_metadir(my_format_registry,
116
'brzlib.repofmt.knitrepo.RepositoryFormatKnit3',
116
'breezy.repofmt.knitrepo.RepositoryFormatKnit3',
117
117
'Experimental successor to knit. Use at your own risk.',
118
branch_format='brzlib.branch.BzrBranchFormat6', hidden=True)
118
branch_format='breezy.branch.BzrBranchFormat6', hidden=True)
119
119
my_format_registry.register('hiddendeprecated', DeprecatedBzrDirFormat,
120
120
'Old format. Slower and does not support things. ', hidden=True)
121
my_format_registry.register_lazy('hiddenlazy', 'brzlib.tests.test_bzrdir',
121
my_format_registry.register_lazy('hiddenlazy', 'breezy.tests.test_bzrdir',
122
122
'DeprecatedBzrDirFormat', 'Format registered lazily',
123
123
deprecated=True, hidden=True)
124
124
return my_format_registry
137
137
knitrepo.RepositoryFormatKnit1)
138
138
my_bzrdir = my_format_registry.make_bzrdir('branch6')
139
139
self.assertIsInstance(my_bzrdir.get_branch_format(),
140
brzlib.branch.BzrBranchFormat6)
140
breezy.branch.BzrBranchFormat6)
142
142
def test_get_help(self):
143
143
my_format_registry = self.make_format_registry()
194
194
self.assertEqual(frozenset(['deprecatedalias']), a_registry.aliases())
197
class SampleBranch(brzlib.branch.Branch):
197
class SampleBranch(breezy.branch.Branch):
198
198
"""A dummy branch for guess what, dummy use."""
200
200
def __init__(self, dir):
201
201
self.bzrdir = dir
204
class SampleRepository(brzlib.repository.Repository):
204
class SampleRepository(breezy.repository.Repository):
205
205
"""A dummy repo."""
207
207
def __init__(self, dir):
508
508
# Make stackable source branch with an unstackable repo format.
509
509
source_bzrdir = self.make_bzrdir('source')
510
510
knitpack_repo.RepositoryFormatKnitPack1().initialize(source_bzrdir)
511
source_branch = brzlib.branch.BzrBranchFormat7().initialize(
511
source_branch = breezy.branch.BzrBranchFormat7().initialize(
513
513
# Make a directory with a default stacking policy
514
514
parent_bzrdir = self.make_bzrdir('parent')
1267
1267
return _TestBzrDirFormat()
1270
class _TestBranchFormat(brzlib.branch.BranchFormat):
1270
class _TestBranchFormat(breezy.branch.BranchFormat):
1271
1271
"""Test Branch format for TestBzrDirSprout."""
1274
class _TestBranch(brzlib.branch.Branch):
1274
class _TestBranch(breezy.branch.Branch):
1275
1275
"""Test Branch implementation for TestBzrDirSprout."""
1277
1277
def __init__(self, transport, *args, **kwargs):
1371
1371
self.assertEqual('fail', err._preformatted_string)
1373
1373
def test_post_repo_init(self):
1374
from brzlib.controldir import RepoInitHookParams
1374
from breezy.controldir import RepoInitHookParams
1376
1376
bzrdir.BzrDir.hooks.install_named_hook('post_repo_init',
1377
1377
calls.append, None)