Mercurial > hg
comparison mercurial/hgweb/hgwebdir_mod.py @ 36895:a5c478843c82
hgweb: construct static URL like hgweb does
hgwebdir has a bit of code for constructing URLs. This reinvents wheels
from our parsedrequest instance. And sometimes the behavior varies
from what hgweb does. We'll want to converge that behavior.
This commit changes hgwebdir so its staticurl template keyword
is constructed the same way as hgweb's. There's probably room
to factor this into a shared function. But let's solve the
problem of divergence first.
Differential Revision: https://phab.mercurial-scm.org/D2817
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 11 Mar 2018 10:51:14 -0700 |
parents | ee395147bb28 |
children | d7fd203e36cc |
comparison
equal
deleted
inserted
replaced
36894:ee395147bb28 | 36895:a5c478843c82 |
---|---|
540 vars['style'] = style | 540 vars['style'] = style |
541 | 541 |
542 sessionvars = webutil.sessionvars(vars, r'?') | 542 sessionvars = webutil.sessionvars(vars, r'?') |
543 logourl = config('web', 'logourl') | 543 logourl = config('web', 'logourl') |
544 logoimg = config('web', 'logoimg') | 544 logoimg = config('web', 'logoimg') |
545 staticurl = config('web', 'staticurl') or url + 'static/' | 545 staticurl = (config('web', 'staticurl') |
546 or wsgireq.req.apppath + '/static/') | |
546 if not staticurl.endswith('/'): | 547 if not staticurl.endswith('/'): |
547 staticurl += '/' | 548 staticurl += '/' |
548 | 549 |
549 defaults = { | 550 defaults = { |
550 "encoding": encoding.encoding, | 551 "encoding": encoding.encoding, |