~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_uncommit.py

MergeĀ fromĀ remote-is-at-least.

Show diffs side-by-side

added added

removed removed

Lines of Context:
173
173
        wt = self.create_simple_tree()
174
174
 
175
175
        tree2 = wt.bzrdir.sprout('tree2').open_workingtree()
176
 
 
177
176
        tree2.commit('unchanged', rev_id='b3')
178
177
 
 
178
        tree3 = wt.bzrdir.sprout('tree3').open_workingtree()
 
179
        tree3.commit('unchanged', rev_id='c3')
 
180
 
179
181
        wt.merge_from_branch(tree2.branch)
180
182
        wt.commit('merge b3', rev_id='a3')
181
183
 
182
 
        tree2.commit('unchanged', rev_id='b4')
183
 
 
184
 
        wt.merge_from_branch(tree2.branch)
185
 
        wt.commit('merge b4', rev_id='a4')
 
184
        wt.merge_from_branch(tree3.branch)
 
185
        wt.commit('merge c3', rev_id='a4')
186
186
 
187
187
        self.assertEqual(['a4'], wt.get_parent_ids())
188
188
 
189
189
        os.chdir('tree')
190
190
        out, err = self.run_bzr('uncommit --force -r 2')
191
191
 
192
 
        self.assertEqual(['a2', 'b3', 'b4'], wt.get_parent_ids())
 
192
        self.assertEqual(['a2', 'b3', 'c3'], wt.get_parent_ids())
193
193
 
194
194
    def test_uncommit_merge_plus_pending(self):
195
195
        wt = self.create_simple_tree()
196
196
 
197
197
        tree2 = wt.bzrdir.sprout('tree2').open_workingtree()
198
 
 
199
198
        tree2.commit('unchanged', rev_id='b3')
 
199
        tree3 = wt.bzrdir.sprout('tree3').open_workingtree()
 
200
        tree3.commit('unchanged', rev_id='c3')
 
201
 
200
202
        wt.branch.fetch(tree2.branch)
201
203
        wt.set_pending_merges(['b3'])
202
204
        wt.commit('merge b3', rev_id='a3')
203
205
 
204
 
        tree2.commit('unchanged', rev_id='b4')
205
 
        wt.branch.fetch(tree2.branch)
206
 
        wt.set_pending_merges(['b4'])
207
 
 
208
 
        self.assertEqual(['a3', 'b4'], wt.get_parent_ids())
 
206
 
 
207
        wt.merge_from_branch(tree3.branch)
 
208
 
 
209
        self.assertEqual(['a3', 'c3'], wt.get_parent_ids())
209
210
 
210
211
        os.chdir('tree')
211
212
        out, err = self.run_bzr('uncommit --force -r 2')
212
213
 
213
 
        self.assertEqual(['a2', 'b3', 'b4'], wt.get_parent_ids())
 
214
        self.assertEqual(['a2', 'b3', 'c3'], wt.get_parent_ids())
214
215
 
215
216
    def test_uncommit_octopus_merge(self):
216
217
        # Check that uncommit keeps the pending merges in the same order
 
218
        # though it will also filter out ones in the ancestry
217
219
        wt = self.create_simple_tree()
218
220
 
219
221
        tree2 = wt.bzrdir.sprout('tree2').open_workingtree()
238
240
        os.chdir('tree')
239
241
        out, err = self.run_bzr('uncommit --force -r 2')
240
242
 
241
 
        self.assertEqual(['a2', 'b3', 'c3', 'c4', 'b4'], wt.get_parent_ids())
 
243
        self.assertEqual(['a2', 'c4', 'b4'], wt.get_parent_ids())
242
244
 
243
245
    def test_uncommit_nonascii(self):
244
246
        tree = self.make_branch_and_tree('tree')