From b7f617bf8d11c59e95e963a8bdf5396ea8219160 Mon Sep 17 00:00:00 2001 From: handsomecheung Date: Wed, 16 Jan 2013 13:55:50 +0800 Subject: [PATCH] add $SVN_DIRTY_COUNT to display count of dirty --- plugins/svn/svn.plugin.zsh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/svn/svn.plugin.zsh b/plugins/svn/svn.plugin.zsh index 659dee97a..981e4b174 100644 --- a/plugins/svn/svn.plugin.zsh +++ b/plugins/svn/svn.plugin.zsh @@ -1,4 +1,4 @@ - +SVN_DIRTY_COUNT="svn_dirty_count_string_wait_for_replacement" function svn_prompt_info { if [ $(in_svn) ]; then if [ "x$SVN_SHOW_BRANCH" = "xtrue" ]; then @@ -47,13 +47,14 @@ function svn_get_rev_nr { function svn_dirty_choose { if [ $(in_svn) ]; then if [ "x$ZSH_THEME_SVN_NUVC_IN_DIRTY" = "x0" ]; then - svn status 2> /dev/null | grep -Eq '^\s*[ACDIM!L]' + svn status 2> /dev/null | grep -Ec '^\s*[ACDIM!L]' | read DIRTY_COUNT else - svn status 2> /dev/null | grep -Eq '^\s*[ACDIM!?L]' + svn status 2> /dev/null | grep -Ec '^\s*[ACDIM!?L]' | read DIRTY_COUNT fi - if [ $pipestatus[-1] -eq 0 ]; then + if [ "x$DIRTY_COUNT" != "x0" ]; then # Grep exits with 0 when "One or more lines were selected", return "dirty". - echo $1 + echo -e $1 | sed -e "s/${SVN_DIRTY_COUNT}/${DIRTY_COUNT}/g" | read output + echo $output else # Otherwise, no lines were found, or an error occurred. Return clean. echo $2