~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_merge.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-09-06 12:20:16 UTC
  • mfrom: (1551.8.23 Aaron's mergeable stuff)
  • Revision ID: pqm@pqm.ubuntu.com-20060906122016-54ab3159023ef544
Improve conflict message for deleting directories with contents

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
import os
18
18
from StringIO import StringIO
19
19
 
 
20
from bzrlib import conflicts
20
21
from bzrlib.branch import Branch
21
22
from bzrlib.builtins import merge
22
23
from bzrlib.conflicts import ConflictList, TextConflict
148
149
        tree_a.set_conflicts(ConflictList([TextConflict('patha')]))
149
150
        merge_inner(tree_a.branch, tree_a, tree_a, this_tree=tree_a)
150
151
        self.assertEqual(1, len(tree_a.conflicts()))
 
152
 
 
153
    def test_rmdir_conflict(self):
 
154
        tree_a = self.make_branch_and_tree('a')
 
155
        self.build_tree(['a/b/'])
 
156
        tree_a.add('b', 'b-id')
 
157
        tree_a.commit('added b')
 
158
        base_tree = tree_a.basis_tree()
 
159
        tree_z = tree_a.bzrdir.sprout('z').open_workingtree()
 
160
        self.build_tree(['a/b/c'])
 
161
        tree_a.add('b/c')
 
162
        tree_a.commit('added c')
 
163
        os.rmdir('z/b')
 
164
        tree_z.commit('removed b')
 
165
        merge_inner(tree_z.branch, tree_a, base_tree, this_tree=tree_z)
 
166
        self.assertEqual([
 
167
            conflicts.MissingParent('Created directory', 'b', 'b-id'),
 
168
            conflicts.UnversionedParent('Versioned directory', 'b', 'b-id')],
 
169
            tree_z.conflicts())
 
170
        merge_inner(tree_a.branch, tree_z.basis_tree(), base_tree, 
 
171
                    this_tree=tree_a)
 
172
        self.assertEqual([
 
173
            conflicts.DeletingParent('Not deleting', 'b', 'b-id'),
 
174
            conflicts.UnversionedParent('Versioned directory', 'b', 'b-id')],
 
175
            tree_a.conflicts())