Skip to content
Snippets Groups Projects
Commit b433b43364e4 authored by Siddharth Agarwal's avatar Siddharth Agarwal
Browse files

hg.openpath: use url.islocal to tell if the path is local (issue3624)

Previously we used hg.islocal, which doesn't work for paths pointing to
non-repos, such as patch files.
parent 0889585b44f1
No related branches found
No related tags found
No related merge requests found
......@@ -92,8 +92,9 @@
def openpath(ui, path):
'''open path with open if local, url.open if remote'''
if islocal(path):
return util.posixfile(util.urllocalpath(path), 'rb')
pathurl = util.url(path, parsequery=False, parsefragment=False)
if pathurl.islocal():
return util.posixfile(pathurl.localpath(), 'rb')
else:
return url.open(ui, path)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment