mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 23:07:18 +03:00
url: use url.url in ui.expandpath()
This commit is contained in:
parent
00a75e8663
commit
8f5f4f569c
@ -7,7 +7,7 @@
|
||||
|
||||
from i18n import _
|
||||
import errno, getpass, os, socket, sys, tempfile, traceback
|
||||
import config, util, error
|
||||
import config, util, error, url
|
||||
|
||||
class ui(object):
|
||||
def __init__(self, src=None):
|
||||
@ -111,7 +111,7 @@ class ui(object):
|
||||
% (n, p, self.configsource('paths', n)))
|
||||
p = p.replace('%%', '%')
|
||||
p = util.expandpath(p)
|
||||
if '://' not in p and not os.path.isabs(p):
|
||||
if not url.has_scheme(p) and not os.path.isabs(p):
|
||||
p = os.path.normpath(os.path.join(root, p))
|
||||
c.set("paths", n, p)
|
||||
|
||||
@ -325,7 +325,7 @@ class ui(object):
|
||||
|
||||
def expandpath(self, loc, default=None):
|
||||
"""Return repository location relative to cwd or from [paths]"""
|
||||
if "://" in loc or os.path.isdir(os.path.join(loc, '.hg')):
|
||||
if url.has_scheme(loc) or os.path.isdir(os.path.join(loc, '.hg')):
|
||||
return loc
|
||||
|
||||
path = self.config('paths', loc)
|
||||
|
Loading…
Reference in New Issue
Block a user