~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_merge.py

  • Committer: Aaron Bentley
  • Date: 2005-11-26 01:23:17 UTC
  • mto: (1185.72.2 bzr.dev)
  • mto: This revision was merged to the branch mainline in revision 1518.
  • Revision ID: aaron.bentley@utoronto.ca-20051126012317-0af7f775be52b3ab
Test case when file to be renamed is also deleted

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
 
6
from bzrlib.merge import merge, transform_tree
7
7
from bzrlib.errors import UnrelatedBranches, NoCommits, BzrCommandError
8
8
from bzrlib.revision import common_ancestor
9
9
from bzrlib.fetch import fetch
52
52
        commit(br1, "blah")
53
53
        last = br1.last_revision()
54
54
        self.assertEquals(common_ancestor(last, last, br1), last)
 
55
 
 
56
    def test_create_rename(self):
 
57
        """Rename an inventory entry while creating the file"""
 
58
        b = Branch.initialize('.')
 
59
        file('name1', 'wb').write('Hello')
 
60
        tree = b.working_tree()
 
61
        tree.add('name1')
 
62
        tree.commit(message="hello")
 
63
        tree.rename_one('name1', 'name2')
 
64
        os.unlink('name2')
 
65
        transform_tree(tree, b.basis_tree())