~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/branch_implementations/test_branch.py

MergeĀ fromĀ remote-is-at-least.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
                           )
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'))
306
307
 
 
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')
 
314
 
 
315
        self.assertEqual([rev2, rev3],
 
316
            self.applyDeprecated(deprecated_in((1, 6, 0)),
 
317
            t2.branch.missing_revisions, t1.branch))
 
318
 
 
319
        self.assertEqual([],
 
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))
 
328
 
 
329
        self.assertRaises(errors.NoSuchRevision,
 
330
            self.applyDeprecated, deprecated_in((1, 6, 0)),
 
331
            t2.branch.missing_revisions, t1.branch, stop_revision=4)
 
332
 
 
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)
 
337
 
307
338
    def test_nicks(self):
308
339
        """Test explicit and implicit branch nicknames.
309
340