~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
        tree1.commit('1st post')
63
63
        revid = tree1.commit('2st post', allow_pointless=True)
64
64
        branch2 = self.make_branch('branch2')
65
 
        branch2.import_last_revision_info_and_tags(tree1.branch, 2, revid)
 
65
        self.assertEquals((2, revid),
 
66
            branch2.import_last_revision_info_and_tags(tree1.branch, 2, revid))
66
67
        self.assertEqual((2, revid), branch2.last_revision_info())
67
68
        self.assertTrue(branch2.repository.has_revision(revid))
68
69
 
 
70
    def test_import_lossy(self):
 
71
        # importing with lossy=True works
 
72
        tree1 = self.make_branch_and_tree('branch1')
 
73
        tree1.commit('1st post')
 
74
        revid = tree1.commit('2st post', allow_pointless=True)
 
75
        branch2 = self.make_branch('branch2')
 
76
        ret = branch2.import_last_revision_info_and_tags(tree1.branch, 2,
 
77
            revid, lossy=True)
 
78
        self.assertIsInstance(ret, tuple)
 
79
        self.assertIsInstance(ret[0], int)
 
80
        self.assertIsInstance(ret[1], str)
 
81
 
69
82
    def test_same_repo(self):
70
83
        # importing and setting last revision within the same repo
71
84
        tree = self.make_branch_and_tree('branch1')