~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_commit_merge.py

[merge] up-to-date against bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
import os
19
19
import shutil
20
20
 
21
 
from bzrlib.selftest import TestCaseInTempDir
 
21
from bzrlib.tests import TestCaseInTempDir
22
22
from bzrlib.branch import Branch
23
23
from bzrlib.commit import commit
24
24
from bzrlib.errors import PointlessCommit, BzrError, PointlessCommit
25
 
from bzrlib.selftest.testrevision import make_branches
 
25
from bzrlib.tests.test_revision import make_branches
26
26
from bzrlib.fetch import fetch
27
27
from bzrlib.check import check
28
28
 
62
62
        self.assertEquals(rev.parent_ids,
63
63
                          ['y@u-0-1', 'x@u-0-1'])
64
64
 
65
 
 
66
 
 
67
65
    def test_merge_new_file(self):
68
66
        """Commit merge of two trees with no overlapping files."""
69
67
        self.build_tree(['x/', 'x/ecks', 'y/', 'y/why'])
70
68
 
71
69
        bx = Branch.initialize('x')
72
70
        by = Branch.initialize('y')
73
 
        bx.add(['ecks'], ['ecks-id'])
74
 
        by.add(['why'], ['why-id'])
 
71
        bx.working_tree().add(['ecks'], ['ecks-id'])
 
72
        by.working_tree().add(['why'], ['why-id'])
75
73
 
76
74
        commit(bx, 'commit one', rev_id='x@u-0-1', allow_pointless=True)
77
75
        commit(by, 'commit two', rev_id='y@u-0-1', allow_pointless=True)
79
77
        fetch(from_branch=bx, to_branch=by)
80
78
        # we haven't merged the texts, but let's fake it
81
79
        shutil.copyfile('x/ecks', 'y/ecks')
82
 
        by.add(['ecks'], ['ecks-id'])
 
80
        by.working_tree().add(['ecks'], ['ecks-id'])
83
81
        by.working_tree().add_pending_merge('x@u-0-1')
84
82
 
85
83
        # partial commit of merges is currently not allowed, because