+svn_path(){
+ tmp="$url"
+ until [ -z "$tmp" -o "$tmp" = '//' -o "$tmp" = './' ]; do
+ echo "<a href='?p=Subversion&i=$tmp&r=$rev'>/$(basename "$tmp")</a> "
+ tmp="$(dirname "$tmp")/"
+ done \
+ | tac
+}
+
+svn_revisions(){
+ for i in {1.."$lastrev"}; do
+ echo "<a href='?p=Subversion&i=$url&r=$i'>$i</a>"
+ done
+}
+
+svn_changelog(){
+ svn log "${baseuri}/${url}" \
+ | sed -rn '2,${s:^-+$:</div>:g;
+ s:^r([0-9]+) \| ([a-zA-Z0-9]+) \| ([0-9: -]+) .+$:<div class="changelog"><h2>Revision \1 by \2<br>at \3</h2>:g;p}'
+}
+
+svn_showurl(){
+ if (egrep -q '^(.*/|)$' <<<"$url"); then
+ # we are showing a directory
+ svn propget svn:externals -r "$rev" "${baseuri}/${url}" \
+ | sed -rn "s;^([^ ]+) (.+)$;<span class='extern'>\2/</span> [external include from <a href='\1'>\1</a>]<br>;p"
+
+ svn ls -r "$rev" "${baseuri}/${url}" \
+ | sed -r "s:^.*$:<a href='?p=Subversion\&i=$url/&\&r=$rev'>&</a><br>:g"
+ else
+ # we are showing a file
+ echo -E "$url" |egrep -vq '\.' && \
+ lang=txt \
+ || lang=$(
+ source-highlight --lang-list \
+ | grep -o "^${url##*.} " || echo sh
+ )
+ svn cat -r "$rev" "${baseuri}/${url}" \
+ | source-highlight -s "$lang"
+ fi
+}
+