changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > werc / changeset: When more than one file with the same 'name' (eg., foo.md, foo.html) do not display it more than once in dir listings.

changeset 652: 1b95f0539231
parent 651: fce7c8747d57
child 653: e1cb72de8a51
author: Uriel <u@berlinblue.org>
date: Tue, 28 Jun 2011 03:48:22 +0000
files: bin/corehandlers.rc
description: When more than one file with the same 'name' (eg., foo.md, foo.html) do not display it more than once in dir listings.
     1.1--- a/bin/corehandlers.rc	Tue Jun 28 01:50:24 2011 +0000
     1.2+++ b/bin/corehandlers.rc	Tue Jun 28 03:48:22 2011 +0000
     1.3@@ -77,7 +77,7 @@
     1.4         d='/'
     1.5     echo $d|sed 's,.*//,,g; s,/$,,; s,/, / ,g; s/[\-_]/ /g; s,.*,<h1 class="dir-list-head">&</h1> <ul class="dir-list">,'
     1.6     # Symlinks suck: '/.' forces ls to list the linked dir if $d is a symlink.
     1.7-    ls -F $dir_listing_ls_opts $sitedir$d/. | sed $dirfilter$dirclean | awk '{match($0, "/[^/]*/?$"); l=substr($0, RSTART+1, RLENGTH-1);n=l; gsub(/[\-_]/, " ", n); print "<li><a href=\""l"\">"n"</a></li>"; }'
     1.8+    ls -F $dir_listing_ls_opts $sitedir$d/. | sed $dirfilter$dirclean | awk '{match($0, "/[^/]*/?$"); l=substr($0, RSTART+1, RLENGTH-1);n=l; gsub(/[\-_]/, " ", n); print "<li><a href=\""l"\">"n"</a></li>"; }' | uniq
     1.9     echo '</ul>'
    1.10 }
    1.11