~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Robert Collins
  • Date: 2006-01-02 22:37:32 UTC
  • mfrom: (1185.50.33 bzr-jam-integration)
  • Revision ID: robertc@robertcollins.net-20060102223732-d5221b37ff0f7888
Merge in John Meinels integration branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
from bzrlib.branch import Branch
44
44
from bzrlib.clone import copy_branch
45
45
from bzrlib.errors import BzrCommandError
46
 
from bzrlib.osutils import has_symlinks
 
46
from bzrlib.osutils import has_symlinks, pathjoin
47
47
from bzrlib.tests.HTTPTestUtil import TestCaseWithWebserver
48
48
from bzrlib.tests.blackbox import ExternalBase
49
49
 
215
215
        os.rmdir('revertdir')
216
216
        self.runbzr('revert')
217
217
 
218
 
        os.symlink('/unlikely/to/exist', 'symlink')
219
 
        self.runbzr('add symlink')
220
 
        self.runbzr('commit -m f')
221
 
        os.unlink('symlink')
222
 
        self.runbzr('revert')
223
 
        self.failUnlessExists('symlink')
224
 
        os.unlink('symlink')
225
 
        os.symlink('a-different-path', 'symlink')
226
 
        self.runbzr('revert')
227
 
        self.assertEqual('/unlikely/to/exist',
228
 
                         os.readlink('symlink'))
 
218
        if has_symlinks():
 
219
            os.symlink('/unlikely/to/exist', 'symlink')
 
220
            self.runbzr('add symlink')
 
221
            self.runbzr('commit -m f')
 
222
            os.unlink('symlink')
 
223
            self.runbzr('revert')
 
224
            self.failUnlessExists('symlink')
 
225
            os.unlink('symlink')
 
226
            os.symlink('a-different-path', 'symlink')
 
227
            self.runbzr('revert')
 
228
            self.assertEqual('/unlikely/to/exist',
 
229
                             os.readlink('symlink'))
 
230
        else:
 
231
            self.log("skipping revert symlink tests")
229
232
        
230
233
        file('hello', 'wt').write('xyz')
231
234
        self.runbzr('commit -m xyz hello')
674
677
        self.assertEquals(['If you wish to add some of these files, please'\
675
678
                           ' add them by name.',
676
679
                           'added dir',
677
 
                           'added dir'+os.sep+'sub.txt',
 
680
                           'added dir/sub.txt',
678
681
                           'added top.txt',
679
682
                           'ignored 1 file(s) matching "CVS"'],
680
683
                          results)
728
731
        self.build_tree(['inertiatic/', 'inertiatic/esp'])
729
732
        self.assertEquals(self.capture('unknowns'), 'inertiatic\n')
730
733
        self.run_bzr('add', '--no-recurse', 'inertiatic')
731
 
        self.assertEquals(self.capture('unknowns'), 'inertiatic'+os.sep+'esp\n')
 
734
        self.assertEquals(self.capture('unknowns'), 'inertiatic/esp\n')
732
735
        self.run_bzr('add', 'inertiatic/esp')
733
736
        self.assertEquals(self.capture('unknowns'), '')
734
737
 
1007
1010
        runbzr('init')
1008
1011
 
1009
1012
        self.assertEquals(capture('root').rstrip(),
1010
 
                          os.path.join(self.test_dir, 'branch1'))
 
1013
                          pathjoin(self.test_dir, 'branch1'))
1011
1014
 
1012
1015
        progress("status of new file")
1013
1016
 
1083
1086
        runbzr("rename sub1 sub2")
1084
1087
        runbzr("move hello.txt sub2")
1085
1088
        self.assertEqual(capture("relpath sub2/hello.txt"),
1086
 
                         os.path.join("sub2", "hello.txt\n"))
 
1089
                         pathjoin("sub2", "hello.txt\n"))
1087
1090
 
1088
1091
        self.assert_(exists("sub2"))
1089
1092
        self.assert_(exists("sub2/hello.txt"))
1105
1108
 
1106
1109
        chdir('sub1/sub2')
1107
1110
        self.assertEquals(capture('root')[:-1],
1108
 
                          os.path.join(self.test_dir, 'branch1'))
 
1111
                          pathjoin(self.test_dir, 'branch1'))
1109
1112
        runbzr('move ../hello.txt .')
1110
1113
        self.assert_(exists('./hello.txt'))
1111
1114
        self.assertEquals(capture('relpath hello.txt'),
1112
 
                          os.path.join('sub1', 'sub2', 'hello.txt') + '\n')
1113
 
        self.assertEquals(capture('relpath ../../sub1/sub2/hello.txt'), os.path.join('sub1', 'sub2', 'hello.txt\n'))
 
1115
                          pathjoin('sub1', 'sub2', 'hello.txt') + '\n')
 
1116
        self.assertEquals(capture('relpath ../../sub1/sub2/hello.txt'), pathjoin('sub1', 'sub2', 'hello.txt\n'))
1114
1117
        runbzr(['commit', '-m', 'move to parent directory'])
1115
1118
        chdir('..')
1116
 
        self.assertEquals(capture('relpath sub2/hello.txt'), os.path.join('sub1', 'sub2', 'hello.txt\n'))
 
1119
        self.assertEquals(capture('relpath sub2/hello.txt'), pathjoin('sub1', 'sub2', 'hello.txt\n'))
1117
1120
 
1118
1121
        runbzr('move sub2/hello.txt .')
1119
1122
        self.assert_(exists('hello.txt'))