473
473
self.assert_(os.path.exists('sub/a.txt.OTHER'))
474
474
self.assert_(os.path.exists('sub/a.txt.BASE'))
477
"""Pull changes from one branch to another."""
481
self.example_branch()
482
self.runbzr('pull', retcode=3)
483
self.runbzr('missing', retcode=3)
484
self.runbzr('missing .')
485
self.runbzr('missing')
487
self.runbzr('pull /', retcode=3)
491
self.runbzr('branch a b')
495
self.runbzr('add subdir')
496
self.runbzr('commit -m blah --unchanged')
499
b = Branch.open('../b')
500
self.assertEquals(a.revision_history(), b.revision_history()[:-1])
501
self.runbzr('pull ../b')
502
self.assertEquals(a.revision_history(), b.revision_history())
503
self.runbzr('commit -m blah2 --unchanged')
505
self.runbzr('commit -m blah3 --unchanged')
507
self.runbzr('pull ../a', retcode=3)
509
self.runbzr('branch b overwriteme')
510
os.chdir('overwriteme')
511
self.runbzr('pull --overwrite ../a')
512
overwritten = Branch.open('.')
513
self.assertEqual(overwritten.revision_history(),
514
a.revision_history())
516
self.runbzr('merge ../b')
517
self.runbzr('commit -m blah4 --unchanged')
518
os.chdir('../b/subdir')
519
self.runbzr('pull ../../a')
520
self.assertEquals(a.revision_history()[-1], b.revision_history()[-1])
521
self.runbzr('commit -m blah5 --unchanged')
522
self.runbzr('commit -m blah6 --unchanged')
524
self.runbzr('pull ../a')
526
self.runbzr('commit -m blah7 --unchanged')
527
self.runbzr('merge ../b')
528
self.runbzr('commit -m blah8 --unchanged')
529
self.runbzr('pull ../b')
530
self.runbzr('pull ../b')
532
476
def test_inventory(self):
533
477
bzr = self.runbzr
534
478
def output_equals(value, *args):
949
893
self.runbzr('commit --unchanged -m unchanged')
951
895
os.chdir('../output-branch')
952
# should be a diff as we have not pushed the tree
953
self.runbzr('diff', retcode=1)
954
self.runbzr('revert')
896
# There is no longer a difference as long as we have
897
# access to the working tree
956
898
self.runbzr('diff')
900
# But we should be missing a revision
901
self.runbzr('missing ../my-branch', retcode=1)
957
903
# diverge the branches
958
904
self.runbzr('commit --unchanged -m unchanged')
959
905
os.chdir('../my-branch')