Mercurial > public > mercurial-scm > hg
comparison mercurial/hgweb/hgweb_mod.py @ 4084:51e52db6b40d
hgweb: allow static files to be served directly by the HTTP server
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Thu, 15 Feb 2007 08:51:32 -0200 |
parents | a3aa97171546 |
children | 49237d6ae97d |
comparison
equal
deleted
inserted
replaced
4083:33c369afec94 | 4084:51e52db6b40d |
---|---|
770 mapfile = style_map(self.templatepath, style) | 770 mapfile = style_map(self.templatepath, style) |
771 | 771 |
772 port = req.env["SERVER_PORT"] | 772 port = req.env["SERVER_PORT"] |
773 port = port != "80" and (":" + port) or "" | 773 port = port != "80" and (":" + port) or "" |
774 urlbase = 'http://%s%s' % (req.env['SERVER_NAME'], port) | 774 urlbase = 'http://%s%s' % (req.env['SERVER_NAME'], port) |
775 staticurl = self.config("web", "staticurl") or req.url + 'static/' | |
776 if not staticurl.endswith('/'): | |
777 staticurl += '/' | |
775 | 778 |
776 if not self.reponame: | 779 if not self.reponame: |
777 self.reponame = (self.config("web", "name") | 780 self.reponame = (self.config("web", "name") |
778 or req.env.get('REPO_NAME') | 781 or req.env.get('REPO_NAME') |
779 or req.url.strip('/') or self.repo.root) | 782 or req.url.strip('/') or self.repo.root) |
780 | 783 |
781 self.t = templater.templater(mapfile, templater.common_filters, | 784 self.t = templater.templater(mapfile, templater.common_filters, |
782 defaults={"url": req.url, | 785 defaults={"url": req.url, |
786 "staticurl": staticurl, | |
783 "urlbase": urlbase, | 787 "urlbase": urlbase, |
784 "repo": self.reponame, | 788 "repo": self.reponame, |
785 "header": header, | 789 "header": header, |
786 "footer": footer, | 790 "footer": footer, |
787 "motd": motd, | 791 "motd": motd, |