~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_merge.py

  • Committer: Martin Pool
  • Date: 2009-09-15 01:52:34 UTC
  • mfrom: (4685 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4689.
  • Revision ID: mbp@sourcefrog.net-20090915015234-lbvl4euj2z353zjl
merge trunk

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"""
284
284
        except AttributeError:
285
285
            self.fail('tried to join a path when name was None')
286
286
 
287
 
    def test_merge_uncommitted_otherbasis_ancestor_of_thisbasis(self):
 
287
 
 
288
    def test_merge_existing_limbo_or_pending_deletion(self):
288
289
        tree_a = self.make_branch_and_tree('a')
289
290
        self.build_tree(['a/file_1', 'a/file_2'])
290
291
        tree_a.add(['file_1'])
1143
1144
                'X\n'
1144
1145
                'e\n', 'test/foo')
1145
1146
 
 
1147
    def get_limbodir_deletiondir(self, wt):
 
1148
        transform = TreeTransform(wt)
 
1149
        limbodir = transform._limbodir
 
1150
        deletiondir = transform._deletiondir
 
1151
        transform.finalize()
 
1152
        return (limbodir, deletiondir)
 
1153
    
 
1154
    def test_merge_with_existing_limbo(self):
 
1155
        wt = self.make_branch_and_tree('this')
 
1156
        (limbodir, deletiondir) =  self.get_limbodir_deletiondir(wt)
 
1157
        os.mkdir(limbodir)
 
1158
        self.assertRaises(errors.ExistingLimbo, self.do_merge, wt, wt)
 
1159
        self.assertRaises(errors.LockError, wt.unlock)
 
1160
 
 
1161
    def test_merge_with_pending_deletion(self):
 
1162
        wt = self.make_branch_and_tree('this')
 
1163
        (limbodir, deletiondir) =  self.get_limbodir_deletiondir(wt)
 
1164
        os.mkdir(deletiondir)
 
1165
        self.assertRaises(errors.ExistingPendingDeletion, self.do_merge, wt, wt)
 
1166
        self.assertRaises(errors.LockError, wt.unlock)
 
1167
 
1146
1168
 
1147
1169
class TestMerge3Merge(TestCaseWithTransport, TestMergeImplementation):
1148
1170