~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/workingtree_implementations/test_remove.py

Bugfix WorkingTree.remove to handle subtrees, and non-cwd trees

Show diffs side-by-side

added added

removed removed

Lines of Context:
203
203
        tree.remove(TestRemove.b, keep_files=False, force=True)
204
204
        self.assertNotInWorkingTree(TestRemove.b_c)
205
205
        self.failIfExists(TestRemove.b_c)
 
206
 
 
207
    def test_remove_subtree(self):
 
208
        tree = self.make_branch_and_tree('.')
 
209
        subtree = self.make_branch_and_tree('subtree')
 
210
        tree.add('subtree', 'subtree-id')
 
211
        tree.remove('subtree')
 
212
        self.assertIs(None, tree.path2id('subtree'))
 
213
 
 
214
    def test_non_cwd(self):
 
215
        tree = self.make_branch_and_tree('tree')
 
216
        self.build_tree(['tree/dir/', 'tree/dir/file'])
 
217
        tree.add(['dir', 'dir/file'])
 
218
        tree.commit('add file')
 
219
        tree.remove('dir/', keep_files=False)
 
220
        self.failIfExists('tree/dir/file')