hgweb: cleanup the manifest generation
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Wed, 15 Oct 2008 21:50:47 +0200
changeset 7102 14f3ea2ea54f
parent 7100 baf12d52add4
child 7103 7a19053e4bfc
hgweb: cleanup the manifest generation
mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py	Wed Oct 15 16:27:36 2008 +0200
+++ b/mercurial/hgweb/webcommands.py	Wed Oct 15 21:50:47 2008 +0200
@@ -276,12 +276,11 @@
         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)