~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_merge.py

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
        os.mkdir('a')
53
53
        os.chdir('a')
54
54
        self.example_branch()
 
55
        ancestor = Branch.open('.').revno()
55
56
        os.chdir('..')
56
57
        self.runbzr('branch a b')
57
58
        os.chdir('b')
79
80
        b_tip = b.last_revision()
80
81
        self.failUnless(a.branch.repository.has_revision(b_tip))
81
82
        self.assertEqual([a_tip, b_tip], a.get_parent_ids())
 
83
        self.runbzr('revert --no-backup')
 
84
        out, err = self.runbzr('merge -r revno:1:./hello', retcode=3)
 
85
        self.assertTrue("Not a branch" in err)
 
86
        self.runbzr('merge -r revno:%d:./..revno:%d:../b'
 
87
                    %(ancestor,b.revno()))
 
88
        self.assertEquals(a.get_parent_ids(), 
 
89
                          [a.branch.last_revision(), b.last_revision()])
 
90
        self.check_file_contents('goodbye', 'quux')
 
91
        self.runbzr('revert --no-backup')
 
92
        self.runbzr('merge -r revno:%d:../b'%b.revno())
 
93
        self.assertEquals(a.get_parent_ids(),
 
94
                          [a.branch.last_revision(), b.last_revision()])
82
95
        a_tip = a.commit('merged')
83
96
        self.runbzr('merge ../b -r last:1')
84
97
        self.assertEqual([a_tip], a.get_parent_ids())
194
207
        file('../bundle', 'wb').write(self.runbzr('bundle ../branch_a')[0])
195
208
        os.chdir('../branch_a')
196
209
        self.runbzr('merge ../bundle', retcode=1)
197
 
        testament_a = Testament.from_revision(tree_a.branch.repository, 
198
 
                                              tree_b.last_revision())
 
210
        testament_a = Testament.from_revision(tree_a.branch.repository,
 
211
                                              tree_b.get_parent_ids()[0])
199
212
        testament_b = Testament.from_revision(tree_b.branch.repository,
200
 
                                              tree_b.last_revision())
 
213
                                              tree_b.get_parent_ids()[0])
201
214
        self.assertEqualDiff(testament_a.as_text(),
202
215
                         testament_b.as_text())
203
216
        tree_a.set_conflicts(ConflictList())