Merge pull request #1389 from martinus/master

Improved subversion support for powerline
pull/1394/head
Nils Winkler 2019-07-08 08:41:06 +02:00 committed by GitHub
commit 498f3b41f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -87,6 +87,7 @@ function scm {
elif [[ -d .hg ]] && which hg &> /dev/null; then SCM=$SCM_HG
elif which hg &> /dev/null && [[ -n "$(hg root 2> /dev/null)" ]]; then SCM=$SCM_HG
elif [[ -d .svn ]] && which svn &> /dev/null; then SCM=$SCM_SVN
elif which svn &> /dev/null && [[ -n "$(svn info --show-item wc-root 2>/dev/null)" ]]; then SCM=$SCM_SVN
else SCM=$SCM_NONE
fi
}

View File

@ -98,6 +98,8 @@ function __powerline_scm_prompt {
scm_prompt+="${SCM_CHAR}${SCM_BRANCH}${SCM_STATE}"
elif [[ "${SCM_HG_CHAR}" == "${SCM_CHAR}" ]]; then
scm_prompt+="${SCM_CHAR}${SCM_BRANCH}${SCM_STATE}"
elif [[ "${SCM_SVN_CHAR}" == "${SCM_CHAR}" ]]; then
scm_prompt+="${SCM_CHAR}${SCM_BRANCH}${SCM_STATE}"
fi
echo "$(eval "echo ${scm_prompt}")${scm}|${color}"
fi