~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Marius Kruger
  • Date: 2007-04-18 20:12:15 UTC
  • mto: This revision was merged to the branch mainline in revision 2455.
  • Revision ID: amanic@gmail.com-20070418201215-upzz7pof6a4433n7
* Minor text fixes.
* Remove trailing whitespace added by this branch.
* Add tests for removing empty directories.
* workingtree.remove
  - Don't recurse into empty directories.
  - Use absolute path when deleting from the file system.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
a='a'
26
26
b='b/'
27
27
c='b/c'
28
 
files=(a,b,c)
 
28
d='d/'
 
29
files=(a, b, c, d)
29
30
 
30
31
 
31
32
class TestRemove(ExternalBase):
118
119
    def test_remove_files(self):
119
120
        tree = self._make_add_and_assert_tree(files)
120
121
        self.run_bzr("commit -m 'added files'")
121
 
        self.run_bzr('remove a b b/c', 
122
 
                     error_regexes=["deleted a", "deleted b", "deleted b/c"])
 
122
        self.run_bzr('remove a b b/c d',
 
123
                     error_regexes=["deleted a", "deleted b", "deleted b/c",
 
124
                     "deleted d"])
123
125
        self.assertFilesDeleted(files)
124
126
 
125
127
    def test_remove_keep_files(self):
126
128
        tree = self._make_add_and_assert_tree(files)
127
129
        self.run_bzr("commit -m 'added files'")
128
 
        self.run_bzr('remove --keep a b b/c', 
129
 
                     error_regexes=["removed a", "removed b", "removed b/c"])
 
130
        self.run_bzr('remove --keep a b b/c d',
 
131
                     error_regexes=["removed a", "removed b", "removed b/c",
 
132
                     "removed d"])
130
133
        self.assertFilesUnversioned(files)
131
134
 
132
135
    def test_remove_on_deleted(self):
133
136
        tree = self._make_add_and_assert_tree([a])
134
 
        self.run_bzr("commit -m 'added a'")        
 
137
        self.run_bzr("commit -m 'added a'")
135
138
        os.unlink(a)
136
139
        self.assertInWorkingTree(a)
137
140
        self.run_bzr('remove a')