41
41
from bzrlib.osutils import getcwd
42
42
import bzrlib.revision
43
from bzrlib.symbol_versioning import deprecated_in
43
44
from bzrlib.tests import TestCase, TestCaseWithTransport, TestSkipped
44
45
from bzrlib.tests.branch_implementations import TestCaseWithBranch
45
46
from bzrlib.tests.http_server import HttpServer
304
305
self.assertEqual(repo.get_signature_text('A'),
305
306
d2.open_repository().get_signature_text('A'))
308
def test_missing_revisions(self):
309
t1 = self.make_branch_and_tree('b1')
310
rev1 = t1.commit('one')
311
t2 = t1.bzrdir.sprout('b2').open_workingtree()
312
rev2 = t1.commit('two')
313
rev3 = t1.commit('three')
315
self.assertEqual([rev2, rev3],
316
self.applyDeprecated(deprecated_in((1, 6, 0)),
317
t2.branch.missing_revisions, t1.branch))
320
self.applyDeprecated(deprecated_in((1, 6, 0)),
321
t2.branch.missing_revisions, t1.branch, stop_revision=1))
322
self.assertEqual([rev2],
323
self.applyDeprecated(deprecated_in((1, 6, 0)),
324
t2.branch.missing_revisions, t1.branch, stop_revision=2))
325
self.assertEqual([rev2, rev3],
326
self.applyDeprecated(deprecated_in((1, 6, 0)),
327
t2.branch.missing_revisions, t1.branch, stop_revision=3))
329
self.assertRaises(errors.NoSuchRevision,
330
self.applyDeprecated, deprecated_in((1, 6, 0)),
331
t2.branch.missing_revisions, t1.branch, stop_revision=4)
333
rev4 = t2.commit('four')
334
self.assertRaises(errors.DivergedBranches,
335
self.applyDeprecated, deprecated_in((1, 6, 0)),
336
t2.branch.missing_revisions, t1.branch)
307
338
def test_nicks(self):
308
339
"""Test explicit and implicit branch nicknames.