diff options
Diffstat (limited to 'zshfunc/vcs-info/VCS_INFO_svn_get_data')
-rw-r--r-- | zshfunc/vcs-info/VCS_INFO_svn_get_data | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/zshfunc/vcs-info/VCS_INFO_svn_get_data b/zshfunc/vcs-info/VCS_INFO_svn_get_data new file mode 100644 index 0000000..fccf016 --- /dev/null +++ b/zshfunc/vcs-info/VCS_INFO_svn_get_data @@ -0,0 +1,17 @@ +VCS_INFO_svn_get_data () { # {{{ + setopt localoptions noksharrays + local svnbase svnbranch + local -a svninfo + + svnbase="." + while [[ -d "${svnbase}/../.svn" ]]; do + svnbase="${svnbase}/.." + done + svnbase="$(VCS_INFO_realpath ${svnbase})" + svninfo=( ${${${(M)${(f)"$( svn info )"}:#(#s)(URL|Revision)*}/*: /}/*\//} ) + + zstyle -s ":vcs_info:${vcs}:${usercontext}" branchformat svnbranch || svnbranch="%b:%r" + zformat -f svnbranch "${svnbranch}" "b:${svninfo[1]}" "r:${svninfo[2]}" + VCS_INFO_formats '' "${svnbranch}" "${svnbase}" + return 0 +} |