changeset 765:1e31d97c3d70

Hack to fix missing '/' problem in URLs
author mpm@selenic.com
date Fri, 22 Jul 2005 20:07:14 -0500
parents eea96285cbf9
children b444a7e053f1
files mercurial/hg.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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")