2043 @return properly normalized url for subversion (string) |
2043 @return properly normalized url for subversion (string) |
2044 """ |
2044 """ |
2045 protocol, url = url.split("://") |
2045 protocol, url = url.split("://") |
2046 if url.startswith("\\\\"): |
2046 if url.startswith("\\\\"): |
2047 url = url[2:] |
2047 url = url[2:] |
2048 url = os.path.normcase(url).replace('\\', '/') |
2048 if protocol == "file": |
|
2049 url = os.path.normcase(url) |
|
2050 url = url.replace('\\', '/') |
2049 if url.endswith('/'): |
2051 if url.endswith('/'): |
2050 url = url[:-1] |
2052 url = url[:-1] |
2051 if not url.startswith("/") and url[1] in [":", "|"]: |
2053 if not url.startswith("/") and url[1] in [":", "|"]: |
2052 url = "/{0}".format(url) |
2054 url = "/{0}".format(url) |
2053 return "{0}://{1}".format(protocol, url) |
2055 return "{0}://{1}".format(protocol, url) |