~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_merge.py

MergeĀ fromĀ jam-integration

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
from bzrlib.branch import Branch
4
4
from bzrlib.commit import commit
5
5
from bzrlib.tests import TestCaseInTempDir
6
 
from bzrlib.merge import merge, transform_tree
 
6
from bzrlib.builtins import merge
 
7
from bzrlib.merge import transform_tree
7
8
from bzrlib.errors import UnrelatedBranches, NoCommits, BzrCommandError
8
9
from bzrlib.revision import common_ancestor
9
10
from bzrlib.fetch import fetch
 
11
from bzrlib.osutils import pathjoin
10
12
 
11
13
 
12
14
class TestMerge(TestCaseInTempDir):
13
15
    """Test appending more than one revision"""
 
16
 
14
17
    def test_pending(self):
15
18
        br = Branch.initialize(u".")
16
19
        commit(br, "lala!")
51
54
        br1, br2 = self.test_pending_with_null()
52
55
        commit(br1, "blah")
53
56
        last = br1.last_revision()
54
 
        self.assertEquals(common_ancestor(last, last, br1), last)
 
57
        self.assertEquals(common_ancestor(last, last, br1.repository), last)
55
58
 
56
59
    def test_create_rename(self):
57
60
        """Rename an inventory entry while creating the file"""
70
73
        tree = b.working_tree()
71
74
        os.mkdir('dirname1')
72
75
        tree.add('dirname1')
73
 
        filename = os.path.join('dirname1', 'name1')
 
76
        filename = pathjoin('dirname1', 'name1')
74
77
        file(filename, 'wb').write('Hello')
75
78
        tree.add(filename)
76
79
        tree.commit(message="hello")
77
 
        filename2 = os.path.join('dirname1', 'name2')
 
80
        filename2 = pathjoin('dirname1', 'name2')
78
81
        tree.rename_one(filename, filename2)
79
82
        tree.rename_one('dirname1', 'dirname2')
80
83
        transform_tree(tree, b.basis_tree())