From c5b1c3d705092f394bb458770dc537712a97b92c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Mengu=C3=A9?= Date: Wed, 4 Dec 2013 22:54:03 +0100 Subject: [PATCH] Fix tabs in source (fossil support) --- liquidprompt | 60 ++++++++++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/liquidprompt b/liquidprompt index 3903b8c..b011c6c 100755 --- a/liquidprompt +++ b/liquidprompt @@ -967,45 +967,45 @@ _lp_fossil_branch_color() local C2E # Modified files (added or edited) local C2D # Deleted files local C2A # Extras files - local C2AA # Added files - local PLUSLINE # Added lines - local MINUSLINE # Deleted lines + local C2AA # Added files + local PLUSLINE # Added lines + local MINUSLINE # Deleted lines local ret C2E=$(fossil changes | wc -l) C2A=$(fossil extras | wc -l) - PLUSLINE=$(fossil diff | egrep '^\+[^+].+$' | wc -l) - MINUSLINE=$(fossil diff | egrep '^-[^-].+$' | wc -l) + PLUSLINE=$(fossil diff | egrep '^\+[^+].+$' | wc -l) + MINUSLINE=$(fossil diff | egrep '^-[^-].+$' | wc -l) ret="" - C2AA=`fossil changes | grep ADDED | wc -l` - if [[ $C2AA -gt 0 ]] ; then - # We count the line "à la" git - local ADDFILE - local FILE - ADDFILE=`fossil changes | grep ADDED | sed -e 's/\s\{2,\}/ /g' | cut -d" " -f2` - for FILE in $ADDFILE ; do - PLULI=$(wc -l $FILE | cut -d" " -f1) - let PLUSLINE=$PLUSLINE+$PLULI - done - fi + C2AA=`fossil changes | grep ADDED | wc -l` + if [[ $C2AA -gt 0 ]] ; then + # We count the line "à la" git + local ADDFILE + local FILE + ADDFILE=`fossil changes | grep ADDED | sed -e 's/\s\{2,\}/ /g' | cut -d" " -f2` + for FILE in $ADDFILE ; do + PLULI=$(wc -l $FILE | cut -d" " -f1) + let PLUSLINE=$PLUSLINE+$PLULI + done + fi if [[ $PLUSLINE -gt 0 ]] ; then - ret+="+$PLUSLINE" - fi + ret+="+$PLUSLINE" + fi - C2D=`fossil changes | grep DELETED | wc -l` - if [[ $C2D -gt 0 ]] ; then - # We count the line "à la" git - local DELFILE - local FILE - DELFILE=`fossil changes | grep DELETED | sed -e 's/\s\{2,\}/ /g' | cut -d" " -f2` - for FILE in $DELFILE ; do - MINLI=$(wc -l $FILE | cut -d" " -f1) - let MINUSLINE=$MINUSLINE+$MINLI - done - fi + C2D=`fossil changes | grep DELETED | wc -l` + if [[ $C2D -gt 0 ]] ; then + # We count the line "à la" git + local DELFILE + local FILE + DELFILE=`fossil changes | grep DELETED | sed -e 's/\s\{2,\}/ /g' | cut -d" " -f2` + for FILE in $DELFILE ; do + MINLI=$(wc -l $FILE | cut -d" " -f1) + let MINUSLINE=$MINUSLINE+$MINLI + done + fi - if [[ $MINUSLINE -gt 0 ]] ; then + if [[ $MINUSLINE -gt 0 ]] ; then if [[ "$ret" = "" ]] ; then ret+="-$MINUSLINE" else