+function _svn_or_git () {
+ where="$1"; [ -z "$where" ] && where="."
+ pushd $where >& /dev/null
+ cd $(pwd -P)
+ while true; do
+ [ -d .svn ] && { popd >& /dev/null; echo svn ; return ; }
+ [ -d .git ] && { popd >& /dev/null; echo git ; return ; }
+ [ "$(pwd -P)" == "/" ] && { popd >& /dev/null; echo none ; return ; }
+ cd ..
+ done
+}