mercurial/hgweb/hgwebdir_mod.py
changeset 3542 c3043ebe40a0
parent 3483 8f02223662c8
child 3543 f7dee427cd14
equal deleted inserted replaced
3541:881064004fd0 3542:c3043ebe40a0
    85                                              "footer": footer,
    85                                              "footer": footer,
    86                                              "motd": motd,
    86                                              "motd": motd,
    87                                              "url": url})
    87                                              "url": url})
    88 
    88 
    89         def archivelist(ui, nodeid, url):
    89         def archivelist(ui, nodeid, url):
    90             allowed = ui.configlist("web", "allow_archive")
    90             allowed = ui.configlist("web", "allow_archive", untrusted=True)
    91             for i in [('zip', '.zip'), ('gz', '.tar.gz'), ('bz2', '.tar.bz2')]:
    91             for i in [('zip', '.zip'), ('gz', '.tar.gz'), ('bz2', '.tar.bz2')]:
    92                 if i[0] in allowed or ui.configbool("web", "allow" + i[0]):
    92                 if i[0] in allowed or ui.configbool("web", "allow" + i[0],
       
    93                                                     untrusted=True):
    93                     yield {"type" : i[0], "extension": i[1],
    94                     yield {"type" : i[0], "extension": i[1],
    94                            "node": nodeid, "url": url}
    95                            "node": nodeid, "url": url}
    95 
    96 
    96         def entries(sortcolumn="", descending=False, **map):
    97         def entries(sortcolumn="", descending=False, **map):
    97             def sessionvars(**map):
    98             def sessionvars(**map):
   112                 u = ui.ui()
   113                 u = ui.ui()
   113                 try:
   114                 try:
   114                     u.readconfig(os.path.join(path, '.hg', 'hgrc'))
   115                     u.readconfig(os.path.join(path, '.hg', 'hgrc'))
   115                 except IOError:
   116                 except IOError:
   116                     pass
   117                     pass
   117                 get = u.config
   118                 def get(section, name, default=None):
       
   119                     return u.config(section, name, default, untrusted=True)
   118 
   120 
   119                 url = ('/'.join([req.env["REQUEST_URI"].split('?')[0], name])
   121                 url = ('/'.join([req.env["REQUEST_URI"].split('?')[0], name])
   120                        .replace("//", "/")) + '/'
   122                        .replace("//", "/")) + '/'
   121 
   123 
   122                 # update time with local timezone
   124                 # update time with local timezone