# HG changeset patch # User Siddharth Agarwal # Date 2014-02-03 22:53:44 # Node ID b433b43364e4059797637a5cf298f24e7209f95c # Parent 0889585b44f12f6f54ae33d758b8c51c4f424ed7 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. diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -92,8 +92,9 @@ def islocal(repo): 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)