comparison mercurial/hgweb/hgweb_mod.py @ 6781:b4b7261164d5

hgweb: protocol functions take repo instead of web This makes it much easier for implementers of hgweb alternatives to simply call into protocol functions after setting up a repo and a request.
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Sun, 29 Jun 2008 11:34:36 +0200
parents 4c1d67e0fa8c
children 18c429ea3a0e
comparison
equal deleted inserted replaced
6780:4c1d67e0fa8c 6781:b4b7261164d5
90 cmd = req.form.get('cmd', [''])[0] 90 cmd = req.form.get('cmd', [''])[0]
91 if cmd and cmd in protocol.__all__: 91 if cmd and cmd in protocol.__all__:
92 if cmd in perms and not self.check_perm(req, perms[cmd]): 92 if cmd in perms and not self.check_perm(req, perms[cmd]):
93 return 93 return
94 method = getattr(protocol, cmd) 94 method = getattr(protocol, cmd)
95 method(self, req) 95 method(self.repo, req)
96 return 96 return
97 97
98 # work with CGI variables to create coherent structure 98 # work with CGI variables to create coherent structure
99 # use SCRIPT_NAME, PATH_INFO and QUERY_STRING as well as our REPO_NAME 99 # use SCRIPT_NAME, PATH_INFO and QUERY_STRING as well as our REPO_NAME
100 100