~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_branch/test_last_revision_info.py

(vila) Fix bzrlib.tests.test_gpg.TestVerify.test_verify_revoked_signature
 with recent versions of gpg. (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
        tree1.commit('1st post')
41
41
        revid = tree1.commit('2st post', allow_pointless=True)
42
42
        branch2 = self.make_branch('branch2')
43
 
        branch2.import_last_revision_info(tree1.branch.repository, 2, revid)
 
43
        self.assertEquals((2, revid),
 
44
            branch2.import_last_revision_info_and_tags(tree1.branch, 2, revid))
44
45
        self.assertEqual((2, revid), branch2.last_revision_info())
45
46
        self.assertTrue(branch2.repository.has_revision(revid))
46
47
 
 
48
    def test_import_lossy(self):
 
49
        # importing with lossy=True works
 
50
        tree1 = self.make_branch_and_tree('branch1')
 
51
        tree1.commit('1st post')
 
52
        revid = tree1.commit('2st post', allow_pointless=True)
 
53
        branch2 = self.make_branch('branch2')
 
54
        ret = branch2.import_last_revision_info_and_tags(tree1.branch, 2,
 
55
            revid, lossy=True)
 
56
        self.assertIsInstance(ret, tuple)
 
57
        self.assertIsInstance(ret[0], int)
 
58
        self.assertIsInstance(ret[1], str)
 
59
 
47
60
    def test_same_repo(self):
48
61
        # importing and setting last revision within the same repo
49
62
        tree = self.make_branch_and_tree('branch1')
50
63
        tree.commit('1st post')
51
64
        revid = tree.commit('2st post', allow_pointless=True)
52
65
        tree.branch.set_last_revision_info(0, NULL_REVISION)
53
 
        tree.branch.import_last_revision_info(tree.branch.repository, 2, revid)
 
66
        tree.branch.import_last_revision_info_and_tags(tree.branch, 2, revid)
54
67
        self.assertEqual((2, revid), tree.branch.last_revision_info())