fed807655a4e6196bcca417f02cf237c9d89ef68
- Author
- Robby Russell <robby@planetargon.com>
- Committer
- Robby Russell <robby@planetargon.com>
- Date
Message
Merge pull request #2607 from avonderluft/dev
Show svn dirty on current dir, as well as whole working copy
Diff
1diff --git a/plugins/svn/svn.plugin.zsh b/plugins/svn/svn.plugin.zsh
2index 4f008ba4e219d986f9c5515c209ffec68da2a68e..ef6da5bd3cb6e6447e59c224fc8a158ecc1ac590 100644
3--- a/plugins/svn/svn.plugin.zsh
4+++ b/plugins/svn/svn.plugin.zsh
5@@ -9,7 +9,7 @@ function svn_prompt_info() {
6 _DISPLAY=$(svn_get_repo_name)
7 fi
8 echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_PREFIX\
9-$ZSH_THEME_REPO_NAME_COLOR$_DISPLAY$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_SUFFIX$ZSH_PROMPT_BASE_COLOR$(svn_dirty)$ZSH_PROMPT_BASE_COLOR"
10+$ZSH_THEME_REPO_NAME_COLOR$_DISPLAY$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_SUFFIX$ZSH_PROMPT_BASE_COLOR$(svn_dirty)$(svn_dirty_pwd)$ZSH_PROMPT_BASE_COLOR"
11 unset _DISPLAY
12 fi
13 }
14@@ -74,3 +74,22 @@ function svn_dirty_choose() {
15 function svn_dirty() {
16 svn_dirty_choose $ZSH_THEME_SVN_PROMPT_DIRTY $ZSH_THEME_SVN_PROMPT_CLEAN
17 }
18+
19+function svn_dirty_choose_pwd () {
20+ if in_svn; then
21+ root=`pwd`
22+ if $(svn status $root 2> /dev/null | grep -Eq '^\s*[ACDIM!?L]'); then
23+ # Grep exits with 0 when "One or more lines were selected", return "dirty".
24+ echo $1
25+ else
26+ # Otherwise, no lines were found, or an error occurred. Return clean.
27+ echo $2
28+ fi
29+ fi
30+}
31+
32+function svn_dirty_pwd () {
33+ svn_dirty_choose_pwd $ZSH_THEME_SVN_PROMPT_DIRTY_PWD $ZSH_THEME_SVN_PROMPT_CLEAN_PWD
34+}
35+
36+