mercurial/hgweb/webcommands.py
changeset 6853 2ff0829bdae5
parent 6669 782dbbdfb1d7
child 6857 e8c2dae47799
equal deleted inserted replaced
6851:6ec941b6003d 6853:2ff0829bdae5
    51     req.respond(HTTP_OK, mt, path, len(text))
    51     req.respond(HTTP_OK, mt, path, len(text))
    52     return [text]
    52     return [text]
    53 
    53 
    54 def file(web, req, tmpl):
    54 def file(web, req, tmpl):
    55     path = web.cleanpath(req.form.get('file', [''])[0])
    55     path = web.cleanpath(req.form.get('file', [''])[0])
    56     if path:
    56     if not path:
       
    57         return web.manifest(tmpl, web.changectx(req), path)
       
    58     try:
       
    59         return web.filerevision(tmpl, web.filectx(req))
       
    60     except revlog.LookupError, inst:
    57         try:
    61         try:
    58             return web.filerevision(tmpl, web.filectx(req))
    62             return web.manifest(tmpl, web.changectx(req), path)
    59         except revlog.LookupError, inst:
    63         except ErrorResponse:
    60             pass
    64             raise inst
    61 
       
    62     try:
       
    63         return web.manifest(tmpl, web.changectx(req), path)
       
    64     except ErrorResponse:
       
    65         raise inst
       
    66 
    65 
    67 def changelog(web, req, tmpl, shortlog = False):
    66 def changelog(web, req, tmpl, shortlog = False):
    68     if 'node' in req.form:
    67     if 'node' in req.form:
    69         ctx = web.changectx(req)
    68         ctx = web.changectx(req)
    70     else:
    69     else: