# HG changeset patch # User Benoit Boissinot # Date 2008-10-15 19:50:47 # Node ID 14f3ea2ea54fdb9487790fab318d87390df6ea81 # Parent baf12d52add4a3d4d87b8c8370cefaee9943b740 hgweb: cleanup the manifest generation diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py +++ b/mercurial/hgweb/webcommands.py @@ -276,12 +276,11 @@ def manifest(web, req, tmpl): if f[:l] != path: continue remain = f[l:] - if "/" in remain: - short = remain[:remain.index("/") + 1] # bleah - files[short] = (f, None) - else: - short = os.path.basename(remain) - files[short] = (f, n) + idx = remain.find('/') + if idx != -1: + remain = remain[:idx+1] + n = None + files[remain] = (f, n) if not files: raise ErrorResponse(HTTP_NOT_FOUND, 'path not found: ' + path)