auth: fix realm handling with Python < 2.4.3 (issue2739) stable
authorMatt Mackall <mpm@selenic.com>
Mon, 17 Oct 2011 13:42:42 -0500
branchstable
changeset 15288 b3083042bdda
parent 15287 b3e19c355ca7
child 15289 9cec4b24615b
auth: fix realm handling with Python < 2.4.3 (issue2739)
mercurial/httpconnection.py
--- a/mercurial/httpconnection.py	Mon Oct 17 18:01:38 2011 +0200
+++ b/mercurial/httpconnection.py	Mon Oct 17 13:42:42 2011 -0500
@@ -70,7 +70,11 @@
         gdict[setting] = val
 
     # Find the best match
-    scheme, hostpath = uri.split('://', 1)
+    if '://' in uri:
+        scheme, hostpath = uri.split('://', 1)
+    else:
+        # py2.4.1 doesn't provide the full URI
+        scheme, hostpath = 'http', uri
     bestuser = None
     bestlen = 0
     bestauth = None