[py-svn] r51988 - in py/branch/guido-svn-auth/py/path/svn: . testing
guido at codespeak.net
guido at codespeak.net
Sat Mar 1 13:04:13 CET 2008
Author: guido
Date: Sat Mar 1 13:04:13 2008
New Revision: 51988
Modified:
py/branch/guido-svn-auth/py/path/svn/testing/test_wccommand.py
py/branch/guido-svn-auth/py/path/svn/urlcommand.py
py/branch/guido-svn-auth/py/path/svn/wccommand.py
Log:
fixed some win32 specific issues caused by usernames containing spaces
Modified: py/branch/guido-svn-auth/py/path/svn/testing/test_wccommand.py
==============================================================================
--- py/branch/guido-svn-auth/py/path/svn/testing/test_wccommand.py (original)
+++ py/branch/guido-svn-auth/py/path/svn/testing/test_wccommand.py Sat Mar 1 13:04:13 2008
@@ -4,10 +4,19 @@
from py.__.path.svn.wccommand import parse_wcinfotime
from py.__.path.svn import svncommon
-
if py.path.local.sysfind('svn') is None:
py.test.skip("cannot test py.path.svn, 'svn' binary not found")
+try:
+ import win32api
+except ImportError:
+ def normpath(p):
+ return p
+else:
+ import os
+ def normpath(p):
+ p = win32api.GetShortPathName(p)
+ return os.path.normpath(os.path.normcase(p))
class TestWCSvnCommandPath(CommonSvnTests):
@@ -253,7 +262,7 @@
try:
locked = root.status().locked
assert len(locked) == 1
- assert str(locked[0]) == str(somefile)
+ assert normpath(str(locked[0])) == normpath(str(somefile))
#assert somefile.locked()
py.test.raises(Exception, 'somefile.lock()')
finally:
Modified: py/branch/guido-svn-auth/py/path/svn/urlcommand.py
==============================================================================
--- py/branch/guido-svn-auth/py/path/svn/urlcommand.py (original)
+++ py/branch/guido-svn-auth/py/path/svn/urlcommand.py Sat Mar 1 13:04:13 2008
@@ -284,7 +284,7 @@
# the '0?' part in the middle is an indication of whether the resource is
# locked, see 'svn help ls'
lspattern = re.compile(
- r'^ *(?P<rev>\d+) +(?P<author>\S+) +(0? *(?P<size>\d+))? '
+ r'^ *(?P<rev>\d+) +(?P<author>.+?) +(0? *(?P<size>\d+))? '
'*(?P<date>\w+ +\d{2} +[\d:]+) +(?P<file>.*)$')
def __init__(self, line):
# this is a typical line from 'svn ls http://...'
Modified: py/branch/guido-svn-auth/py/path/svn/wccommand.py
==============================================================================
--- py/branch/guido-svn-auth/py/path/svn/wccommand.py (original)
+++ py/branch/guido-svn-auth/py/path/svn/wccommand.py Sat Mar 1 13:04:13 2008
@@ -208,7 +208,7 @@
""" rename this path to target. """
py.process.cmdexec("svn move --force %s %s" %(str(self), str(target)))
- _rex_status = re.compile(r'\s+(\d+|-)\s+(\S+)\s+(\S+)\s+(.*)')
+ _rex_status = re.compile(r'\s+(\d+|-)\s+(\S+)\s+(.+?)\s{2,}(.*)')
def lock(self):
""" set a lock (exclusive) on the resource """
More information about the pytest-commit
mailing list