~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

first cut at merge from integration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
import sys
42
42
 
43
43
from bzrlib.branch import Branch
44
 
from bzrlib.clone import copy_branch
45
44
from bzrlib.errors import BzrCommandError
46
45
from bzrlib.osutils import has_symlinks, pathjoin
47
46
from bzrlib.tests.HTTPTestUtil import TestCaseWithWebserver
49
48
from bzrlib.tests.blackbox import ExternalBase
50
49
from bzrlib.workingtree import WorkingTree
51
50
 
 
51
 
52
52
class TestCommands(ExternalBase):
53
53
 
54
54
    def test_help_commands(self):
394
394
        # Merging a branch pulls its revision into the tree
395
395
        a = Branch.open('.')
396
396
        b = Branch.open('../b')
397
 
        a.get_revision_xml(b.last_revision())
 
397
        a.repository.get_revision_xml(b.last_revision())
398
398
        self.log('pending merges: %s', a.working_tree().pending_merges())
399
399
        self.assertEquals(a.working_tree().pending_merges(),
400
400
                          [b.last_revision()])
553
553
                  'subdir/b\n'
554
554
                  , '--versioned')
555
555
 
 
556
    def test_cat(self):
 
557
        self.runbzr('init')
 
558
        file("myfile", "wb").write("My contents\n")
 
559
        self.runbzr('add')
 
560
        self.runbzr('commit -m myfile')
 
561
        self.run_bzr_captured('cat -r 1 myfile'.split(' '))
 
562
 
556
563
    def test_pull_verbose(self):
557
564
        """Pull changes from one branch to another and watch the output."""
558
565
 
778
785
        self.runbzr('commit -m done',)
779
786
        self.runbzr('remerge', retcode=3)
780
787
 
 
788
    def test_status(self):
 
789
        os.mkdir('branch1')
 
790
        os.chdir('branch1')
 
791
        self.runbzr('init')
 
792
        self.runbzr('commit --unchanged --message f')
 
793
        self.runbzr('branch . ../branch2')
 
794
        self.runbzr('branch . ../branch3')
 
795
        self.runbzr('commit --unchanged --message peter')
 
796
        os.chdir('../branch2')
 
797
        self.runbzr('merge ../branch1')
 
798
        self.runbzr('commit --unchanged --message pumpkin')
 
799
        os.chdir('../branch3')
 
800
        self.runbzr('merge ../branch2')
 
801
        message = self.capture('status')
 
802
 
781
803
 
782
804
    def test_conflicts(self):
783
805
        """Handling of merge conflicts"""
820
842
            from bzrlib.testament import Testament
821
843
            bzrlib.gpg.GPGStrategy = bzrlib.gpg.LoopbackGPGStrategy
822
844
            self.runbzr('re-sign -r revid:A')
823
 
            self.assertEqual(Testament.from_revision(branch,'A').as_short_text(),
824
 
                             branch.revision_store.get('A', 'sig').read())
 
845
            self.assertEqual(Testament.from_revision(branch.repository,
 
846
                             'A').as_short_text(),
 
847
                             branch.repository.revision_store.get('A', 
 
848
                             'sig').read())
825
849
        finally:
826
850
            bzrlib.gpg.GPGStrategy = oldstrategy
827
851
            
838
862
            from bzrlib.testament import Testament
839
863
            bzrlib.gpg.GPGStrategy = bzrlib.gpg.LoopbackGPGStrategy
840
864
            self.runbzr('re-sign -r 1..')
841
 
            self.assertEqual(Testament.from_revision(branch,'A').as_short_text(),
842
 
                             branch.revision_store.get('A', 'sig').read())
843
 
            self.assertEqual(Testament.from_revision(branch,'B').as_short_text(),
844
 
                             branch.revision_store.get('B', 'sig').read())
845
 
            self.assertEqual(Testament.from_revision(branch,'C').as_short_text(),
846
 
                             branch.revision_store.get('C', 'sig').read())
 
865
            self.assertEqual(
 
866
                Testament.from_revision(branch.repository,'A').as_short_text(),
 
867
                branch.repository.revision_store.get('A', 'sig').read())
 
868
            self.assertEqual(
 
869
                Testament.from_revision(branch.repository,'B').as_short_text(),
 
870
                branch.repository.revision_store.get('B', 'sig').read())
 
871
            self.assertEqual(Testament.from_revision(branch.repository,
 
872
                             'C').as_short_text(),
 
873
                             branch.repository.revision_store.get('C', 
 
874
                             'sig').read())
847
875
        finally:
848
876
            bzrlib.gpg.GPGStrategy = oldstrategy
849
877