From bdfb5ea88bbb5572cde09ea3b69198089d9232a4 Mon Sep 17 00:00:00 2001 From: guido Date: Thu, 14 Jun 2007 15:32:55 +0200 Subject: [PATCH] [svn r44248] Fixed problem with calling .remove() on wcpaths of non-versioned files. --HG-- branch : trunk --- py/path/svn/testing/test_wccommand.py | 9 +++++++++ py/path/svn/wccommand.py | 4 ++++ 2 files changed, 13 insertions(+) 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')