[py-svn] r44248 - in py/trunk/py/path/svn: . testing

guido at codespeak.net guido at codespeak.net
Thu Jun 14 15:32:55 CEST 2007


Author: guido
Date: Thu Jun 14 15:32:55 2007
New Revision: 44248

Modified:
   py/trunk/py/path/svn/testing/test_wccommand.py
   py/trunk/py/path/svn/wccommand.py
Log:
Fixed problem with calling .remove() on wcpaths of non-versioned files.


Modified: py/trunk/py/path/svn/testing/test_wccommand.py
==============================================================================
--- py/trunk/py/path/svn/testing/test_wccommand.py	(original)
+++ py/trunk/py/path/svn/testing/test_wccommand.py	Thu Jun 14 15:32:55 2007
@@ -156,6 +156,15 @@
         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')

Modified: py/trunk/py/path/svn/wccommand.py
==============================================================================
--- py/trunk/py/path/svn/wccommand.py	(original)
+++ py/trunk/py/path/svn/wccommand.py	Thu Jun 14 15:32:55 2007
@@ -180,6 +180,10 @@
             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')



More information about the pytest-commit mailing list