99 |
99 |
100 class hgwebzc(hgweb_mod.hgweb): |
100 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 |
118 class listener(object): |
121 class listener(object): |
119 def __init__(self): |
122 def __init__(self): |