2247 @return properly normalized url for subversion (string) |
2247 @return properly normalized url for subversion (string) |
2248 """ |
2248 """ |
2249 protocol, url = url.split("://") |
2249 protocol, url = url.split("://") |
2250 if url.startswith("\\\\"): |
2250 if url.startswith("\\\\"): |
2251 url = url[2:] |
2251 url = url[2:] |
2252 url = url.replace('\\', '/') |
2252 url = os.path.normcase(url).replace('\\', '/') |
2253 if url.endswith('/'): |
2253 if url.endswith('/'): |
2254 url = url[:-1] |
2254 url = url[:-1] |
2255 if not url.startswith("/") and url[1] in [":", "|"]: |
2255 if not url.startswith("/") and url[1] in [":", "|"]: |
2256 url = "/{0}".format(url) |
2256 url = "/{0}".format(url) |
2257 return "{0}://{1}".format(protocol, url) |
2257 return "{0}://{1}".format(protocol, url) |