155
155
open('foo', 'wb').write('original\n')
157
bzr('commit', '-m', 'initial commit')
157
bzr('commit -m initial_commit')
160
bzr('branch', 'a', 'b')
163
163
open('foo', 'wb').write('changed\n')
164
bzr('commit', '-m', 'later change')
164
bzr('commit -m later_change')
166
166
open('foo', 'wb').write('another\n')
167
bzr('commit', '-m', 'a third change')
167
bzr('commit -m a_third_change')
169
169
rev_history_a = get_rh(3)
173
bzr('commit', '-m', 'merge')
173
bzr('commit -m merge')
175
175
rev_history_b = get_rh(2)
177
bzr('pull', '--overwrite', '../a')
177
bzr('pull --overwrite ../a')
178
178
rev_history_b = get_rh(3)
180
180
self.assertEqual(rev_history_b, rev_history_a)
197
197
open('foo', 'wb').write('original\n')
199
bzr('commit', '-m', 'initial commit')
199
bzr('commit -m initial_commit')
202
bzr('branch', 'a', 'b')
205
205
open('foo', 'wb').write('changed\n')
206
bzr('commit', '-m', 'later change')
206
bzr('commit -m later_change')
208
208
open('foo', 'wb').write('another\n')
209
bzr('commit', '-m', 'a third change')
209
bzr('commit -m a_third_change')
211
211
rev_history_a = get_rh(3)
215
bzr('commit', '-m', 'merge')
215
bzr('commit -m merge')
217
217
rev_history_b = get_rh(2)
220
220
open('foo', 'wb').write('a fourth change\n')
221
bzr('commit', '-m', 'a fourth change')
221
bzr('commit -m a_fourth_change')
223
223
rev_history_a = get_rh(4)
225
225
# With convergence, we could just pull over the
226
226
# new change, but with --overwrite, we want to switch our history
228
bzr('pull', '--overwrite', '../a')
228
bzr('pull --overwrite ../a')
229
229
rev_history_b = get_rh(4)
231
231
self.assertEqual(rev_history_b, rev_history_a)
294
294
# Create the bundle for 'b' to pull
295
295
os.chdir('branch_a')
296
296
bundle_file = open('../bundle', 'wb')
297
bundle_file.write(self.run_bzr('bundle', '../branch_b')[0])
297
bundle_file.write(self.run_bzr('bundle ../branch_b')[0])
298
298
bundle_file.close()
300
300
os.chdir('../branch_b')
301
out, err = self.run_bzr('pull', '../bundle')
301
out, err = self.run_bzr('pull ../bundle')
302
302
self.assertEqual(out,
303
303
'Now on revision 2.\n')
304
304
self.assertEqual(err,
315
315
testament_b.as_text())
317
317
# it is legal to attempt to pull an already-merged bundle
318
out, err = self.run_bzr('pull', '../bundle')
318
out, err = self.run_bzr('pull ../bundle')
319
319
self.assertEqual(err, '')
320
320
self.assertEqual(out, 'No revisions to pull.\n')