diff --git a/py/path/svn/testing/test_wccommand.py b/py/path/svn/testing/test_wccommand.py index 6a92ce3b0..e7169531d 100644 --- a/py/path/svn/testing/test_wccommand.py +++ b/py/path/svn/testing/test_wccommand.py @@ -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') diff --git a/py/path/svn/wccommand.py b/py/path/svn/wccommand.py index 4f20932fd..06e1c8b60 100644 --- a/py/path/svn/wccommand.py +++ b/py/path/svn/wccommand.py @@ -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')