Show More
@@ -44,12 +44,6 b' from . import (' | |||||
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), | |
@@ -96,7 +90,7 b' class requestcontext(object):' | |||||
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') |
@@ -109,7 +109,7 b' def archivelist(ui, nodeid, url):' | |||||
109 | allowed = ui.configlist('web', 'allow_archive', untrusted=True) |
|
109 | allowed = ui.configlist('web', 'allow_archive', untrusted=True) | |
110 | archives = [] |
|
110 | archives = [] | |
111 |
|
111 | |||
112 |
for typ, spec in |
|
112 | for typ, spec in webutil.archivespecs.iteritems(): | |
113 | if typ in allowed or ui.configbool('web', 'allow' + typ, |
|
113 | if typ in allowed or ui.configbool('web', 'allow' + typ, | |
114 | untrusted=True): |
|
114 | untrusted=True): | |
115 | archives.append({ |
|
115 | archives.append({ |
@@ -43,6 +43,12 b' from ..utils import (' | |||||
43 | stringutil, |
|
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 | def up(p): |
|
52 | def up(p): | |
47 | if p[0:1] != "/": |
|
53 | if p[0:1] != "/": | |
48 | p = "/" + p |
|
54 | p = "/" + p |
General Comments 0
You need to be logged in to leave comments.
Login now