changeset 7287:6e9fe4ff9c54

hgweb: handle subdirectories within static directory
author Brendan Cully <brendan@kublai.com>
date Tue, 28 Oct 2008 21:58:30 -0700
parents a1f8ad3c1821
children 9c399c53469d
files mercurial/hgweb/hgweb_mod.py
diffstat 1 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/hgweb_mod.py	Tue Oct 28 21:31:21 2008 -0700
+++ b/mercurial/hgweb/hgweb_mod.py	Tue Oct 28 21:58:30 2008 -0700
@@ -141,15 +141,16 @@
             else:
                 cmd = ''
 
-            if args and args[0]:
-                node = args.pop(0)
-                req.form['node'] = [node]
-            if args:
-                req.form['file'] = args
+            if cmd == 'static':
+                req.form['file'] = ['/'.join(args)]
+            else:
+                if args and args[0]:
+                    node = args.pop(0)
+                    req.form['node'] = [node]
+                if args:
+                    req.form['file'] = args
 
-            if cmd == 'static':
-                req.form['file'] = req.form['node']
-            elif cmd == 'archive':
+            if cmd == 'archive':
                 fn = req.form['node'][0]
                 for type_, spec in self.archive_specs.iteritems():
                     ext = spec[2]