changeset 20354:b433b43364e4 stable

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.
author Siddharth Agarwal <sid0@fb.com>
date Mon, 03 Feb 2014 14:53:44 -0800
parents 0889585b44f1
children 7d269e7620c4
files mercurial/hg.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hg.py	Mon Feb 03 14:47:41 2014 -0800
+++ b/mercurial/hg.py	Mon Feb 03 14:53:44 2014 -0800
@@ -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)