diff mercurial/hgweb/hgwebdir_mod.py @ 3262:3207e30bf468

hgweb: support for generating and parsing NWI URLs
author Brendan Cully <brendan@kublai.com>
date Wed, 04 Oct 2006 17:04:40 -0700
parents 1e322b44b366
children db9d2a624521
line wrap: on
line diff
--- a/mercurial/hgweb/hgwebdir_mod.py
+++ b/mercurial/hgweb/hgwebdir_mod.py
@@ -143,7 +143,12 @@ class hgwebdir(object):
                     yield row
 
         virtual = req.env.get("PATH_INFO", "").strip('/')
-        if virtual:
+        if virtual.startswith('static/'):
+            static = os.path.join(templater.templatepath(), 'static')
+            fname = virtual[7:]
+            req.write(staticfile(static, fname, req) or
+                      tmpl('error', error='%r not found' % fname))
+        elif virtual:
             while virtual:
                 real = dict(self.repos).get(virtual)
                 if real: