comparison mercurial/hgweb/hgweb_mod.py @ 37511:356e61e82c2a

hgweb: move archivespecs to webutil Move one step further from e38e7ea21987. Since 'archivespecs' is a constant shared with hgweb and hgwebdir, webutil is a better place to define it.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 01 Apr 2018 22:32:34 +0900
parents cb7b275c0cd0
children aac97d043e6d
comparison
equal deleted inserted replaced
37510:876d54f800cf 37511:356e61e82c2a
42 webcommands, 42 webcommands,
43 webutil, 43 webutil,
44 wsgicgi, 44 wsgicgi,
45 ) 45 )
46 46
47 archivespecs = util.sortdict((
48 ('zip', ('application/zip', 'zip', '.zip', None)),
49 ('gz', ('application/x-gzip', 'tgz', '.tar.gz', None)),
50 ('bz2', ('application/x-bzip2', 'tbz2', '.tar.bz2', None)),
51 ))
52
53 def getstyle(req, configfn, templatepath): 47 def getstyle(req, configfn, templatepath):
54 styles = ( 48 styles = (
55 req.qsparams.get('style', None), 49 req.qsparams.get('style', None),
56 configfn('web', 'style'), 50 configfn('web', 'style'),
57 'paper', 51 'paper',
94 self.repo = repo 88 self.repo = repo
95 self.reponame = app.reponame 89 self.reponame = app.reponame
96 self.req = req 90 self.req = req
97 self.res = res 91 self.res = res
98 92
99 self.archivespecs = archivespecs 93 self.archivespecs = webutil.archivespecs
100 94
101 self.maxchanges = self.configint('web', 'maxchanges') 95 self.maxchanges = self.configint('web', 'maxchanges')
102 self.stripecount = self.configint('web', 'stripes') 96 self.stripecount = self.configint('web', 'stripes')
103 self.maxshortchanges = self.configint('web', 'maxshortchanges') 97 self.maxshortchanges = self.configint('web', 'maxshortchanges')
104 self.maxfiles = self.configint('web', 'maxfiles') 98 self.maxfiles = self.configint('web', 'maxfiles')