~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

[merge] win32

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
from bzrlib.branch import Branch
40
40
from bzrlib.clone import copy_branch
41
41
from bzrlib.errors import BzrCommandError
42
 
from bzrlib.osutils import has_symlinks
 
42
from bzrlib.osutils import has_symlinks, pathjoin
43
43
from bzrlib.tests.HTTPTestUtil import TestCaseWithWebserver
44
44
from bzrlib.tests.blackbox import ExternalBase
45
45
 
211
211
        os.rmdir('revertdir')
212
212
        self.runbzr('revert')
213
213
 
214
 
        os.symlink('/unlikely/to/exist', 'symlink')
215
 
        self.runbzr('add symlink')
216
 
        self.runbzr('commit -m f')
217
 
        os.unlink('symlink')
218
 
        self.runbzr('revert')
219
 
        self.failUnlessExists('symlink')
220
 
        os.unlink('symlink')
221
 
        os.symlink('a-different-path', 'symlink')
222
 
        self.runbzr('revert')
223
 
        self.assertEqual('/unlikely/to/exist',
224
 
                         os.readlink('symlink'))
 
214
        if has_symlinks():
 
215
            os.symlink('/unlikely/to/exist', 'symlink')
 
216
            self.runbzr('add symlink')
 
217
            self.runbzr('commit -m f')
 
218
            os.unlink('symlink')
 
219
            self.runbzr('revert')
 
220
            self.failUnlessExists('symlink')
 
221
            os.unlink('symlink')
 
222
            os.symlink('a-different-path', 'symlink')
 
223
            self.runbzr('revert')
 
224
            self.assertEqual('/unlikely/to/exist',
 
225
                             os.readlink('symlink'))
 
226
        else:
 
227
            self.log("skipping revert symlink tests")
225
228
        
226
229
        file('hello', 'wt').write('xyz')
227
230
        self.runbzr('commit -m xyz hello')
668
671
        # the ordering is not defined at the moment
669
672
        results = sorted(out.rstrip('\n').split('\n'))
670
673
        self.assertEquals(['added dir',
671
 
                           'added dir'+os.sep+'sub.txt',
 
674
                           'added dir/sub.txt',
672
675
                           'added top.txt',],
673
676
                          results)
674
677
 
715
718
        self.build_tree(['inertiatic/', 'inertiatic/esp'])
716
719
        self.assertEquals(self.capture('unknowns'), 'inertiatic\n')
717
720
        self.run_bzr('add', '--no-recurse', 'inertiatic')
718
 
        self.assertEquals(self.capture('unknowns'), 'inertiatic'+os.sep+'esp\n')
 
721
        self.assertEquals(self.capture('unknowns'), 'inertiatic/esp\n')
719
722
        self.run_bzr('add', 'inertiatic/esp')
720
723
        self.assertEquals(self.capture('unknowns'), '')
721
724
 
994
997
        runbzr('init')
995
998
 
996
999
        self.assertEquals(capture('root').rstrip(),
997
 
                          os.path.join(self.test_dir, 'branch1'))
 
1000
                          pathjoin(self.test_dir, 'branch1'))
998
1001
 
999
1002
        progress("status of new file")
1000
1003
 
1070
1073
        runbzr("rename sub1 sub2")
1071
1074
        runbzr("move hello.txt sub2")
1072
1075
        self.assertEqual(capture("relpath sub2/hello.txt"),
1073
 
                         os.path.join("sub2", "hello.txt\n"))
 
1076
                         pathjoin("sub2", "hello.txt\n"))
1074
1077
 
1075
1078
        self.assert_(exists("sub2"))
1076
1079
        self.assert_(exists("sub2/hello.txt"))
1092
1095
 
1093
1096
        chdir('sub1/sub2')
1094
1097
        self.assertEquals(capture('root')[:-1],
1095
 
                          os.path.join(self.test_dir, 'branch1'))
 
1098
                          pathjoin(self.test_dir, 'branch1'))
1096
1099
        runbzr('move ../hello.txt .')
1097
1100
        self.assert_(exists('./hello.txt'))
1098
1101
        self.assertEquals(capture('relpath hello.txt'),
1099
 
                          os.path.join('sub1', 'sub2', 'hello.txt') + '\n')
1100
 
        self.assertEquals(capture('relpath ../../sub1/sub2/hello.txt'), os.path.join('sub1', 'sub2', 'hello.txt\n'))
 
1102
                          pathjoin('sub1', 'sub2', 'hello.txt') + '\n')
 
1103
        self.assertEquals(capture('relpath ../../sub1/sub2/hello.txt'), pathjoin('sub1', 'sub2', 'hello.txt\n'))
1101
1104
        runbzr(['commit', '-m', 'move to parent directory'])
1102
1105
        chdir('..')
1103
 
        self.assertEquals(capture('relpath sub2/hello.txt'), os.path.join('sub1', 'sub2', 'hello.txt\n'))
 
1106
        self.assertEquals(capture('relpath sub2/hello.txt'), pathjoin('sub1', 'sub2', 'hello.txt\n'))
1104
1107
 
1105
1108
        runbzr('move sub2/hello.txt .')
1106
1109
        self.assert_(exists('hello.txt'))