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
996
996
self.assertEquals(capture('root').rstrip(),
997
os.path.join(self.test_dir, 'branch1'))
997
pathjoin(self.test_dir, 'branch1'))
999
999
progress("status of new file")
1070
1070
runbzr("rename sub1 sub2")
1071
1071
runbzr("move hello.txt sub2")
1072
1072
self.assertEqual(capture("relpath sub2/hello.txt"),
1073
os.path.join("sub2", "hello.txt\n"))
1073
pathjoin("sub2", "hello.txt\n"))
1075
1075
self.assert_(exists("sub2"))
1076
1076
self.assert_(exists("sub2/hello.txt"))
1093
1093
chdir('sub1/sub2')
1094
1094
self.assertEquals(capture('root')[:-1],
1095
os.path.join(self.test_dir, 'branch1'))
1095
pathjoin(self.test_dir, 'branch1'))
1096
1096
runbzr('move ../hello.txt .')
1097
1097
self.assert_(exists('./hello.txt'))
1098
1098
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'))
1099
pathjoin('sub1', 'sub2', 'hello.txt') + '\n')
1100
self.assertEquals(capture('relpath ../../sub1/sub2/hello.txt'), pathjoin('sub1', 'sub2', 'hello.txt\n'))
1101
1101
runbzr(['commit', '-m', 'move to parent directory'])
1103
self.assertEquals(capture('relpath sub2/hello.txt'), os.path.join('sub1', 'sub2', 'hello.txt\n'))
1103
self.assertEquals(capture('relpath sub2/hello.txt'), pathjoin('sub1', 'sub2', 'hello.txt\n'))
1105
1105
runbzr('move sub2/hello.txt .')
1106
1106
self.assert_(exists('hello.txt'))