Commit 7f7c09cf authored by Valentin Samir's avatar Valentin Samir

Extanded get_vcs_info, their are other vcs than git and darcs

parent fd756878
......@@ -47,26 +47,33 @@ fi
#~# get_vcs_info () {
#~# # Donne les infos sur le dépôt VCS courant.
#~# # priorité à git, puis darcs
#~# local BRANCH TYPE violet orange vert
#~# local LBRANCH LTYPE BRANCH TYPE violet orange vert
#~# violet="\[\e[35m\]"
#~# orange="\[\e[33m\]"
#~# vert="\[\e[32m\]"
#~# nocolor="\[\e[0m\]"
#~# BRANCH=$(git branch 2>/dev/null | sed -r "s/^[^*].*$//" | paste -s -d '' | sed -r "s/^[*] //")
#~# if [ -n "$BRANCH" ];
#~# then
#~# TYPE="git"
#~# else
#~# BRANCH=$(darcs show repo 2>/dev/null| egrep '^ *Cache' | sed 's@.*/\([^/]*\),.*@\1@')
#~# if [ -n "$BRANCH" ];
#~# then
#~# TYPE="darcs"
#~# declare -a TYPE
#~# declare -a BRANCH
#~# TYPE[0]="git"
#~# TYPE[1]="mercurial"
#~# TYPE[2]="darcs"
#~# TYPE[3]="svn"
#~# BRANCH[0]='git branch 2>/dev/null | sed -r "s/^[^*].*$//" | paste -s -d "" | sed -r "s/^[*] //"'
#~# BRANCH[1]='hg branch 2>/dev/null'
#~# BRANCH[2]="darcs show repo 2>/dev/null| egrep '^ *Cache' | sed 's@.*/\([^/]*\),.*@\1@'"
#~# BRANCH[3]="svn info 2>/dev/null | head -n 6 | tail -n 1"
#~# for i in $(seq 0 $((${#BRANCH[*]}-1))); do
#~# LBRANCH=$(eval "${BRANCH[$i]}")
#~# if [ -n "$LBRANCH" ]; then
#~# LTYPE="${TYPE[$i]}"
#~# break
#~# fi
#~# fi
#~# if [ -n "$TYPE" ];
#~# done
#~# if [ -n "$LTYPE" ];
#~# then
#~# VCS_info="${nocolor}${violet}(${nocolor}$TYPE${violet})-${violet}[${vert}$BRANCH${violet}]${nocolor}"
#~# VCS_size=$((${#TYPE}+${#BRANCH}+5))
#~# echo $LTYPE
#~# VCS_info="${nocolor}${violet}(${nocolor}$LTYPE${violet})-${violet}[${vert}$LBRANCH${violet}]${nocolor}"
#~# VCS_size=$((${#LTYPE}+${#LBRANCH}+5))
#~# else
#~# VCS_info=""
#~# VCS_size=0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment