# The third part of the prompt is taken from p4-completion.bashrc.
# It is shown only if __ps1_p4 is 1. By default it is 0.
#
-# The fourth part of the prompt is the exit status of the last command.
+# The fourth part of the prompt is taken from svn-completion.bashrc.
+# It is shown only if __ps1_svn is 1. By default it is 0.
+#
+# The fifth part of the prompt is the exit status of the last command.
# This part will be shown only if __ps1_user is set and the exit status is
# non-zero.
#
# Failed: dark red.
# Git: royal blue.
# P4: yellow.
+# SVN: magenta.
case $(tput colors) in
256)
export PROMPT_OK_COLOUR="1;38;5;34"
export PROMPT_FAILED_COLOUR="1;38;5;160"
export GIT_COLOUR="0;38;5;33"
+ export SVN_COLOUR="0;38;5;127"
export P4_COLOUR="0;38;5;142"
;;
export PROMPT_OK_COLOUR="1;38;5;24"
export PROMPT_FAILED_COLOUR="1;38;5;48"
export GIT_COLOUR="0;38;5;23"
+ export SVN_COLOUR="0;38;5;49"
export P4_COLOUR="0;38;5;56"
;;
export PROMPT_OK_COLOUR="1;32"
export PROMPT_FAILED_COLOUR="1;31"
export GIT_COLOUR="0;36"
+ export SVN_COLOUR="0;35"
export P4_COLOUR="0;33"
;;
esac
# Default __ps1_user to 1.
[ -z "$__ps1_user" ] && __ps1_user=1
- export PS1='$(__ps1_user $? \u@)\[\033[$(__ps1_col $? 2>/dev/null)m\]$(__ps1_user $? \h)\[\033[${GIT_COLOUR}m\]$(__ps1_git $? 2>/dev/null)\[\033[0m\]\[\033[${P4_COLOUR}m\]$(__ps1_p4 $? 2>/dev/null)\[\033[0m\]$(__ps1_ret $? 2>/dev/null):\w\$ '
+ export PS1='$(__ps1_user $? \u@)\[\033[$(__ps1_col $? 2>/dev/null)m\]$(__ps1_user $? \h)\[\033[${GIT_COLOUR}m\]$(__ps1_git $? 2>/dev/null)\[\033[0m\]\[\033[${P4_COLOUR}m\]$(__ps1_p4 $? 2>/dev/null)\[\033[0m\]\[\033[${SVN_COLOUR}m\]$(__ps1_svn $? 2>/dev/null)\[\033[0m\]$(__ps1_ret $? 2>/dev/null):\w\$ '
return 0
}
return $1
}
+function __ps1_svn() {
+ [ "$__ps1_svn" = "1" ] || return $1
+ if [ "$__ps1_user" = "1" -o "$__ps1_git" = "1" -o "$__ps1_p4" = "1" ]; then
+ __svn_ps1 ' %s'
+ else
+ __svn_ps1 '%s'
+ fi
+ return $1
+}
+
function prompt() {
local blurb="Usage: prompt hide|show <what>"