##// END OF EJS Templates
hgweb: move archivespecs to webutil...
Yuya Nishihara -
r37529:356e61e8 default
parent child Browse files
Show More
@@ -44,12 +44,6 b' from . import ('
44 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 47 def getstyle(req, configfn, templatepath):
54 48 styles = (
55 49 req.qsparams.get('style', None),
@@ -96,7 +90,7 b' class requestcontext(object):'
96 90 self.req = req
97 91 self.res = res
98 92
99 self.archivespecs = archivespecs
93 self.archivespecs = webutil.archivespecs
100 94
101 95 self.maxchanges = self.configint('web', 'maxchanges')
102 96 self.stripecount = self.configint('web', 'stripes')
@@ -109,7 +109,7 b' def archivelist(ui, nodeid, url):'
109 109 allowed = ui.configlist('web', 'allow_archive', untrusted=True)
110 110 archives = []
111 111
112 for typ, spec in hgweb_mod.archivespecs.iteritems():
112 for typ, spec in webutil.archivespecs.iteritems():
113 113 if typ in allowed or ui.configbool('web', 'allow' + typ,
114 114 untrusted=True):
115 115 archives.append({
@@ -43,6 +43,12 b' from ..utils import ('
43 43 stringutil,
44 44 )
45 45
46 archivespecs = util.sortdict((
47 ('zip', ('application/zip', 'zip', '.zip', None)),
48 ('gz', ('application/x-gzip', 'tgz', '.tar.gz', None)),
49 ('bz2', ('application/x-bzip2', 'tbz2', '.tar.bz2', None)),
50 ))
51
46 52 def up(p):
47 53 if p[0:1] != "/":
48 54 p = "/" + p
General Comments 0
You need to be logged in to leave comments. Login now