/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/workingtree_implementations/test_merge_from_branch.py

  • Committer: Robert Collins
  • Date: 2007-07-04 08:08:13 UTC
  • mfrom: (2572 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2587.
  • Revision ID: robertc@robertcollins.net-20070704080813-wzebx0r88fvwj5rq
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
"""Tests for the WorkingTree.merge_from_branch api."""
19
19
 
 
20
import os
 
21
 
 
22
from bzrlib import errors
20
23
from bzrlib.tests.workingtree_implementations import TestCaseWithWorkingTree
21
24
 
22
25
 
49
52
            to_revision=self.second_rev)
50
53
        self.assertEqual([self.to_second_rev, self.second_rev],
51
54
            self.tree_to.get_parent_ids())
 
55
 
 
56
    def test_compare_after_merge(self):
 
57
        tree_a = self.make_branch_and_tree('tree_a')
 
58
        self.build_tree_contents([('tree_a/file', 'text-a')])
 
59
        tree_a.add('file')
 
60
        tree_a.commit('added file')
 
61
        tree_b = tree_a.bzrdir.sprout('tree_b').open_workingtree()
 
62
        os.unlink('tree_a/file')
 
63
        tree_a.commit('deleted file')
 
64
        self.build_tree_contents([('tree_b/file', 'text-b')])
 
65
        tree_b.commit('changed file')
 
66
        tree_a.merge_from_branch(tree_b.branch)
 
67
        tree_a.lock_read()
 
68
        self.addCleanup(tree_a.unlock)
 
69
        list(tree_a._iter_changes(tree_a.basis_tree()))
 
70
 
 
71
    def test_merge_empty(self):
 
72
        tree_a = self.make_branch_and_tree('tree_a')
 
73
        self.build_tree_contents([('tree_a/file', 'text-a')])
 
74
        tree_a.add('file')
 
75
        tree_a.commit('added file')
 
76
        tree_b = self.make_branch_and_tree('treeb')
 
77
        self.assertRaises(errors.NoCommits, tree_a.merge_from_branch,
 
78
                          tree_b.branch)
 
79
        tree_b.merge_from_branch(tree_a.branch)