##// END OF EJS Templates
hgweb: expose repo name on parsedrequest...
Gregory Szorc -
r36884:8ddb5c35 default
parent child Browse files
Show More
@@ -141,7 +141,7 class requestcontext(object):
141 141 if typ in allowed or self.configbool('web', 'allow%s' % typ):
142 142 yield {'type': typ, 'extension': spec[2], 'node': nodeid}
143 143
144 def templater(self, wsgireq, req):
144 def templater(self, req):
145 145 # determine scheme, port and server name
146 146 # this is needed to create absolute urls
147 147 logourl = self.config('web', 'logourl')
@@ -159,7 +159,7 class requestcontext(object):
159 159 # figure out which style to use
160 160
161 161 vars = {}
162 styles, (style, mapfile) = getstyle(wsgireq.req, self.config,
162 styles, (style, mapfile) = getstyle(req, self.config,
163 163 self.templatepath)
164 164 if style == styles[0]:
165 165 vars['style'] = style
@@ -168,8 +168,9 class requestcontext(object):
168 168
169 169 if not self.reponame:
170 170 self.reponame = (self.config('web', 'name', '')
171 or wsgireq.env.get('REPO_NAME')
172 or req.apppath or self.repo.root)
171 or req.reponame
172 or req.apppath
173 or self.repo.root)
173 174
174 175 def websubfilter(text):
175 176 return templatefilters.websub(text, self.websubtable)
@@ -372,7 +373,7 class hgweb(object):
372 373 # process the web interface request
373 374
374 375 try:
375 tmpl = rctx.templater(wsgireq, req)
376 tmpl = rctx.templater(req)
376 377 ctype = tmpl('mimetype', encoding=encoding.encoding)
377 378 ctype = templater.stringify(ctype)
378 379
@@ -144,6 +144,8 class parsedrequest(object):
144 144 # Whether there is a path component to this request. This can be true
145 145 # when ``dispatchpath`` is empty due to REPO_NAME muckery.
146 146 havepathinfo = attr.ib()
147 # The name of the repository being accessed.
148 reponame = attr.ib()
147 149 # Raw query string (part after "?" in URL).
148 150 querystring = attr.ib()
149 151 # multidict of query string parameters.
@@ -282,6 +284,7 def parserequestfromenv(env, bodyfh):
282 284 apppath=apppath,
283 285 dispatchparts=dispatchparts, dispatchpath=dispatchpath,
284 286 havepathinfo='PATH_INFO' in env,
287 reponame=env.get('REPO_NAME'),
285 288 querystring=querystring,
286 289 qsparams=qsparams,
287 290 headers=headers,
General Comments 0
You need to be logged in to leave comments. Login now