mercurial/hgweb/hgweb_mod.py
changeset 7396 526c40a74bd0
parent 7348 1a5c9ca2bfd5
child 7562 b663b5563de7
equal deleted inserted replaced
7395:e2048f5c7bf5 7396:526c40a74bd0
   180                 content = webcommands.rawfile(self, req, tmpl)
   180                 content = webcommands.rawfile(self, req, tmpl)
   181             else:
   181             else:
   182                 content = getattr(webcommands, cmd)(self, req, tmpl)
   182                 content = getattr(webcommands, cmd)(self, req, tmpl)
   183                 req.respond(HTTP_OK, ctype)
   183                 req.respond(HTTP_OK, ctype)
   184 
   184 
   185             return ''.join(content),
   185             return content
   186 
   186 
   187         except revlog.LookupError, err:
   187         except revlog.LookupError, err:
   188             req.respond(HTTP_NOT_FOUND, ctype)
   188             req.respond(HTTP_NOT_FOUND, ctype)
   189             msg = str(err)
   189             msg = str(err)
   190             if 'manifest' not in msg:
   190             if 'manifest' not in msg:
   191                 msg = 'revision not found: %s' % err.name
   191                 msg = 'revision not found: %s' % err.name
   192             return ''.join(tmpl('error', error=msg)),
   192             return tmpl('error', error=msg)
   193         except (RepoError, revlog.RevlogError), inst:
   193         except (RepoError, revlog.RevlogError), inst:
   194             req.respond(HTTP_SERVER_ERROR, ctype)
   194             req.respond(HTTP_SERVER_ERROR, ctype)
   195             return ''.join(tmpl('error', error=str(inst))),
   195             return tmpl('error', error=str(inst))
   196         except ErrorResponse, inst:
   196         except ErrorResponse, inst:
   197             req.respond(inst.code, ctype)
   197             req.respond(inst.code, ctype)
   198             return ''.join(tmpl('error', error=inst.message)),
   198             return tmpl('error', error=inst.message)
   199 
   199 
   200     def templater(self, req):
   200     def templater(self, req):
   201 
   201 
   202         # determine scheme, port and server name
   202         # determine scheme, port and server name
   203         # this is needed to create absolute urls
   203         # this is needed to create absolute urls