summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugues Hiegel <hugues@hiegel.fr>2008-03-17 15:11:35 +0100
committerHugues Hiegel <hugues@hiegel.fr>2008-03-18 10:25:22 +0100
commitcdb83832e1084ec9416110e78ff23171a4c0cbe0 (patch)
treefd819a5fda45bc4bd8d30816c03ed4e430f36e9d
parent15b62e4841e3c36a7ac96f1d4ade8757cca0acda (diff)
svn tracking.
-rw-r--r--11_Prompts.zsh14
1 files changed, 13 insertions, 1 deletions
diff --git a/11_Prompts.zsh b/11_Prompts.zsh
index babb165..3c490fe 100644
--- a/11_Prompts.zsh
+++ b/11_Prompts.zsh
@@ -153,6 +153,18 @@ old_precmd()
## Second line of prompt : don't let the path garbage the entire line
##
+ # get svn status
+ #
+ SVNREV=$(LC_ALL=C svn info 2>&- $PWD | awk '/^Revision: / {print $2}')
+ SVNREVSIZE=${#${SVNREV:+:r$SVNREV}}
+ if [ "$SVNREV" != "" ]
+ then
+ SVNSTATUS="$(svn status 2>&-)"
+ SVNSTATUS=${SVNSTATUS:+$prompt_colors[not_up_to_date]}
+ SVNSTATUS=${SVNSTATUS:-$prompt_colors[up_to_date]}
+ fi
+ SVNREV=${SVNREV:+$C_$prompt_colors[doubledot]$_C:$C_$SVNSTATUS$_C"r"$SVNREV}
+
# get git status
#
GITBRANCH=$(get_git_branch)
@@ -199,7 +211,7 @@ old_precmd()
# Note que pour le pwd, on n'affiche que les 4 derniers dossiers pour éviter
# de pourrir le fenêtre de terminal avec un prompt à rallonge.
PS1="$MAILSTAT""$ERROR"$C_$prompt_colors[bar]$_C"$HBAR""$DATE
-"$C_$prompt_colors[user]$_C"%n"$C_$prompt_colors[arob]$_C"@"$C_$prompt_colors[host]$_C"%m $CURDIR$GITBRANCH "$C_$prompt_colors[dies]$_C"%#"$C_$prompt_colors[cmd]$_C" "
+"$C_$prompt_colors[user]$_C"%n"$C_$prompt_colors[arob]$_C"@"$C_$prompt_colors[host]$_C"%m $CURDIR$SVNREV$GITBRANCH "$C_$prompt_colors[dies]$_C"%#"$C_$prompt_colors[cmd]$_C" "
}