summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobby Russell <robby@planetargon.com>2012-12-01 11:41:17 -0800
committerRobby Russell <robby@planetargon.com>2012-12-01 11:41:17 -0800
commit2aa485ac04016493fcf0c95656609f237f3ada1f (patch)
tree3f50bde1934a7eee6415bb23f3b97b86332046fd
parent3657bf8efa783873d19660cfcb6405ae824ee2cc (diff)
parent120db35b2dd7792b981401f66323e8886668c909 (diff)
downloadzsh-2aa485ac04016493fcf0c95656609f237f3ada1f.tar.gz
zsh-2aa485ac04016493fcf0c95656609f237f3ada1f.tar.bz2
zsh-2aa485ac04016493fcf0c95656609f237f3ada1f.zip
Merge pull request #1435 from Drarok/fix-svn
Fix backwards svn "dirty" state detection
-rw-r--r--plugins/svn/svn.plugin.zsh9
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/svn/svn.plugin.zsh b/plugins/svn/svn.plugin.zsh
index 7ae3897af..e38e8920b 100644
--- a/plugins/svn/svn.plugin.zsh
+++ b/plugins/svn/svn.plugin.zsh
@@ -1,3 +1,4 @@
+
function svn_prompt_info {
if [ $(in_svn) ]; then
if [ "x$SVN_SHOW_BRANCH" = "xtrue" ]; then
@@ -22,7 +23,7 @@ function in_svn() {
function svn_get_repo_name {
if [ $(in_svn) ]; then
svn info | sed -n 's/Repository\ Root:\ .*\///p' | read SVN_ROOT
-
+
svn info | sed -n "s/URL:\ .*$SVN_ROOT\///p"
fi
}
@@ -46,9 +47,11 @@ function svn_get_rev_nr {
function svn_dirty_choose {
if [ $(in_svn) ]; then
svn status 2> /dev/null | grep -Eq '^\s*[ACDIM!?L]'
- if [ $pipestatus[-1] -ne 0 ]; then
+ if [ $pipestatus[-1] -eq 0 ]; then
+ # Grep exits with 0 when "One or more lines were selected", return "dirty".
echo $1
- else
+ else
+ # Otherwise, no lines were found, or an error occurred. Return clean.
echo $2
fi
fi