mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-01-19 23:41:31 +01:00
0501efc54a
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.
46 lines
1.3 KiB
Bash
46 lines
1.3 KiB
Bash
### vim:ft=zsh:foldmethod=marker
|
|
## Written by Frank Terbeck <ft@bewatermyfriend.org>
|
|
## Distributed under the same BSD-ish license as zsh itself.
|
|
|
|
local hook func
|
|
local -x context hook_name
|
|
local -xi ret
|
|
local -a hooks
|
|
local -i debug
|
|
|
|
ret=0
|
|
hook_name="$1"
|
|
shift
|
|
context=":vcs_info:${vcs}+${hook_name}:${usercontext}:${rrn}"
|
|
|
|
zstyle -t "${context}" debug && debug=1 || debug=0
|
|
if (( debug )); then
|
|
printf 'VCS_INFO_hook: running hook: "%s"\n' "${hook_name}"
|
|
printf 'VCS_INFO_hook: current context: "%s"\n' "${context}"
|
|
fi
|
|
|
|
zstyle -a "${context}" hooks hooks || return 0
|
|
# Protect some internal variables in hooks. The `-g' parameter to
|
|
# typeset does *not* make the parameters global here (they are already
|
|
# "*-local-export). It prevents typeset from creating *new* *local*
|
|
# parameters in this function's scope.
|
|
typeset -g -r vcs rrn usercontext maxexports msgs vcs_comm
|
|
for hook in ${hooks} ; do
|
|
func="+vi-${hook}"
|
|
if (( ${+functions[$func]} == 0 )); then
|
|
(( debug )) && printf ' + Unknown function: "%s"\n' "${func}"
|
|
continue
|
|
fi
|
|
(( debug )) && printf ' + Running function: "%s"\n' "${func}"
|
|
true
|
|
${func} "$@"
|
|
case $? in
|
|
(0)
|
|
;;
|
|
(*)
|
|
break
|
|
;;
|
|
esac
|
|
done
|
|
typeset -g +r vcs rrn usercontext maxexports msgs vcs_comm
|
|
return $ret
|