223
225
self.assertEqual(rev_history_b, rev_history_a)
227
def test_pull_remember(self):
228
"""Pull changes from one branch to another and test parent location."""
232
self.example_branch()
233
self.runbzr('branch . ../b')
234
self.runbzr('branch . ../c')
235
file('bottles', 'wt').write('99 bottles of beer on the wall')
236
self.runbzr('add bottles')
237
self.runbzr('commit -m 99_bottles')
240
parent = b.get_parent()
243
self.assertEqual(None, b.get_parent())
244
# test pull for failure without parent set
245
out = self.runbzr('pull', retcode=3)
246
self.assertEquals(out,
247
('','bzr: ERROR: No pull location known or specified.\n'))
248
# test implicit --remember when no parent set, this pull conflicts
249
file('bottles', 'wt').write('98 bottles of beer on the wall')
250
self.runbzr('add bottles')
251
self.runbzr('commit -m 98_bottles')
252
out = self.runbzr('pull ../a', retcode=3)
253
self.assertEquals(out,
254
('','bzr: ERROR: These branches have diverged. Try merge.\n'))
255
self.assertEquals(abspath(b.get_parent()), abspath(parent))
256
# test implicit --remember after resolving previous failure
257
self.runbzr('uncommit --force')
259
self.assertEquals(abspath(b.get_parent()), abspath(parent))
260
# test explicit --remember
261
self.runbzr('pull ../c --remember')
262
self.assertEquals(abspath(b.get_parent()), abspath('../c'))