comparison 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
comparison
equal deleted inserted replaced
3261:1e322b44b366 3262:3207e30bf468
141 row['parity'] = parity 141 row['parity'] = parity
142 parity = 1 - parity 142 parity = 1 - parity
143 yield row 143 yield row
144 144
145 virtual = req.env.get("PATH_INFO", "").strip('/') 145 virtual = req.env.get("PATH_INFO", "").strip('/')
146 if virtual: 146 if virtual.startswith('static/'):
147 static = os.path.join(templater.templatepath(), 'static')
148 fname = virtual[7:]
149 req.write(staticfile(static, fname, req) or
150 tmpl('error', error='%r not found' % fname))
151 elif virtual:
147 while virtual: 152 while virtual:
148 real = dict(self.repos).get(virtual) 153 real = dict(self.repos).get(virtual)
149 if real: 154 if real:
150 break 155 break
151 up = virtual.rfind('/') 156 up = virtual.rfind('/')