~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

MergeĀ fromĀ jam-integration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
from bzrlib.tests.HTTPTestUtil import TestCaseWithWebserver
47
47
from bzrlib.tests.test_sftp_transport import TestCaseWithSFTPServer
48
48
from bzrlib.tests.blackbox import ExternalBase
 
49
from bzrlib.workingtree import WorkingTree
49
50
 
50
51
 
51
52
class TestCommands(ExternalBase):
164
165
        self.runbzr('commit -m newstuff branch', retcode=3)
165
166
 
166
167
    def test_ignore_patterns(self):
167
 
        from bzrlib.branch import Branch
168
 
        Branch.initialize('.')
 
168
        self.runbzr('init')
169
169
        self.assertEquals(self.capture('unknowns'), '')
170
170
 
171
171
        file('foo.tmp', 'wt').write('tmp files are ignored')
259
259
 
260
260
    def test_mv_modes(self):
261
261
        """Test two modes of operation for mv"""
262
 
        from bzrlib.branch import Branch
263
 
        b = Branch.initialize('.')
 
262
        self.runbzr('init')
264
263
        self.build_tree(['a', 'c', 'subdir/'])
265
264
        self.run_bzr_captured(['add', self.test_dir])
266
265
        self.run_bzr_captured(['mv', 'a', 'b'])
633
632
        
634
633
    def test_add_reports(self):
635
634
        """add command prints the names of added files."""
636
 
        b = Branch.initialize('.')
 
635
        self.runbzr('init')
637
636
        self.build_tree(['top.txt', 'dir/', 'dir/sub.txt', 'CVS'])
638
637
        out = self.run_bzr_captured(['add'], retcode=0)[0]
639
638
        # the ordering is not defined at the moment
654
653
 
655
654
    def test_add_quiet_is(self):
656
655
        """add -q does not print the names of added files."""
657
 
        b = Branch.initialize('.')
 
656
        self.runbzr('init')
658
657
        self.build_tree(['top.txt', 'dir/', 'dir/sub.txt'])
659
658
        out = self.run_bzr_captured(['add', '-q'], retcode=0)[0]
660
659
        # the ordering is not defined at the moment
666
665
 
667
666
        "bzr add" should add the parent(s) as necessary.
668
667
        """
669
 
        from bzrlib.branch import Branch
670
 
        Branch.initialize('.')
 
668
        self.runbzr('init')
671
669
        self.build_tree(['inertiatic/', 'inertiatic/esp'])
672
670
        self.assertEquals(self.capture('unknowns'), 'inertiatic\n')
673
671
        self.run_bzr('add', 'inertiatic/esp')
690
688
 
691
689
        "bzr add" should do this happily.
692
690
        """
693
 
        from bzrlib.branch import Branch
694
 
        Branch.initialize('.')
 
691
        self.runbzr('init')
695
692
        self.build_tree(['inertiatic/', 'inertiatic/esp'])
696
693
        self.assertEquals(self.capture('unknowns'), 'inertiatic\n')
697
694
        self.run_bzr('add', '--no-recurse', 'inertiatic')
701
698
 
702
699
    def test_subdir_add(self):
703
700
        """Add in subdirectory should add only things from there down"""
704
 
        from bzrlib.branch import Branch
 
701
        from bzrlib.workingtree import WorkingTree
705
702
        
706
703
        eq = self.assertEqual
707
704
        ass = self.assert_
708
705
        chdir = os.chdir
709
706
        
710
 
        b = Branch.initialize('.')
711
 
        t = b.working_tree()
 
707
        t = WorkingTree.create_standalone('.')
 
708
        b = t.branch
712
709
        self.build_tree(['src/', 'README'])
713
710
        
714
711
        eq(sorted(t.unknowns()),
837
834
        """Test re signing of data."""
838
835
        import bzrlib.gpg
839
836
        oldstrategy = bzrlib.gpg.GPGStrategy
840
 
        branch = Branch.initialize('.')
841
 
        branch.working_tree().commit("base", allow_pointless=True, rev_id='A')
 
837
        wt = WorkingTree.create_standalone('.')
 
838
        branch = wt.branch
 
839
        wt.commit("base", allow_pointless=True, rev_id='A')
842
840
        try:
843
841
            # monkey patch gpg signing mechanism
844
842
            from bzrlib.testament import Testament
854
852
    def test_resign_range(self):
855
853
        import bzrlib.gpg
856
854
        oldstrategy = bzrlib.gpg.GPGStrategy
857
 
        branch = Branch.initialize('.')
858
 
        branch.working_tree().commit("base", allow_pointless=True, rev_id='A')
859
 
        branch.working_tree().commit("base", allow_pointless=True, rev_id='B')
860
 
        branch.working_tree().commit("base", allow_pointless=True, rev_id='C')
 
855
        wt = WorkingTree.create_standalone('.')
 
856
        branch = wt.branch
 
857
        wt.commit("base", allow_pointless=True, rev_id='A')
 
858
        wt.commit("base", allow_pointless=True, rev_id='B')
 
859
        wt.commit("base", allow_pointless=True, rev_id='C')
861
860
        try:
862
861
            # monkey patch gpg signing mechanism
863
862
            from bzrlib.testament import Testament
1256
1255
 
1257
1256
    def test_branch(self):
1258
1257
        os.mkdir('from')
1259
 
        branch = Branch.initialize('from')
1260
 
        branch.working_tree().commit('empty commit for nonsense', allow_pointless=True)
 
1258
        wt = WorkingTree.create_standalone('from')
 
1259
        branch = wt.branch
 
1260
        wt.commit('empty commit for nonsense', allow_pointless=True)
1261
1261
        url = self.get_remote_url('from')
1262
1262
        self.run_bzr('branch', url, 'to')
1263
1263
        branch = Branch.open('to')
1265
1265
 
1266
1266
    def test_log(self):
1267
1267
        self.build_tree(['branch/', 'branch/file'])
1268
 
        branch = Branch.initialize('branch')
1269
 
        branch.working_tree().add(['file'])
1270
 
        branch.working_tree().commit('add file', rev_id='A')
 
1268
        self.capture('init branch')
 
1269
        self.capture('add branch/file')
 
1270
        self.capture('commit -m foo branch')
1271
1271
        url = self.get_remote_url('branch/file')
1272
1272
        output = self.capture('log %s' % url)
1273
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')
1282
1274
        
1283
1275
    def test_check(self):
1284
1276
        self.build_tree(['branch/', 'branch/file'])
1285
 
        branch = Branch.initialize('branch')
1286
 
        branch.working_tree().add(['file'])
1287
 
        branch.working_tree().commit('add file', rev_id='A')
 
1277
        self.capture('init branch')
 
1278
        self.capture('add branch/file')
 
1279
        self.capture('commit -m foo branch')
1288
1280
        url = self.get_remote_url('branch/')
1289
1281
        self.run_bzr('check', url)
1290
1282