~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Martin Pool
  • Date: 2006-01-30 06:23:50 UTC
  • mfrom: (1534.1.17 integration)
  • Revision ID: mbp@sourcefrog.net-20060130062350-d6f25277ddcdfd79
[merge] robert's integration of much recent work

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
48
47
from bzrlib.tests.test_sftp_transport import TestCaseWithSFTPServer
49
48
from bzrlib.tests.blackbox import ExternalBase
50
49
 
 
50
 
51
51
class TestCommands(ExternalBase):
52
52
 
53
53
    def test_help_commands(self):
395
395
        # Merging a branch pulls its revision into the tree
396
396
        a = Branch.open('.')
397
397
        b = Branch.open('../b')
398
 
        a.get_revision_xml(b.last_revision())
 
398
        a.repository.get_revision_xml(b.last_revision())
399
399
        self.log('pending merges: %s', a.working_tree().pending_merges())
400
400
        self.assertEquals(a.working_tree().pending_merges(),
401
401
                          [b.last_revision()])
554
554
                  'subdir/b\n'
555
555
                  , '--versioned')
556
556
 
 
557
    def test_cat(self):
 
558
        self.runbzr('init')
 
559
        file("myfile", "wb").write("My contents\n")
 
560
        self.runbzr('add')
 
561
        self.runbzr('commit -m myfile')
 
562
        self.run_bzr_captured('cat -r 1 myfile'.split(' '))
 
563
 
557
564
    def test_pull_verbose(self):
558
565
        """Pull changes from one branch to another and watch the output."""
559
566
 
781
788
        self.runbzr('commit -m done',)
782
789
        self.runbzr('remerge', retcode=3)
783
790
 
 
791
    def test_status(self):
 
792
        os.mkdir('branch1')
 
793
        os.chdir('branch1')
 
794
        self.runbzr('init')
 
795
        self.runbzr('commit --unchanged --message f')
 
796
        self.runbzr('branch . ../branch2')
 
797
        self.runbzr('branch . ../branch3')
 
798
        self.runbzr('commit --unchanged --message peter')
 
799
        os.chdir('../branch2')
 
800
        self.runbzr('merge ../branch1')
 
801
        self.runbzr('commit --unchanged --message pumpkin')
 
802
        os.chdir('../branch3')
 
803
        self.runbzr('merge ../branch2')
 
804
        message = self.capture('status')
 
805
 
784
806
 
785
807
    def test_conflicts(self):
786
808
        """Handling of merge conflicts"""
822
844
            from bzrlib.testament import Testament
823
845
            bzrlib.gpg.GPGStrategy = bzrlib.gpg.LoopbackGPGStrategy
824
846
            self.runbzr('re-sign -r revid:A')
825
 
            self.assertEqual(Testament.from_revision(branch,'A').as_short_text(),
826
 
                             branch.revision_store.get('A', 'sig').read())
 
847
            self.assertEqual(Testament.from_revision(branch.repository,
 
848
                             'A').as_short_text(),
 
849
                             branch.repository.revision_store.get('A', 
 
850
                             'sig').read())
827
851
        finally:
828
852
            bzrlib.gpg.GPGStrategy = oldstrategy
829
853
            
839
863
            from bzrlib.testament import Testament
840
864
            bzrlib.gpg.GPGStrategy = bzrlib.gpg.LoopbackGPGStrategy
841
865
            self.runbzr('re-sign -r 1..')
842
 
            self.assertEqual(Testament.from_revision(branch,'A').as_short_text(),
843
 
                             branch.revision_store.get('A', 'sig').read())
844
 
            self.assertEqual(Testament.from_revision(branch,'B').as_short_text(),
845
 
                             branch.revision_store.get('B', 'sig').read())
846
 
            self.assertEqual(Testament.from_revision(branch,'C').as_short_text(),
847
 
                             branch.revision_store.get('C', 'sig').read())
 
866
            self.assertEqual(
 
867
                Testament.from_revision(branch.repository,'A').as_short_text(),
 
868
                branch.repository.revision_store.get('A', 'sig').read())
 
869
            self.assertEqual(
 
870
                Testament.from_revision(branch.repository,'B').as_short_text(),
 
871
                branch.repository.revision_store.get('B', 'sig').read())
 
872
            self.assertEqual(Testament.from_revision(branch.repository,
 
873
                             'C').as_short_text(),
 
874
                             branch.repository.revision_store.get('C', 
 
875
                             'sig').read())
848
876
        finally:
849
877
            bzrlib.gpg.GPGStrategy = oldstrategy
850
878
 
1243
1271
        url = self.get_remote_url('branch/file')
1244
1272
        output = self.capture('log %s' % url)
1245
1273
        self.assertEqual(8, len(output.split('\n')))
 
1274
        # FIXME: rbc 20051128 what is the remainder of this test testing?
 
1275
        # - it does not seem to be http specific.
 
1276
        copy = branch.clone('branch2')
 
1277
        branch.working_tree().commit(message='empty commit')
 
1278
        os.chdir('branch2')
 
1279
        self.run_bzr('merge', '../branch')
 
1280
        copy.working_tree().commit(message='merge')
 
1281
        output = self.capture('log')
1246
1282
        
1247
1283
    def test_check(self):
1248
1284
        self.build_tree(['branch/', 'branch/file'])