~bzr/bzr/375898-missing-merged-root

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_workingtree/test_merge_from_branch.py

  • Committer: Vincent Ladeuil
  • Date: 2010-03-29 16:54:16 UTC
  • Revision ID: v.ladeuil+lp@free.fr-20100329165416-vbfnx484ff736gze
Commit for jam.

Show diffs side-by-side

added added

removed removed

Lines of Context:
139
139
             ('add', ('file3', 'file3-id', 'file', 'file3 content\n')),
140
140
             ])
141
141
        bld_inner.build_snapshot(
 
142
            '3', ['1'], [('modify', ('file3-id', 'new file3 contents\n')),])
 
143
        bld_inner.build_snapshot(
142
144
            '2', ['1'],
143
145
            [('add', ('dir/file2', 'file2-id', 'file', 'file2 content\n')),
144
146
             ])
146
148
        br = bld_inner.get_branch()
147
149
        return br
148
150
 
149
 
    def make_outer_branch(self):
 
151
    def make_outer_tree(self):
150
152
        outer = self.make_branch_and_tree('outer')
151
153
        self.build_tree_contents([('outer/foo', 'foo')])
152
154
        outer.add('foo', 'foo-id')
160
162
        return outer, inner
161
163
 
162
164
    def test_file_deleted_in_dir(self):
163
 
        outer, inner = self.make_outer_branch()
 
165
        outer, inner = self.make_outer_tree()
164
166
        outer.remove(['dir-outer/dir/file1'])
165
167
        outer.commit('delete file1')
166
168
        outer.merge_from_branch(inner)
169
171
 
170
172
    def test_file_deleted_in_root(self):
171
173
        # Reproduce bug #375898
172
 
        outer, inner = self.make_outer_branch()
 
174
        outer, inner = self.make_outer_tree()
173
175
        outer.remove(['dir-outer/file3'])
174
176
        outer.commit('delete file3')
175
177
        outer.merge_from_branch(inner)
176
178
        outer.commit('merge the rest')
177
179
        self.failUnlessExists('outer/dir-outer/dir/file2')
 
180
 
 
181
    def test_file_in_root_conflicted(self):
 
182
        outer, inner = self.make_outer_tree()
 
183
        outer.remove(['dir-outer/file3'])
 
184
        outer.commit('delete file3')
 
185
        import pdb; pdb.set_trace()
 
186
        nb_conflicts = outer.merge_from_branch(inner, to_revision='3')
 
187
        self.assertEqual(2, nb_conflicts)
 
188
        import pdb; pdb.set_trace()
 
189