changeset 13814:03dfe0c85c1a

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.
author Brodie Rao <brodie@bitheap.org>
date Wed, 30 Mar 2011 19:50:56 -0700
parents 76593ef397ef
children d066d8d652c8
files mercurial/url.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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)