##// END OF EJS Templates
zeroconf: fix hgweb published URLs (issue1819)
Patrick Mezard -
r9442:080227f5 default
parent child Browse files
Show More
@@ -101,17 +101,20 b' class hgwebzc(hgweb_mod.hgweb):'
101 def __init__(self, repo, name=None):
101 def __init__(self, repo, name=None):
102 super(hgwebzc, self).__init__(repo, name)
102 super(hgwebzc, self).__init__(repo, name)
103 name = self.reponame or os.path.basename(repo.root)
103 name = self.reponame or os.path.basename(repo.root)
104 path = self.repo.ui.config("web", "prefix", "").strip('/')
104 desc = self.repo.ui.config("web", "description", name)
105 desc = self.repo.ui.config("web", "description", name)
105 publish(name, desc, name, int(repo.ui.config("web", "port", 8000)))
106 publish(name, desc, path, int(repo.ui.config("web", "port", 8000)))
106
107
107 class hgwebdirzc(hgwebdir_mod.hgwebdir):
108 class hgwebdirzc(hgwebdir_mod.hgwebdir):
108 def run(self):
109 def __init__(self, conf, baseui=None):
110 super(hgwebdirzc, self).__init__(conf, baseui)
111 prefix = self.ui.config("web", "prefix", "").strip('/') + '/'
109 for r, p in self.repos:
112 for r, p in self.repos:
110 u = self.ui.copy()
113 u = self.ui.copy()
111 u.readconfig(os.path.join(p, '.hg', 'hgrc'))
114 u.readconfig(os.path.join(p, '.hg', 'hgrc'))
112 n = os.path.basename(r)
115 n = os.path.basename(r)
113 publish(n, "hgweb", p, int(u.config("web", "port", 8000)))
116 path = (prefix + r).strip('/')
114 return super(hgwebdirzc, self).run()
117 publish(n, "hgweb", path, int(u.config("web", "port", 8000)))
115
118
116 # listen
119 # listen
117
120
General Comments 0
You need to be logged in to leave comments. Login now