472
472
self.assert_(os.path.exists('sub/a.txt.OTHER'))
473
473
self.assert_(os.path.exists('sub/a.txt.BASE'))
476
"""Pull changes from one branch to another."""
480
self.example_branch()
481
self.runbzr('pull', retcode=3)
482
self.runbzr('missing', retcode=3)
483
self.runbzr('missing .')
484
self.runbzr('missing')
486
self.runbzr('pull /', retcode=3)
490
self.runbzr('branch a b')
494
self.runbzr('add subdir')
495
self.runbzr('commit -m blah --unchanged')
498
b = Branch.open('../b')
499
self.assertEquals(a.revision_history(), b.revision_history()[:-1])
500
self.runbzr('pull ../b')
501
self.assertEquals(a.revision_history(), b.revision_history())
502
self.runbzr('commit -m blah2 --unchanged')
504
self.runbzr('commit -m blah3 --unchanged')
506
self.runbzr('pull ../a', retcode=3)
508
self.runbzr('branch b overwriteme')
509
os.chdir('overwriteme')
510
self.runbzr('pull --overwrite ../a')
511
overwritten = Branch.open('.')
512
self.assertEqual(overwritten.revision_history(),
513
a.revision_history())
515
self.runbzr('merge ../b')
516
self.runbzr('commit -m blah4 --unchanged')
517
os.chdir('../b/subdir')
518
self.runbzr('pull ../../a')
519
self.assertEquals(a.revision_history()[-1], b.revision_history()[-1])
520
self.runbzr('commit -m blah5 --unchanged')
521
self.runbzr('commit -m blah6 --unchanged')
523
self.runbzr('pull ../a')
525
self.runbzr('commit -m blah7 --unchanged')
526
self.runbzr('merge ../b')
527
self.runbzr('commit -m blah8 --unchanged')
528
self.runbzr('pull ../b')
529
self.runbzr('pull ../b')
531
475
def test_inventory(self):
532
476
bzr = self.runbzr
533
477
def output_equals(value, *args):
976
920
self.runbzr('commit --unchanged -m unchanged')
978
922
os.chdir('../output-branch')
979
# should be a diff as we have not pushed the tree
980
self.runbzr('diff', retcode=1)
981
self.runbzr('revert')
923
# There is no longer a difference as long as we have
924
# access to the working tree
983
925
self.runbzr('diff')
927
# But we should be missing a revision
928
self.runbzr('missing ../my-branch', retcode=1)
984
930
# diverge the branches
985
931
self.runbzr('commit --unchanged -m unchanged')
986
932
os.chdir('../my-branch')