[py-svn] r23816 - py/dist/py/path/svn

briandorsey at codespeak.net briandorsey at codespeak.net
Wed Mar 1 03:32:28 CET 2006


Author: briandorsey
Date: Wed Mar  1 03:32:26 2006
New Revision: 23816

Modified:
   py/dist/py/path/svn/urlcommand.py
Log:
Many fixes to py.path.svn for windows, just quoting issues.

* Changed many uses of single quotes to double-quotes for escaping.


Modified: py/dist/py/path/svn/urlcommand.py
==============================================================================
--- py/dist/py/path/svn/urlcommand.py	(original)
+++ py/dist/py/path/svn/urlcommand.py	Wed Mar  1 03:32:26 2006
@@ -38,7 +38,7 @@
             l = ['svn %s -r %d' % (cmd, self.rev)]
         args = map(lambda x: '"%s"' % str(x), args)
         l.extend(args)
-        l.append(repr(self._encodedurl()))
+        l.append('"%s"' % self._encodedurl())
         # fixing the locale because we can't otherwise parse
         string = svncommon.fixlocale() + " ".join(l)
         #print "execing", string
@@ -49,7 +49,7 @@
         l = ['svn %s' % cmd]
         args = map(lambda x: '"%s"' % str(x), args)
         l.extend(args)
-        l.append(repr(self._encodedurl())) 
+        l.append('"%s"' % self._encodedurl())
         # fixing the locale because we can't otherwise parse
         string = svncommon.fixlocale() + " ".join(l)
         #print "execing", string
@@ -57,7 +57,7 @@
             out = process.cmdexec(string)
         except py.process.cmdexec.Error, e:
             if (e.err.find('File Exists') != -1 or
-                e.err.find('File already exists') != -1):
+                            e.err.find('File already exists') != -1):
                 raise py.error.EEXIST(self)
             raise
         return out
@@ -103,21 +103,22 @@
     def copy(self, target, msg='copied by py lib invocation'):
         if getattr(target, 'rev', None) is not None:
             raise py.error.EINVAL(target, "revisions are immutable")
-        process.cmdexec("svn copy -m %r %s %s" %(msg, str(self), str(target)))
+        process.cmdexec('svn copy -m "%s" "%s" "%s"' %(msg, 
+                                                str(self), str(target)))
         self._lsnorevcache.delentry(target.dirpath().strpath)
 
     def rename(self, target, msg="renamed by py lib invocation"):
         if getattr(self, 'rev', None) is not None:
             raise py.error.EINVAL(self, "revisions are immutable")
-        py.process.cmdexec("svn move -m %r --force %s %s" %(
-                           msg, str(self), str(target)))
+        py.process.cmdexec('svn move -m "%s" --force "%s" "%s"' %(
+                           msg, self, target))
         self._lsnorevcache.delentry(self.dirpath().strpath)
         self._lsnorevcache.delentry(self.strpath)
 
     def remove(self, rec=1, msg='removed by py lib invocation'):
         if self.rev is not None:
             raise py.error.EINVAL(self, "revisions are immutable")
-        process.cmdexec("svn rm -m %r %s" %(msg, str(self)))
+        process.cmdexec('svn rm -m "%s" "%s"' %(msg, self))
         self._lsnorevcache.delentry(self.dirpath().strpath)
 
     def ensure(self, *args, **kwargs):
@@ -143,9 +144,9 @@
         tempdir = py.path.local.mkdtemp()
         try:    
             tempdir.ensure(tocreate, dir=dir) 
-            cmd = 'svn import -m %r %r %r' % (
+            cmd = 'svn import -m "%s" "%s" "%s"' % (
                     "ensure %s" % tocreate, 
-                    str(tempdir.join(basename)), 
+                    tempdir.join(basename), 
                     x.join(basename)._encodedurl())
             process.cmdexec(cmd) 
             self._lsnorevcache.delentry(x.strpath)  # !!! 



More information about the pytest-commit mailing list