##// END OF EJS Templates
Make sure the repository names don't have slashes at the at or else in some...
Vincent Wagelaar -
r1181:4f5001f5 default
parent child Browse files
Show More
@@ -927,15 +927,18 b' def server(path, name, templates, addres'
927 # This is a stopgap
927 # This is a stopgap
928 class hgwebdir:
928 class hgwebdir:
929 def __init__(self, config):
929 def __init__(self, config):
930 def cleannames(items):
931 return [(name.strip('/'), path) for name, path in items]
932
930 if type(config) == type([]):
933 if type(config) == type([]):
931 self.repos = config
934 self.repos = cleannames(config)
932 elif type(config) == type({}):
935 elif type(config) == type({}):
933 self.repos = config.items()
936 self.repos = cleannames(config.items())
934 self.repos.sort()
937 self.repos.sort()
935 else:
938 else:
936 cp = ConfigParser.SafeConfigParser()
939 cp = ConfigParser.SafeConfigParser()
937 cp.read(config)
940 cp.read(config)
938 self.repos = cp.items("paths")
941 self.repos = cleannames(cp.items("paths"))
939 self.repos.sort()
942 self.repos.sort()
940
943
941 def run(self, req=hgrequest()):
944 def run(self, req=hgrequest()):
@@ -956,7 +959,7 b' class hgwebdir:'
956 u.readconfig(file(os.path.join(path, '.hg', 'hgrc')))
959 u.readconfig(file(os.path.join(path, '.hg', 'hgrc')))
957 get = u.config
960 get = u.config
958
961
959 url = ('/'.join([req.env["REQUEST_URI"], name])
962 url = ('/'.join([req.env["REQUEST_URI"].split('?')[0], name])
960 .replace("//", "/"))
963 .replace("//", "/"))
961
964
962 yield dict(contact=get("web", "contact") or
965 yield dict(contact=get("web", "contact") or
General Comments 0
You need to be logged in to leave comments. Login now