#!/bin/zsh url="$(sed -rn 's:\+: :g;s:%:\\x:g;s:^(.*&)?i=([^&]+)(&.*)?$:\2:p' <<<"${QUERY_STRING}")" url="$(echo -e "${url}" |sed -rn '1{s:\t: :g;s:\r::g;s:\\:\\\\:g;p}')" rev="$(sed -rn 's:\+: :g;s:%:\\x:g;s:^(.*&)?r=([0-9a-fA-F]+)(&.*)?$:\2:p' <<<"${QUERY_STRING}")" baseuri=$(sed -rn 's:^gitRepo=(.*)$:\1:p' project.meta) [ -z "$rev" ] && rev="HEAD" cat <

Path:

[root] $(tmp=$url until [ -z "$tmp" -o "$tmp" = // ]; do echo "/$(basename "$tmp") " tmp=$(dirname "$tmp")/ done |tac)

Tags:

$(for i in {1.."$lastrev"}; do echo "$i" done)

Branches:

$(for i in {1.."$lastrev"}; do echo "$i" done) :g; s:^r([0-9]+) \| ([a-zA-Z0-9]+) \| ([0-9: -]+) .+$:

Revision \1 by \2
at \3

:g;p}')

$(basename "$url"), Revision "$rev":

$(if (egrep -q '^(.*/|)$' <<<"$url"); then #are we showing a directory svn ls -r "$rev" "${baseuri}/${url}" |sed -r "s:^.*$:&
:g" echo '
' else #or are we showing a file lang=$(source-highlight --lang-list |cut -d\ -f1 |grep -x "$(sed 's:.*\.::g' <<<"$url")" || echo sh) grep -q '\.' <<<"$url" || lang=txt svn cat -r "$rev" "${baseuri}/${url}" |source-highlight -s "$lang" fi)
SVNEND