[svn r44248] Fixed problem with calling .remove() on wcpaths of non-versioned files.

--HG--
branch : trunk
This commit is contained in:
guido 2007-06-14 15:32:55 +02:00
parent 29e19de6a4
commit bdfb5ea88b
2 changed files with 13 additions and 0 deletions

View File

@ -156,6 +156,15 @@ class TestWCSvnCommandPath(CommonSvnTests):
finally:
notexisting.remove()
def test_nonversioned_remove(self):
assert self.root.check(versioned=1)
somefile = self.root.join('nonversioned/somefile')
nonwc = py.path.local(somefile)
nonwc.ensure()
assert somefile.check()
assert not somefile.check(versioned=True)
somefile.remove() # this used to fail because it tried to 'svn rm'
def test_properties(self):
try:
self.root.propset('gaga', 'this')

View File

@ -180,6 +180,10 @@ class SvnWCCommandPath(common.FSPathBase):
underlying svn semantics.
"""
assert rec, "svn cannot remove non-recursively"
if not self.check(versioned=True):
# not added to svn (anymore?), just remove
py.path.local(self).remove()
return
flags = []
if force:
flags.append('--force')