1 # Get UUID for the working copy.
2 function __svn_uuid() {
3 svn info 2>/dev/null | sed -n 's/^Repository UUID: //p'
10 local uuid=$(__svn_uuid)
12 # Bomb out if we ended up in an unexecutable directory.
13 if [ ! -x "$PWD" ]; then
17 # Return the last directory if we just changed and found a different repo.
18 if [ -n "$last" -a ! "$uuid" = "$last" ]; then
27 if [ "$PWD" = "$OLDPWD" ]; then
35 # Find the URL for the working copy and detect if we are on trunk.
36 function __svn_url() {
37 local url=$(svn info "$1" 2>/dev/null | sed -n 's/^URL: //p')
38 [ $? -gt 0 ] && return 1
39 if [ "${url##*/}" = "trunk" ]; then
46 function __svn_ps1() {
47 local base="$(__svn_dir)"
48 [ -z "$base" ] && return
50 local ps1=$(__svn_url "$base")
55 if [ -n "${SVN_PS1_SHOWDIRTYSTATE-}" ]; then
57 if [ -n "${SVN_PS1_DEPTH-}" ]; then
58 depth="--depth=$SVN_PS1_DEPTH"
60 flags=$(svn status $depth "$base" 2>/dev/null | cut -c 1 | sort | uniq)
61 if [ -n "$flags" ]; then
62 if [ ! "${flags/[~!?]/}" = "$flags" ]; then
65 if [ ! "${flags/[ACDMR]/}" = "$flags" ]; then
71 if [ -n "${1-}" ]; then