diff options
Diffstat (limited to 'Functions/VCS_Info/Backends')
23 files changed, 443 insertions, 0 deletions
diff --git a/Functions/VCS_Info/Backends/.distfiles b/Functions/VCS_Info/Backends/.distfiles new file mode 100644 index 000000000..e39e9c71c --- /dev/null +++ b/Functions/VCS_Info/Backends/.distfiles @@ -0,0 +1,24 @@ +DISTFILES_SRC=' +VCS_INFO_detect_bzr +VCS_INFO_detect_cdv +VCS_INFO_detect_cvs +VCS_INFO_detect_darcs +VCS_INFO_detect_git +VCS_INFO_detect_hg +VCS_INFO_detect_mtn +VCS_INFO_detect_p4 +VCS_INFO_detect_svk +VCS_INFO_detect_svn +VCS_INFO_detect_tla +VCS_INFO_get_data_bzr +VCS_INFO_get_data_cdv +VCS_INFO_get_data_cvs +VCS_INFO_get_data_darcs +VCS_INFO_get_data_git +VCS_INFO_get_data_hg +VCS_INFO_get_data_mtn +VCS_INFO_get_data_p4 +VCS_INFO_get_data_svk +VCS_INFO_get_data_svn +VCS_INFO_get_data_tla +' diff --git a/Functions/VCS_Info/Backends/VCS_INFO_detect_bzr b/Functions/VCS_Info/Backends/VCS_INFO_detect_bzr new file mode 100644 index 000000000..0b12fb54f --- /dev/null +++ b/Functions/VCS_Info/Backends/VCS_INFO_detect_bzr @@ -0,0 +1,12 @@ +## vim:ft=zsh +## bazaar support by: Frank Terbeck <ft@bewatermyfriend.org> +## Distributed under the same BSD-ish license as zsh itself. + +setopt localoptions NO_shwordsplit + +[[ $1 == '--flavours' ]] && return 1 + +VCS_INFO_check_com bzr || return 1 +vcs_comm[detect_need_file]=branch/format +VCS_INFO_bydir_detect '.bzr' +return $? diff --git a/Functions/VCS_Info/Backends/VCS_INFO_detect_cdv b/Functions/VCS_Info/Backends/VCS_INFO_detect_cdv new file mode 100644 index 000000000..356bd069c --- /dev/null +++ b/Functions/VCS_Info/Backends/VCS_INFO_detect_cdv @@ -0,0 +1,12 @@ +## vim:ft=zsh +## codeville support by: Frank Terbeck <ft@bewatermyfriend.org> +## Distributed under the same BSD-ish license as zsh itself. + +setopt localoptions NO_shwordsplit + +[[ $1 == '--flavours' ]] && return 1 + +VCS_INFO_check_com cdv || return 1 +vcs_comm[detect_need_file]=format +VCS_INFO_bydir_detect '.cdv' +return $? diff --git a/Functions/VCS_Info/Backends/VCS_INFO_detect_cvs b/Functions/VCS_Info/Backends/VCS_INFO_detect_cvs new file mode 100644 index 000000000..61b43cc43 --- /dev/null +++ b/Functions/VCS_Info/Backends/VCS_INFO_detect_cvs @@ -0,0 +1,11 @@ +## vim:ft=zsh +## cvs support by: Frank Terbeck <ft@bewatermyfriend.org> +## Distributed under the same BSD-ish license as zsh itself. + +setopt localoptions NO_shwordsplit + +[[ $1 == '--flavours' ]] && return 1 + +VCS_INFO_check_com svn || return 1 +[[ -d "./CVS" ]] && [[ -r "./CVS/Repository" ]] && return 0 +return 1 diff --git a/Functions/VCS_Info/Backends/VCS_INFO_detect_darcs b/Functions/VCS_Info/Backends/VCS_INFO_detect_darcs new file mode 100644 index 000000000..942d8afbb --- /dev/null +++ b/Functions/VCS_Info/Backends/VCS_INFO_detect_darcs @@ -0,0 +1,12 @@ +## vim:ft=zsh +## darcs support by: Frank Terbeck <ft@bewatermyfriend.org> +## Distributed under the same BSD-ish license as zsh itself. + +setopt localoptions NO_shwordsplit + +[[ $1 == '--flavours' ]] && return 1 + +VCS_INFO_check_com darcs || return 1 +vcs_comm[detect_need_file]=format +VCS_INFO_bydir_detect '_darcs' +return $? diff --git a/Functions/VCS_Info/Backends/VCS_INFO_detect_git b/Functions/VCS_Info/Backends/VCS_INFO_detect_git new file mode 100644 index 000000000..627b8cf23 --- /dev/null +++ b/Functions/VCS_Info/Backends/VCS_INFO_detect_git @@ -0,0 +1,15 @@ +## vim:ft=zsh +## git support by: Frank Terbeck <ft@bewatermyfriend.org> +## Distributed under the same BSD-ish license as zsh itself. + +setopt localoptions NO_shwordsplit + +[[ $1 == '--flavours' ]] && { print -l git-p4 git-svn; return 0 } + +if VCS_INFO_check_com git && git rev-parse --is-inside-work-tree &> /dev/null ; then + vcs_comm[gitdir]="$(git rev-parse --git-dir 2> /dev/null)" || return 1 + if [[ -d ${vcs_comm[gitdir]}/svn ]] ; then vcs_comm[overwrite_name]='git-svn' + elif [[ -d ${vcs_comm[gitdir]}/refs/remotes/p4 ]] ; then vcs_comm[overwrite_name]='git-p4' ; fi + return 0 +fi +return 1 diff --git a/Functions/VCS_Info/Backends/VCS_INFO_detect_hg b/Functions/VCS_Info/Backends/VCS_INFO_detect_hg new file mode 100644 index 000000000..8a6c0c8a6 --- /dev/null +++ b/Functions/VCS_Info/Backends/VCS_INFO_detect_hg @@ -0,0 +1,12 @@ +## vim:ft=zsh +## mercurial support by: Frank Terbeck <ft@bewatermyfriend.org> +## Distributed under the same BSD-ish license as zsh itself. + +setopt localoptions NO_shwordsplit + +[[ $1 == '--flavours' ]] && return 1 + +VCS_INFO_check_com hg || return 1 +vcs_comm[detect_need_file]=branch +VCS_INFO_bydir_detect '.hg' +return $? diff --git a/Functions/VCS_Info/Backends/VCS_INFO_detect_mtn b/Functions/VCS_Info/Backends/VCS_INFO_detect_mtn new file mode 100644 index 000000000..cb0fec1bd --- /dev/null +++ b/Functions/VCS_Info/Backends/VCS_INFO_detect_mtn @@ -0,0 +1,12 @@ +## vim:ft=zsh +## monotone support by: Frank Terbeck <ft@bewatermyfriend.org> +## Distributed under the same BSD-ish license as zsh itself. + +setopt localoptions NO_shwordsplit + +[[ $1 == '--flavours' ]] && return 1 + +VCS_INFO_check_com mtn || return 1 +vcs_comm[detect_need_file]=revision +VCS_INFO_bydir_detect '_MTN' +return $? diff --git a/Functions/VCS_Info/Backends/VCS_INFO_detect_p4 b/Functions/VCS_Info/Backends/VCS_INFO_detect_p4 new file mode 100644 index 000000000..3cd649a0d --- /dev/null +++ b/Functions/VCS_Info/Backends/VCS_INFO_detect_p4 @@ -0,0 +1,9 @@ +## vim:ft=zsh +## perforce support by: Phil Pennock +## Distributed under the same BSD-ish license as zsh itself. + +[[ -n ${P4CONFIG} ]] || return 1 +VCS_INFO_check_com p4 || return 1 +vcs_comm[detect_need_file]="${P4CONFIG}" +VCS_INFO_bydir_detect . +return $? diff --git a/Functions/VCS_Info/Backends/VCS_INFO_detect_svk b/Functions/VCS_Info/Backends/VCS_INFO_detect_svk new file mode 100644 index 000000000..476b59101 --- /dev/null +++ b/Functions/VCS_Info/Backends/VCS_INFO_detect_svk @@ -0,0 +1,40 @@ +## vim:ft=zsh +## svk support by: Frank Terbeck <ft@bewatermyfriend.org> +## Distributed under the same BSD-ish license as zsh itself. + +setopt localoptions NO_shwordsplit + +[[ $1 == '--flavours' ]] && return 1 + +# This detection function is a bit different from the others. +# We need to read svk's config file to detect a svk repository +# in the first place. Therefore, we'll just proceed and read +# the other information, too. This is more then any of the +# other detections do but this takes only one file open for +# svk at most. VCS_INFO_get_data_svk() gets simpler, too. :-) + +setopt localoptions noksharrays extendedglob +local -i fhash +fhash=0 + +VCS_INFO_check_com svk || return 1 +[[ -f ~/.svk/config ]] || return 1 + +while IFS= read -r line ; do + if [[ -n ${vcs_comm[basedir]} ]] ; then + line=${line## ##} + [[ ${line} == depotpath:* ]] && vcs_comm[branch]=${line##*/} + [[ ${line} == revision:* ]] && vcs_comm[revision]=${line##*[[:space:]]##} + [[ -n ${vcs_comm[branch]} ]] && [[ -n ${vcs_comm[revision]} ]] && break + continue + fi + (( fhash > 0 )) && [[ ${line} == ' '[^[:space:]]*:* ]] && break + [[ ${line} == ' hash:'* ]] && fhash=1 && continue + (( fhash == 0 )) && continue + [[ ${PWD}/ == ${${line## ##}%:*}/* ]] && vcs_comm[basedir]=${${line## ##}%:*} +done < ~/.svk/config + +[[ -n ${vcs_comm[basedir]} ]] && \ +[[ -n ${vcs_comm[branch]} ]] && \ +[[ -n ${vcs_comm[revision]} ]] && return 0 +return 1 diff --git a/Functions/VCS_Info/Backends/VCS_INFO_detect_svn b/Functions/VCS_Info/Backends/VCS_INFO_detect_svn new file mode 100644 index 000000000..f22c34ee5 --- /dev/null +++ b/Functions/VCS_Info/Backends/VCS_INFO_detect_svn @@ -0,0 +1,11 @@ +## vim:ft=zsh +## subversion support by: Frank Terbeck <ft@bewatermyfriend.org> +## Distributed under the same BSD-ish license as zsh itself. + +setopt localoptions NO_shwordsplit + +[[ $1 == '--flavours' ]] && return 1 + +VCS_INFO_check_com svn || return 1 +[[ -d ".svn" ]] && return 0 +return 1 diff --git a/Functions/VCS_Info/Backends/VCS_INFO_detect_tla b/Functions/VCS_Info/Backends/VCS_INFO_detect_tla new file mode 100644 index 000000000..3b2042897 --- /dev/null +++ b/Functions/VCS_Info/Backends/VCS_INFO_detect_tla @@ -0,0 +1,11 @@ +## vim:ft=zsh +## gnu arch support by: Frank Terbeck <ft@bewatermyfriend.org> +## Distributed under the same BSD-ish license as zsh itself. + +setopt localoptions NO_shwordsplit + +[[ $1 == '--flavours' ]] && return 1 + +VCS_INFO_check_com tla || return 1 +vcs_comm[basedir]="$(tla tree-root 2> /dev/null)" && return 0 +return 1 diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_bzr b/Functions/VCS_Info/Backends/VCS_INFO_get_data_bzr new file mode 100644 index 000000000..995b2ad2d --- /dev/null +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_bzr @@ -0,0 +1,26 @@ +## vim:ft=zsh +## bazaar support by: Frank Terbeck <ft@bewatermyfriend.org> +## Distributed under the same BSD-ish license as zsh itself. + +setopt localoptions noksharrays extendedglob NO_shwordsplit +local bzrbase bzrbr +local -a bzrinfo + +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)"$( bzr info )"}:# ##branch\ root:*}/*: ##/} + bzrinfo=( ${${${(M)${(f)"$( bzr version-info )"}:#(#s)(revno|branch-nick)*}/*: /}/*\//} ) + bzrbase="$(VCS_INFO_realpath ${bzrbase})" +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}" +return 0 diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_cdv b/Functions/VCS_Info/Backends/VCS_INFO_get_data_cdv new file mode 100644 index 000000000..be8b4d837 --- /dev/null +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_cdv @@ -0,0 +1,11 @@ +## vim:ft=zsh +## codeville support by: Frank Terbeck <ft@bewatermyfriend.org> +## Distributed under the same BSD-ish license as zsh itself. + +setopt localoptions NO_shwordsplit +local cdvbase + +cdvbase=${vcs_comm[basedir]} +rrn=${cdvbase:t} +VCS_INFO_formats '' "${cdvbase:t}" "${cdvbase}" +return 0 diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_cvs b/Functions/VCS_Info/Backends/VCS_INFO_get_data_cvs new file mode 100644 index 000000000..fa1ceca02 --- /dev/null +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_cvs @@ -0,0 +1,18 @@ +## vim:ft=zsh +## cvs support by: Frank Terbeck <ft@bewatermyfriend.org> +## Distributed under the same BSD-ish license as zsh itself. + +setopt localoptions NO_shwordsplit +local cvsbranch cvsbase + +cvsbase="." +while [[ -d "${cvsbase}/../CVS" ]]; do + cvsbase="${cvsbase}/.." +done +cvsbase="$(VCS_INFO_realpath ${cvsbase})" +cvsbranch=$(< ./CVS/Repository) +rrn=${cvsbase:t} +cvsbranch=${cvsbranch##${rrn}/} +[[ -z ${cvsbranch} ]] && cvsbranch=${rrn} +VCS_INFO_formats '' "${cvsbranch}" "${cvsbase}" +return 0 diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_darcs b/Functions/VCS_Info/Backends/VCS_INFO_get_data_darcs new file mode 100644 index 000000000..9fd3554ca --- /dev/null +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_darcs @@ -0,0 +1,11 @@ +## vim:ft=zsh +## darcs support by: Frank Terbeck <ft@bewatermyfriend.org> +## Distributed under the same BSD-ish license as zsh itself. + +setopt localoptions NO_shwordsplit +local darcsbase + +darcsbase=${vcs_comm[basedir]} +rrn=${darcsbase:t} +VCS_INFO_formats '' "${darcsbase:t}" "${darcsbase}" +return 0 diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git new file mode 100644 index 000000000..0d8a4f915 --- /dev/null +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git @@ -0,0 +1,104 @@ +## vim:ft=zsh +## git support by: Frank Terbeck <ft@bewatermyfriend.org> +## Distributed under the same BSD-ish license as zsh itself. + +setopt localoptions extendedglob NO_shwordsplit +local gitdir gitbase gitbranch gitaction + +VCS_INFO_git_getaction () { + local gitaction='' gitdir=$1 + local tmp + + for tmp in "${gitdir}/rebase-apply" \ + "${gitdir}/rebase" \ + "${gitdir}/../.dotest" ; do + if [[ -d ${tmp} ]] ; then + if [[ -f "${tmp}/rebasing" ]] ; then + gitaction="rebase" + elif [[ -f "${tmp}/applying" ]] ; then + gitaction="am" + else + gitaction="am/rebase" + fi + printf '%s' ${gitaction} + return 0 + fi + done + + for tmp in "${gitdir}/rebase-merge/interactive" \ + "${gitdir}/.dotest-merge/interactive" ; do + if [[ -f "${tmp}" ]] ; then + printf '%s' "rebase-i" + return 0 + fi + done + + for tmp in "${gitdir}/rebase-merge" \ + "${gitdir}/.dotest-merge" ; do + if [[ -d "${tmp}" ]] ; then + printf '%s' "rebase-m" + return 0 + fi + done + + if [[ -f "${gitdir}/MERGE_HEAD" ]] ; then + printf '%s' "merge" + return 0 + fi + + if [[ -f "${gitdir}/BISECT_LOG" ]] ; then + printf '%s' "bisect" + return 0 + fi + return 1 +} + +VCS_INFO_git_getbranch () { + local gitbranch gitdir=$1 + local gitsymref='git symbolic-ref HEAD' + + if [[ -d "${gitdir}/rebase-apply" ]] \ + || [[ -d "${gitdir}/rebase" ]] \ + || [[ -d "${gitdir}/../.dotest" ]] \ + || [[ -f "${gitdir}/MERGE_HEAD" ]] ; then + gitbranch="$(${(z)gitsymref} 2> /dev/null)" + [[ -z ${gitbranch} ]] && [[ -r ${gitdir}/rebase-apply/head-name ]] \ + && gitbranch="$(< ${gitdir}/rebase-apply/head-name)" + + elif [[ -f "${gitdir}/rebase-merge/interactive" ]] \ + || [[ -d "${gitdir}/rebase-merge" ]] ; then + gitbranch="$(< ${gitdir}/rebase-merge/head-name)" + + elif [[ -f "${gitdir}/.dotest-merge/interactive" ]] \ + || [[ -d "${gitdir}/.dotest-merge" ]] ; then + gitbranch="$(< ${gitdir}/.dotest-merge/head-name)" + + else + gitbranch="$(${(z)gitsymref} 2> /dev/null)" + + if [[ $? -ne 0 ]] ; then + gitbranch="$(git describe --exact-match HEAD 2>/dev/null)" + + if [[ $? -ne 0 ]] ; then + gitbranch="${${"$(< $gitdir/HEAD)"}[1,7]}..." + fi + fi + fi + + printf '%s' "${gitbranch##refs/heads/}" + return 0 +} + +gitdir=${vcs_comm[gitdir]} +gitbranch="$(VCS_INFO_git_getbranch ${gitdir})" + +if [[ -z ${gitdir} ]] || [[ -z ${gitbranch} ]] ; then + return 1 +fi + +VCS_INFO_adjust +gitaction="$(VCS_INFO_git_getaction ${gitdir})" +gitbase=${PWD%/${$( git rev-parse --show-prefix )%/##}} +rrn=${gitbase:t} +VCS_INFO_formats "${gitaction}" "${gitbranch}" "${gitbase}" +return 0 diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg new file mode 100644 index 000000000..af9d85c5f --- /dev/null +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg @@ -0,0 +1,12 @@ +## vim:ft=zsh +## mercurial support by: Frank Terbeck <ft@bewatermyfriend.org> +## Distributed under the same BSD-ish license as zsh itself. + +setopt localoptions NO_shwordsplit +local hgbranch hgbase + +hgbase=${vcs_comm[basedir]} +rrn=${hgbase:t} +hgbranch=$(< ${hgbase}/.hg/branch) +VCS_INFO_formats '' "${hgbranch}" "${hgbase}" +return 0 diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_mtn b/Functions/VCS_Info/Backends/VCS_INFO_get_data_mtn new file mode 100644 index 000000000..5974df87a --- /dev/null +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_mtn @@ -0,0 +1,12 @@ +## vim:ft=zsh +## monotone support by: Frank Terbeck <ft@bewatermyfriend.org> +## Distributed under the same BSD-ish license as zsh itself. + +setopt localoptions extendedglob NO_shwordsplit +local mtnbranch mtnbase + +mtnbase=${vcs_comm[basedir]} +rrn=${mtnbase:t} +mtnbranch=${${(M)${(f)"$( mtn status )"}:#(#s)Current branch:*}/*: /} +VCS_INFO_formats '' "${mtnbranch}" "${mtnbase}" +return 0 diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_p4 b/Functions/VCS_Info/Backends/VCS_INFO_get_data_p4 new file mode 100644 index 000000000..82ca6ef1c --- /dev/null +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_p4 @@ -0,0 +1,14 @@ +## vim:ft=zsh +## perforce support by: Phil Pennock +## Distributed under the same BSD-ish license as zsh itself. + +# XXX: This soooo needs to be cached +setopt localoptions extendedglob +local p4base a b +local -A p4info + +p4 info | while IFS=: read a b; do p4info[${a// /_}]="${b## #}"; done +p4base=${vcs_comm[basedir]} + +# We'll use the client name as the branch; close enough +VCS_INFO_formats '' "${p4info[Client_name]}" "${p4base}" diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_svk b/Functions/VCS_Info/Backends/VCS_INFO_get_data_svk new file mode 100644 index 000000000..fa9548c03 --- /dev/null +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_svk @@ -0,0 +1,13 @@ +## vim:ft=zsh +## svk support by: Frank Terbeck <ft@bewatermyfriend.org> +## Distributed under the same BSD-ish license as zsh itself. + +setopt localoptions NO_shwordsplit +local svkbranch svkbase + +svkbase=${vcs_comm[basedir]} +rrn=${svkbase:t} +zstyle -s ":vcs_info:${vcs}:${usercontext}:${rrn}" branchformat svkbranch || svkbranch="%b:%r" +zformat -f svkbranch "${svkbranch}" "b:${vcs_comm[branch]}" "r:${vcs_comm[revision]}" +VCS_INFO_formats '' "${svkbranch}" "${svkbase}" +return 0 diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn b/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn new file mode 100644 index 000000000..7a23419b0 --- /dev/null +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn @@ -0,0 +1,28 @@ +## vim:ft=zsh +## subversion support by: +## + Frank Terbeck <ft@bewatermyfriend.org> +## + Phil Pennock +## Distributed under the same BSD-ish license as zsh itself. + +setopt localoptions noksharrays extendedglob NO_shwordsplit +local svnbase svnbranch a b rrn +local -A svninfo parentinfo + +svnbase="."; +svninfo=() +svn info --non-interactive | while IFS=: read a b; do svninfo[${a// /_}]="${b## #}"; done +while [[ -d "${svnbase}/../.svn" ]]; do + parentinfo=() + svn info --non-interactive "${svnbase}/.." | while IFS=: read a b; do parentinfo[${a// /_}]="${b## #}"; done + [[ ${parentinfo[Repository_UUID]} != ${svninfo[Repository_UUID]} ]] && break + svninfo=(${(kv)parentinfo}) + svnbase="${svnbase}/.." +done + +svnbase="$(VCS_INFO_realpath ${svnbase})" + +rrn=${svnbase:t} +zstyle -s ":vcs_info:${vcs}:${usercontext}:${rrn}" branchformat svnbranch || svnbranch="%b:%r" +zformat -f svnbranch "${svnbranch}" "b:${svninfo[URL]##*/}" "r:${svninfo[Revision]}" +VCS_INFO_formats '' "${svnbranch}" "${svnbase}" +return 0 diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_tla b/Functions/VCS_Info/Backends/VCS_INFO_get_data_tla new file mode 100644 index 000000000..e1921725f --- /dev/null +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_tla @@ -0,0 +1,13 @@ +## vim:ft=zsh +## gnu arch support by: Frank Terbeck <ft@bewatermyfriend.org> +## Distributed under the same BSD-ish license as zsh itself. + +setopt localoptions extendedglob NO_shwordsplit +local tlabase tlabranch + +tlabase="$(VCS_INFO_realpath ${vcs_comm[basedir]})" +rrn=${tlabase:t} +# tree-id gives us something like 'foo@example.com/demo--1.0--patch-4', so: +tlabranch=${${"$( tla tree-id )"}/*\//} +VCS_INFO_formats '' "${tlabranch}" "${tlabase}" +return 0 |