From 673c664cb0b8f84fd7e1b10d4efff99988ae7e1d Mon Sep 17 00:00:00 2001 From: shiludeng Date: Fri, 6 Feb 2015 19:09:15 +0800 Subject: [PATCH] update svn plugin for untracked filed --- plugins/svn/svn.plugin.zsh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/svn/svn.plugin.zsh b/plugins/svn/svn.plugin.zsh index ef6da5bd3..a9c39b6db 100644 --- a/plugins/svn/svn.plugin.zsh +++ b/plugins/svn/svn.plugin.zsh @@ -61,18 +61,21 @@ function svn_get_rev_nr() { function svn_dirty_choose() { if in_svn; then root=`svn info 2> /dev/null | sed -n 's/^Working Copy Root Path: //p'` - if $(svn status $root 2> /dev/null | grep -Eq '^\s*[ACDIM!?L]'); then + status_str=`svn status $root 2> /dev/null` + if $(echo $status_str | grep -Eq '^\s*[ACDIM!L]'); then # Grep exits with 0 when "One or more lines were selected", return "dirty". echo $1 + elif $(echo $status_str | grep -Eq '^\s*[?]'); then + echo $2 else # Otherwise, no lines were found, or an error occurred. Return clean. - echo $2 + echo $3 fi fi } function svn_dirty() { - svn_dirty_choose $ZSH_THEME_SVN_PROMPT_DIRTY $ZSH_THEME_SVN_PROMPT_CLEAN + svn_dirty_choose $ZSH_THEME_SVN_PROMPT_DIRTY $ZSH_THEME_SVN_PROMPT_UNTRACKED $ZSH_THEME_SVN_PROMPT_CLEAN } function svn_dirty_choose_pwd () {