Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/hgwebdir_mod.py @ 4843:496ac05c6a31
hgwebdir: show only trailing part of path when browsing subdirectories
author | Brendan Cully <brendan@kublai.com> |
---|---|
date | Thu, 05 Jul 2007 19:56:16 -0700 |
parents | 9b0ebb5e0f94 |
children | 4f86c58c6c56 |
comparison
equal
deleted
inserted
replaced
4842:d39776752a1f | 4843:496ac05c6a31 |
---|---|
138 rows = [] | 138 rows = [] |
139 parity = paritygen(self.stripecount) | 139 parity = paritygen(self.stripecount) |
140 for name, path in self.repos: | 140 for name, path in self.repos: |
141 if not name.startswith(subdir): | 141 if not name.startswith(subdir): |
142 continue | 142 continue |
143 name = name[len(subdir):] | |
143 | 144 |
144 u = ui.ui(parentui=parentui) | 145 u = ui.ui(parentui=parentui) |
145 try: | 146 try: |
146 u.readconfig(os.path.join(path, '.hg', 'hgrc')) | 147 u.readconfig(os.path.join(path, '.hg', 'hgrc')) |
147 except IOError: | 148 except IOError: |
150 return u.config(section, name, default, untrusted=True) | 151 return u.config(section, name, default, untrusted=True) |
151 | 152 |
152 if u.configbool("web", "hidden", untrusted=True): | 153 if u.configbool("web", "hidden", untrusted=True): |
153 continue | 154 continue |
154 | 155 |
155 url = ('/'.join([req.env["REQUEST_URI"].split('?')[0], name[len(subdir):]]) | 156 url = ('/'.join([req.env["REQUEST_URI"].split('?')[0], name]) |
156 .replace("//", "/")) + '/' | 157 .replace("//", "/")) + '/' |
157 | 158 |
158 # update time with local timezone | 159 # update time with local timezone |
159 try: | 160 try: |
160 d = (get_mtime(path), util.makedate()[1]) | 161 d = (get_mtime(path), util.makedate()[1]) |