Hi, when using web.templates to set an alternative directory for templates the new themes are not used when displaying the repositories. More precisely, the CSS file is not found. If I copy the CSS file in the system directory then it is found by hgweb.
More information : The bug only appears on the index page which share the same header template that contains the link to the CSS file. Others templates work fine with the same header.
Can you show us your config file?
Here it is : [paths] /prj1 = /hg/repos/prj1 /prj2 = /hg/repos/prj2 [web] templates = /hg/templates style = rounded allow_push = hguser allow_archive = gz The bug should be easy to reproduce by copying an existing theme and renaming it's directory name and css file (don't forget to change the css name in the header template). I'll join my new theme if needed.
I see. Turns out hgwebdir handles static paths differently. Try this fix: diff -r 40cc411346d1 mercurial/hgweb/hgwebdir_mod.py --- a/mercurial/hgweb/hgwebdir_mod.py Thu Dec 20 19:22:12 2012 +0100 +++ b/mercurial/hgweb/hgwebdir_mod.py Sat Dec 22 18:09:45 2012 -0600 @@ -184,7 +184,13 @@ fname = virtual[7:] else: fname = req.form['static'][0] - static = templater.templatepath('static') + static = self.ui.config("web", "static", None, + untrusted=False) + if not static: + tp = self.templatepath or templater.templatepath() + if isinstance(tp, str): + tp = [tp] + static = [os.path.join(p, 'static') for p in tp] return (staticfile(static, fname, req),) # top-level index
(In reply to comment #4) It works fine :)
Fixed by http://selenic.com/repo/hg/rev/e4f17956f45a Matt Mackall <mpm@selenic.com> hgwebdir: honor web.templates and web.static for static files (issue3734) (please test the fix)