Hack to fix missing '/' problem in URLs
authormpm@selenic.com
Fri, 22 Jul 2005 20:07:14 -0500
changeset 765 1e31d97c3d70
parent 764 eea96285cbf9
child 766 b444a7e053f1
Hack to fix missing '/' problem in URLs
mercurial/hg.py
--- a/mercurial/hg.py	Fri Jul 22 19:23:00 2005 -0500
+++ b/mercurial/hg.py	Fri Jul 22 20:07:14 2005 -0500
@@ -10,7 +10,7 @@
 from revlog import *
 from demandload import *
 demandload(globals(), "re lock urllib urllib2 transaction time socket")
-demandload(globals(), "tempfile httprangereader bdiff")
+demandload(globals(), "tempfile httprangereader bdiff urlparse")
 demandload(globals(), "bisect select")
 
 class filelog(revlog):
@@ -1692,7 +1692,11 @@
 
 class httprepository:
     def __init__(self, ui, path):
-        self.url = path
+        # fix missing / after hostname
+        s = urlparse.urlsplit(path)
+        partial = s[2]
+        if not partial: partial = "/"
+        self.url = urlparse.urlunsplit((s[0], s[1], partial, '', ''))
         self.ui = ui
         no_list = [ "localhost", "127.0.0.1" ]
         host = ui.config("http_proxy", "host")