24
24
rather than in tests/branch_implementations/*.py.
27
31
from bzrlib.branch import (BranchFormat,
28
32
BranchTestProviderAdapter,
35
from bzrlib.remote import RemoteBranchFormat, RemoteBzrDirFormat
31
36
from bzrlib.smart.server import (
32
37
SmartTCPServer_for_testing,
33
38
ReadonlySmartTCPServer_for_testing,
35
from bzrlib.tests import (
40
from bzrlib.remote import RemoteBranchFormat, RemoteBzrDirFormat
40
from bzrlib.tests.bzrdir_implementations.test_bzrdir import TestCaseWithBzrDir
41
41
from bzrlib.transport.memory import MemoryServer
44
class TestCaseWithBranch(TestCaseWithBzrDir):
45
"""This helper will be adapted for each branch_implementation test."""
48
super(TestCaseWithBranch, self).setUp()
52
if self.branch is None:
53
self.branch = self.make_branch('')
56
def make_branch(self, relpath, format=None):
57
repo = self.make_repository(relpath, format=format)
58
# fixme RBC 20060210 this isnt necessarily a fixable thing,
59
# Skipped is the wrong exception to raise.
61
return self.branch_format.initialize(repo.bzrdir)
62
except errors.UninitializableFormat:
63
raise tests.TestSkipped('Uninitializable branch format')
65
def make_repository(self, relpath, shared=False, format=None):
66
made_control = self.make_bzrdir(relpath, format=format)
67
return made_control.create_repository(shared=shared)
69
def create_tree_with_merge(self):
70
"""Create a branch with a simple ancestry.
72
The graph should look like:
74
"rev-1" -> "rev-2" -> "rev-3";
75
"rev-1" -> "rev-1.1.1" -> "rev-3";
85
tree = self.make_branch_and_memory_tree('tree')
89
tree.commit('first', rev_id='rev-1')
90
tree.commit('second', rev_id='rev-1.1.1')
91
# Uncommit that last commit and switch to the other line
92
tree.branch.set_last_revision_info(1, 'rev-1')
93
tree.set_parent_ids(['rev-1'])
94
tree.commit('alt-second', rev_id='rev-2')
95
tree.set_parent_ids(['rev-2', 'rev-1.1.1'])
96
tree.commit('third', rev_id='rev-3')
104
result = tests.TestSuite()
46
105
test_branch_implementations = [
47
106
'bzrlib.tests.branch_implementations.test_bound_sftp',
48
107
'bzrlib.tests.branch_implementations.test_branch',
49
108
'bzrlib.tests.branch_implementations.test_break_lock',
50
109
'bzrlib.tests.branch_implementations.test_create_checkout',
51
110
'bzrlib.tests.branch_implementations.test_commit',
111
'bzrlib.tests.branch_implementations.test_get_revision_id_to_revno_map',
52
112
'bzrlib.tests.branch_implementations.test_hooks',
53
113
'bzrlib.tests.branch_implementations.test_http',
54
114
'bzrlib.tests.branch_implementations.test_last_revision_info',
58
118
'bzrlib.tests.branch_implementations.test_pull',
59
119
'bzrlib.tests.branch_implementations.test_push',
60
120
'bzrlib.tests.branch_implementations.test_revision_history',
121
'bzrlib.tests.branch_implementations.test_revision_id_to_revno',
61
122
'bzrlib.tests.branch_implementations.test_tags',
62
123
'bzrlib.tests.branch_implementations.test_uncommit',
63
124
'bzrlib.tests.branch_implementations.test_update',