From dd5427baaf49f8de4355abeb6bc8c6dd14f74e25 Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Wed, 7 Oct 2009 17:05:19 +0200 Subject: Initial check-in of files --- .zsh/functions/VCS_INFO_get_data_bzr | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .zsh/functions/VCS_INFO_get_data_bzr (limited to '.zsh/functions') diff --git a/.zsh/functions/VCS_INFO_get_data_bzr b/.zsh/functions/VCS_INFO_get_data_bzr new file mode 100644 index 0000000..374988a --- /dev/null +++ b/.zsh/functions/VCS_INFO_get_data_bzr @@ -0,0 +1,33 @@ +## vim:ft=zsh +## bazaar support by: Frank Terbeck +## Distributed under the same BSD-ish license as zsh itself. + +## Modified by René 'Necoro' Neumann + +setopt localoptions noksharrays extendedglob NO_shwordsplit +local bzrbase bzrbr +local -a bzrinfo +local bzrunstaged + +if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" "use-simple" ; then + bzrbase=${vcs_comm[basedir]} + bzrinfo[2]=${bzrbase:t} + if [[ -f ${bzrbase}/.bzr/branch/last-revision ]] ; then + bzrinfo[1]=$(< ${bzrbase}/.bzr/branch/last-revision) + bzrinfo[1]=${${bzrinfo[1]}%% *} + fi +else + bzrbase=${${(M)${(f)"$( ${vcs_comm[cmd]} info )"}:# ##branch\ root:*}/*: ##/} + bzrinfo=( ${${${(M)${(f)"$( ${vcs_comm[cmd]} version-info )"}:#(#s)(revno|branch-nick)*}/*: /}/*\//} ) + bzrbase="$(VCS_INFO_realpath ${bzrbase})" + + if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" "check-for-changes" ; then + [[ -n $(${vcs_comm[cmd]} status -S -V 2> /dev/null) && $? == 0 ]] && bzrunstaged=1 + fi +fi + +rrn=${bzrbase:t} +zstyle -s ":vcs_info:${vcs}:${usercontext}:${rrn}" branchformat bzrbr || bzrbr="%b:%r" +zformat -f bzrbr "${bzrbr}" "b:${bzrinfo[2]}" "r:${bzrinfo[1]}" +VCS_INFO_formats '' "${bzrbr}" "${bzrbase}" '' "${bzrunstaged}" "${bzrinfo[1]}" '' +return 0 -- cgit v1.2.3-54-g00ecf