Mercurial > public > mercurial-scm > hg
comparison mercurial/hgweb/hgweb_mod.py @ 37514:034a422aeaff
hgweb: forward archivelist() of hgweb to webutil
self.configlist() is ui.configlist(untrusted=True), and url=None in templater
effectively means 'url' is undefined.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 01 Apr 2018 22:40:15 +0900 |
parents | aac97d043e6d |
children | b29f490eb904 |
comparison
equal
deleted
inserted
replaced
37513:40a7c1dd2df9 | 37514:034a422aeaff |
---|---|
126 def configlist(self, section, name, default=uimod._unset, untrusted=True): | 126 def configlist(self, section, name, default=uimod._unset, untrusted=True): |
127 return self.repo.ui.configlist(section, name, default, | 127 return self.repo.ui.configlist(section, name, default, |
128 untrusted=untrusted) | 128 untrusted=untrusted) |
129 | 129 |
130 def archivelist(self, nodeid): | 130 def archivelist(self, nodeid): |
131 allowed = self.configlist('web', 'allow_archive') | 131 return webutil.archivelist(self.repo.ui, nodeid) |
132 for typ, spec in webutil.archivespecs.iteritems(): | |
133 if typ in allowed or self.configbool('web', 'allow%s' % typ): | |
134 yield {'type': typ, 'extension': spec[2], 'node': nodeid} | |
135 | 132 |
136 def templater(self, req): | 133 def templater(self, req): |
137 # determine scheme, port and server name | 134 # determine scheme, port and server name |
138 # this is needed to create absolute urls | 135 # this is needed to create absolute urls |
139 logourl = self.config('web', 'logourl') | 136 logourl = self.config('web', 'logourl') |