50
50
UnsupportedFormatError,
53
from bzrlib.symbol_versioning import deprecated_in
53
54
from bzrlib.tests import TestCase, TestCaseWithTransport
54
55
from bzrlib.transport import get_transport
56
58
class TestDefaultFormat(TestCase):
58
60
def test_default_format(self):
128
130
# TODO RBC 20051029 test getting a push location from a branch in a
129
131
# recursive section - that is, it appends the branch name.
133
def test_missing_revisions(self):
134
t1 = self.make_branch_and_tree('b1', format='knit')
135
rev1 = t1.commit('one')
136
t2 = t1.bzrdir.sprout('b2').open_workingtree()
137
rev2 = t1.commit('two')
138
rev3 = t1.commit('three')
140
self.assertEqual([rev2, rev3],
141
self.applyDeprecated(deprecated_in((1, 6, 0)),
142
t2.branch.missing_revisions, t1.branch))
145
self.applyDeprecated(deprecated_in((1, 6, 0)),
146
t2.branch.missing_revisions, t1.branch, stop_revision=1))
147
self.assertEqual([rev2],
148
self.applyDeprecated(deprecated_in((1, 6, 0)),
149
t2.branch.missing_revisions, t1.branch, stop_revision=2))
150
self.assertEqual([rev2, rev3],
151
self.applyDeprecated(deprecated_in((1, 6, 0)),
152
t2.branch.missing_revisions, t1.branch, stop_revision=3))
154
self.assertRaises(errors.NoSuchRevision,
155
self.applyDeprecated, deprecated_in((1, 6, 0)),
156
t2.branch.missing_revisions, t1.branch, stop_revision=4)
158
rev4 = t2.commit('four')
159
self.assertRaises(errors.DivergedBranches,
160
self.applyDeprecated, deprecated_in((1, 6, 0)),
161
t2.branch.missing_revisions, t1.branch)
132
166
class SampleBranchFormat(BranchFormat):
133
167
"""A sample format