~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_merge.py

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
from bzrlib.osutils import pathjoin, file_kind
37
37
from bzrlib.tests import TestCaseWithTransport, TestCaseWithMemoryTransport
38
38
from bzrlib.workingtree import WorkingTree
39
 
 
 
39
from bzrlib.transform import TreeTransform
40
40
 
41
41
class TestMerge(TestCaseWithTransport):
42
42
    """Test appending more than one revision"""
1143
1143
                'X\n'
1144
1144
                'e\n', 'test/foo')
1145
1145
 
 
1146
    def get_limbodir_deletiondir(self, wt):
 
1147
        transform = TreeTransform(wt)
 
1148
        limbodir = transform._limbodir
 
1149
        deletiondir = transform._deletiondir
 
1150
        transform.finalize()
 
1151
        return (limbodir, deletiondir)
 
1152
    
 
1153
    def test_merge_with_existing_limbo(self):
 
1154
        wt = self.make_branch_and_tree('this')
 
1155
        (limbodir, deletiondir) =  self.get_limbodir_deletiondir(wt)
 
1156
        os.mkdir(limbodir)
 
1157
        self.assertRaises(errors.ExistingLimbo, self.do_merge, wt, wt)
 
1158
        self.assertRaises(errors.LockError, wt.unlock)
 
1159
 
 
1160
    def test_merge_with_pending_deletion(self):
 
1161
        wt = self.make_branch_and_tree('this')
 
1162
        (limbodir, deletiondir) =  self.get_limbodir_deletiondir(wt)
 
1163
        os.mkdir(deletiondir)
 
1164
        self.assertRaises(errors.ExistingPendingDeletion, self.do_merge, wt, wt)
 
1165
        self.assertRaises(errors.LockError, wt.unlock)
 
1166
 
1146
1167
 
1147
1168
class TestMerge3Merge(TestCaseWithTransport, TestMergeImplementation):
1148
1169