#!/bin/bash function get_terminal_width() { python -c " import sys, rxvtlib width, height = rxvtlib.get_terminal_size() sys.exit(width)" } if [ -x /usr/bin/svn ] then SVN=/usr/bin/svn else SVN=/usr/local/bin/svn fi case $1 in diff) if isatty then $SVN "$@" | diffpipe.py | less else $SVN "$@" fi ;; log) if detect_rxvt.py then shift 1; ~/pypy/user/arigo/hack/rxvt-metadata/python/svnlog.py "$@" | less -r else $SVN "$@" fi;; blame|praise|annotate|ann) if detect_rxvt.py then shift 1; get_terminal_width WIDTH=$? $SVN blame "$@" | cut -b -$WIDTH | blamepipe.py "$@" | less -r else $SVN "$@" fi;; show) shift 1; if isatty then svnshow.py "$@" | less else svnshow.py "$@" fi;; f|viewwc) shift 1; viewwc.py "$@" ;; *) $SVN "$@" ;; esac