##// END OF EJS Templates
hgweb: browse subdirectories before checking whether parent directory is also a repository
Brendan Cully -
r4850:7031d9e2 default
parent child Browse files
Show More
@@ -220,8 +220,15 b' class hgwebdir(object):'
220 req.write(staticfile(static, fname, req) or
220 req.write(staticfile(static, fname, req) or
221 tmpl('error', error='%r not found' % fname))
221 tmpl('error', error='%r not found' % fname))
222 elif virtual:
222 elif virtual:
223 repos = dict(self.repos)
224 # browse subdirectories
225 subdir = virtual + '/'
226 if [r for r in repos if r.startswith(subdir)]:
227 makeindex(req, subdir)
228 return
229
223 while virtual:
230 while virtual:
224 real = dict(self.repos).get(virtual)
231 real = repos.get(virtual)
225 if real:
232 if real:
226 break
233 break
227 up = virtual.rfind('/')
234 up = virtual.rfind('/')
@@ -238,11 +245,7 b' class hgwebdir(object):'
238 except hg.RepoError, inst:
245 except hg.RepoError, inst:
239 req.write(tmpl("error", error=str(inst)))
246 req.write(tmpl("error", error=str(inst)))
240 else:
247 else:
241 subdir=req.env.get("PATH_INFO", "").strip('/') + '/'
248 req.write(tmpl("notfound", repo=virtual))
242 if [r for r in self.repos if r[0].startswith(subdir)]:
243 makeindex(req, subdir)
244 else:
245 req.write(tmpl("notfound", repo=virtual))
246 else:
249 else:
247 if req.form.has_key('static'):
250 if req.form.has_key('static'):
248 static = os.path.join(templater.templatepath(), "static")
251 static = os.path.join(templater.templatepath(), "static")
General Comments 0
You need to be logged in to leave comments. Login now