# HG changeset patch # User Patrick Mezard # Date 2008-10-28 22:54:01 # Node ID 5ad99abfab79576b46058769a271f037f61d37be # Parent ac81ffac0f353419802e42f66d71b0682459acde url: detect scheme with a regexp instead of urlsplit() The latter says 'c' is a scheme in 'c:\foo\bar' diff --git a/mercurial/url.py b/mercurial/url.py --- a/mercurial/url.py +++ b/mercurial/url.py @@ -298,8 +298,13 @@ def opener(ui, authinfo=None): opener.addheaders.append(('Accept', 'application/mercurial-0.1')) return opener +scheme_re = re.compile(r'^([a-zA-Z0-9+-.]+)://') + def open(ui, url, data=None): - scheme = urlparse.urlsplit(url)[0] + scheme = None + m = scheme_re.search(url) + if m: + scheme = m.group(1).lower() if not scheme: path = util.normpath(os.path.abspath(url)) url = 'file://' + urllib.pathname2url(path)