~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

merge from mbp.

Show diffs side-by-side

added added

removed removed

Lines of Context:
473
473
        self.assert_(os.path.exists('sub/a.txt.OTHER'))
474
474
        self.assert_(os.path.exists('sub/a.txt.BASE'))
475
475
 
476
 
    def test_pull(self):
477
 
        """Pull changes from one branch to another."""
478
 
        os.mkdir('a')
479
 
        os.chdir('a')
480
 
 
481
 
        self.example_branch()
482
 
        self.runbzr('pull', retcode=3)
483
 
        self.runbzr('missing', retcode=3)
484
 
        self.runbzr('missing .')
485
 
        self.runbzr('missing')
486
 
        self.runbzr('pull')
487
 
        self.runbzr('pull /', retcode=3)
488
 
        self.runbzr('pull')
489
 
 
490
 
        os.chdir('..')
491
 
        self.runbzr('branch a b')
492
 
        os.chdir('b')
493
 
        self.runbzr('pull')
494
 
        os.mkdir('subdir')
495
 
        self.runbzr('add subdir')
496
 
        self.runbzr('commit -m blah --unchanged')
497
 
        os.chdir('../a')
498
 
        a = Branch.open('.')
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')
504
 
        os.chdir('../b')
505
 
        self.runbzr('commit -m blah3 --unchanged')
506
 
        # no overwrite
507
 
        self.runbzr('pull ../a', retcode=3)
508
 
        os.chdir('..')
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())
515
 
        os.chdir('../a')
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')
523
 
        os.chdir('..')
524
 
        self.runbzr('pull ../a')
525
 
        os.chdir('../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')
531
 
 
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')
950
894
 
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')
955
 
        # but not now.
 
896
        # There is no longer a difference as long as we have
 
897
        # access to the working tree
956
898
        self.runbzr('diff')
 
899
 
 
900
        # But we should be missing a revision
 
901
        self.runbzr('missing ../my-branch', retcode=1)
 
902
 
957
903
        # diverge the branches
958
904
        self.runbzr('commit --unchanged -m unchanged')
959
905
        os.chdir('../my-branch')