##// END OF EJS Templates
url: fix file:// URL handling
Patrick Mezard -
r7284:ac81ffac default
parent child Browse files
Show More
@@ -250,6 +250,11 b' def getauthinfo(path):'
250 250 scheme, netloc, urlpath, query, frag = urlparse.urlsplit(path)
251 251 if not urlpath:
252 252 urlpath = '/'
253 if scheme != 'file':
254 # XXX: why are we quoting the path again with some smart
255 # heuristic here? Anyway, it cannot be done with file://
256 # urls since path encoding is os/fs dependent (see
257 # urllib.pathname2url() for details).
253 258 urlpath = quotepath(urlpath)
254 259 host, port, user, passwd = netlocsplit(netloc)
255 260
@@ -296,7 +301,9 b' def opener(ui, authinfo=None):'
296 301 def open(ui, url, data=None):
297 302 scheme = urlparse.urlsplit(url)[0]
298 303 if not scheme:
299 url, authinfo = 'file://' + util.normpath(os.path.abspath(url)), None
304 path = util.normpath(os.path.abspath(url))
305 url = 'file://' + urllib.pathname2url(path)
306 authinfo = None
300 307 else:
301 308 url, authinfo = getauthinfo(url)
302 309 return opener(ui, authinfo).open(url, data)
General Comments 0
You need to be logged in to leave comments. Login now