[py-svn] r32644 - in py/dist/py/path/svn: . testing

hpk at codespeak.net hpk at codespeak.net
Tue Sep 26 10:56:47 CEST 2006


Author: hpk
Date: Tue Sep 26 10:56:44 2006
New Revision: 32644

Modified:
   py/dist/py/path/svn/testing/test_urlcommand.py
   py/dist/py/path/svn/urlcommand.py
Log:
fix checking for svnurls a bit, to at least work
somewhat for svn+ssh urls. 


Modified: py/dist/py/path/svn/testing/test_urlcommand.py
==============================================================================
--- py/dist/py/path/svn/testing/test_urlcommand.py	(original)
+++ py/dist/py/path/svn/testing/test_urlcommand.py	Tue Sep 26 10:56:44 2006
@@ -12,6 +12,9 @@
         repo, wc = getrepowc()
         cls.root = py.path.svnurl(repo)
 
+    def test_svnurl_characters(self):
+        test1 = py.path.svnurl("svn+ssh://hello/world")
+        
     def xtest_copy_file(self):
         raise py.test.Skipped(msg="XXX fix svnurl first")
 
@@ -46,4 +49,4 @@
         assert info.kind == 'file'
 
 def test_badchars():
-    py.test.raises(ValueError, "py.path.svnurl('/tmp/@@@:')")
+    py.test.raises(ValueError, "py.path.svnurl('file:///tmp/@@@:')")

Modified: py/dist/py/path/svn/urlcommand.py
==============================================================================
--- py/dist/py/path/svn/urlcommand.py	(original)
+++ py/dist/py/path/svn/urlcommand.py	Tue Sep 26 10:56:44 2006
@@ -23,7 +23,9 @@
         if not isinstance(path, str):
             path = str(path)
         parts = path.split(":")
-        if len(parts) > 2 or svncommon._check_for_bad_chars(''.join(parts)):
+        # only check for bad chars in the non-protocol parts
+        # XXX don't check svn+ssh host sections either
+        if len(parts) > 2 or svncommon._check_for_bad_chars(''.join(parts[1:])):
             raise ValueError("bad char in path %s" % (path, ))
         path = path.rstrip('/')
         self.strpath = path



More information about the pytest-commit mailing list