diff options
author | Frank Terbeck <bewater@users.sourceforge.net> | 2010-05-10 10:46:48 +0000 |
---|---|---|
committer | Frank Terbeck <bewater@users.sourceforge.net> | 2010-05-10 10:46:48 +0000 |
commit | 0501efc54af2d194f952c2968a7aeeb5bac8fdf4 (patch) | |
tree | 9d632c46950c434594cc46263e35558018912b20 /Functions/VCS_Info/vcs_info | |
parent | 144a06bf958b4e573fd3c78eab30536349d09cff (diff) | |
download | zsh-0501efc54af2d194f952c2968a7aeeb5bac8fdf4.tar.gz zsh-0501efc54af2d194f952c2968a7aeeb5bac8fdf4.tar.xz zsh-0501efc54af2d194f952c2968a7aeeb5bac8fdf4.zip |
Seth House, Simon Ruderich and myself: 27948: various vcs_info changes
Here's a diff-stat: Doc/Zsh/contrib.yo | 506 ++++++++++++++------- Functions/VCS_Info/.distfiles | 1 + Functions/VCS_Info/Backends/VCS_INFO_detect_hg | 14 +- Functions/VCS_Info/Backends/VCS_INFO_get_data_git | 35 +- Functions/VCS_Info/Backends/VCS_INFO_get_data_hg | 295 +++++++++---- Functions/VCS_Info/VCS_INFO_formats | 26 +- Functions/VCS_Info/VCS_INFO_hook | 10 +- Functions/VCS_Info/VCS_INFO_quilt | 190 ++++++++ Functions/VCS_Info/vcs_info | 30 +- Misc/.distfiles | 1 + Misc/vcs_info-examples | 496 ++++++++++++++++++++ 11 files changed, 1303 insertions(+), 301 deletions(-) The major changes are vast improvements for the mercurial (hg) backend (which was done almost entirely by Seth); improved documentation (mostly done by Simon and again Seth); quilt support (as an addon and stand alone, see the manual for details); a number of new hooks and a fair share of bugfixes.
Diffstat (limited to 'Functions/VCS_Info/vcs_info')
-rw-r--r-- | Functions/VCS_Info/vcs_info | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/Functions/VCS_Info/vcs_info b/Functions/VCS_Info/vcs_info index 7ae11230e..6ce1cd702 100644 --- a/Functions/VCS_Info/vcs_info +++ b/Functions/VCS_Info/vcs_info @@ -21,6 +21,7 @@ static_functions=( VCS_INFO_hook VCS_INFO_maxexports VCS_INFO_nvcsformats + VCS_INFO_quilt VCS_INFO_realpath VCS_INFO_reposub VCS_INFO_set @@ -45,12 +46,12 @@ vcs_info () { [[ -r . ]] || return 0 local pat - local -i found + local -i found retval local -a enabled disabled dps - local -x usercontext vcs rrn LC_MESSAGES + local -x usercontext vcs rrn quiltmode LC_MESSAGES local -ix maxexports local -ax msgs - local -Ax vcs_comm + local -Ax vcs_comm hook_com backend_misc user_data LC_MESSAGES=C if [[ -n ${LC_ALL} ]]; then @@ -58,9 +59,18 @@ vcs_info () { LANG=${LC_ALL} local -x LC_ALL fi - vcs='-init-'; rrn='-all-' + vcs='-init-'; rrn='-all-'; quiltmode='addon' usercontext=${1:-default} + VCS_INFO_hook "start-up" + retval=$? + if (( retval == 1 )); then + return 0 + elif (( retval == 2 )); then + VCS_INFO_set --nvcs + return 0 + fi + zstyle -a ":vcs_info:${vcs}:${usercontext}:${rrn}" "enable" enabled (( ${#enabled} == 0 )) && enabled=( all ) @@ -99,10 +109,20 @@ vcs_info () { done (( found == 0 )) && { - VCS_INFO_set --nvcs + vcs='-quilt-'; quiltmode='standalone' + VCS_INFO_quilt standalone || VCS_INFO_set --nvcs return 0 } + VCS_INFO_hook "pre-get-data" + retval=$? + if (( retval == 1 )); then + return 0 + elif (( retval == 2 )); then + VCS_INFO_set --nvcs + return 0 + fi + VCS_INFO_get_data_${vcs} || { VCS_INFO_set --nvcs return 1 |