53
53
self.assertEquals(delta.added[0][0], 'foo')
54
54
self.failIf(delta.modified)
56
def test_mkdir_in_subdir(self):
57
"""'bzr mkdir' operation in subdirectory"""
60
self.run_bzr('mkdir', 'dir')
61
self.assert_(os.path.isdir('dir'))
64
self.log('Run mkdir in subdir')
65
self.run_bzr('mkdir', 'subdir')
66
self.assert_(os.path.isdir('subdir'))
69
from bzrlib.diff import compare_trees
70
from bzrlib.branch import Branch
73
delta = compare_trees(b.basis_tree(), b.working_tree())
75
self.log('delta.added = %r' % delta.added)
77
self.assertEquals(len(delta.added), 2)
78
self.assertEquals(delta.added[0][0], 'dir')
79
self.assertEquals(delta.added[1][0], os.path.join('dir','subdir'))
80
self.failIf(delta.modified)
82
def test_mkdir_w_nested_trees(self):
83
"""'bzr mkdir' with nested trees"""
94
self.run_bzr('mkdir', 'dir', 'a/dir', 'a/b/dir')
95
self.failUnless(os.path.isdir('dir'))
96
self.failUnless(os.path.isdir('a/dir'))
97
self.failUnless(os.path.isdir('a/b/dir'))
99
from bzrlib.diff import compare_trees
101
b_a = Branch.open('a')
102
b_b = Branch.open('a/b')
104
delta = compare_trees(b.basis_tree(), b.working_tree())
105
self.assertEquals(len(delta.added), 1)
106
self.assertEquals(delta.added[0][0], 'dir')
107
self.failIf(delta.modified)
109
delta = compare_trees(b_a.basis_tree(), b_a.working_tree())
110
self.assertEquals(len(delta.added), 1)
111
self.assertEquals(delta.added[0][0], 'dir')
112
self.failIf(delta.modified)
114
delta = compare_trees(b_b.basis_tree(), b_b.working_tree())
115
self.assertEquals(len(delta.added), 1)
116
self.assertEquals(delta.added[0][0], 'dir')
117
self.failIf(delta.modified)
56
119
def test_branch_add_in_unversioned(self):
57
120
"""Try to add a file in an unversioned directory.