4 [ -n "$TOPDIR" ] && cd $TOPDIR
7 [ -f version ] || return 1
13 [ -d .svn ] || return 1
14 REV="$(svn info | awk '/^Last Changed Rev:/ { print $4 }')"
20 [ -e .git ] || return 1
21 REV="$(git log | grep -m 1 git-svn-id | awk '{ gsub(/.*@/, "", $0); print $1 }')"
27 [ -d .hg ] || return 1
28 REV="$(hg log -r-1 --template '{desc}' | awk '{print $2}' | sed 's/\].*//')"
33 try_version || try_svn || try_git || try_hg || REV="unknown"