url: move drive letter checking into has_drive_letter() for extensions
This will let the schemes extension override drive letter detection to
allow single letter schemes.
--- a/mercurial/url.py Thu Mar 31 10:03:24 2011 -0500
+++ b/mercurial/url.py Wed Mar 30 19:50:56 2011 -0700
@@ -67,7 +67,7 @@
self._localpath = True
# special case for Windows drive letters
- if path[1:2] == ':' and path[0:1].isalpha():
+ if has_drive_letter(path):
self.path = path
return
@@ -211,6 +211,9 @@
def has_scheme(path):
return bool(url(path).scheme)
+def has_drive_letter(path):
+ return path[1:2] == ':' and path[0:1].isalpha()
+
def hidepassword(u):
'''hide user credential in a url string'''
u = url(u)