mercurial/hgweb/hgweb_mod.py
changeset 36801 66de4555cefd
parent 36800 0b18604db95e
child 36802 7fc80c982656
equal deleted inserted replaced
36800:0b18604db95e 36801:66de4555cefd
   348             query = req.env[r'QUERY_STRING'].partition(r'&')[0]
   348             query = req.env[r'QUERY_STRING'].partition(r'&')[0]
   349             query = query.partition(r';')[0]
   349             query = query.partition(r';')[0]
   350 
   350 
   351         # Route it to a wire protocol handler if it looks like a wire protocol
   351         # Route it to a wire protocol handler if it looks like a wire protocol
   352         # request.
   352         # request.
   353         protohandler = wireprotoserver.parsehttprequest(rctx.repo, req, query)
   353         protohandler = wireprotoserver.parsehttprequest(rctx, req, query,
       
   354                                                         self.check_perm)
   354 
   355 
   355         if protohandler:
   356         if protohandler:
   356             try:
   357             try:
   357                 if query:
   358                 if query:
   358                     raise ErrorResponse(HTTP_NOT_FOUND)
   359                     raise ErrorResponse(HTTP_NOT_FOUND)
   359 
   360 
   360                 # TODO fold this into parsehttprequest
   361                 return protohandler['dispatch']()
   361                 checkperm = lambda op: self.check_perm(rctx, req, op)
       
   362                 protohandler['proto'].checkperm = checkperm
       
   363 
       
   364                 return protohandler['dispatch'](checkperm)
       
   365             except ErrorResponse as inst:
   362             except ErrorResponse as inst:
   366                 return protohandler['handleerror'](inst)
   363                 return protohandler['handleerror'](inst)
   367 
   364 
   368         # translate user-visible url structure to internal structure
   365         # translate user-visible url structure to internal structure
   369 
   366