From 0501efc54af2d194f952c2968a7aeeb5bac8fdf4 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Mon, 10 May 2010 10:46:48 +0000 Subject: 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. --- Functions/VCS_Info/VCS_INFO_hook | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Functions/VCS_Info/VCS_INFO_hook') diff --git a/Functions/VCS_Info/VCS_INFO_hook b/Functions/VCS_Info/VCS_INFO_hook index 71845d808..7274d726f 100644 --- a/Functions/VCS_Info/VCS_INFO_hook +++ b/Functions/VCS_Info/VCS_INFO_hook @@ -20,8 +20,11 @@ if (( debug )); then fi zstyle -a "${context}" hooks hooks || return 0 -# protect some internal variables in hooks -typeset -r vcs rrn usercontext maxexports msgs vcs_comm +# 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 @@ -29,6 +32,7 @@ for hook in ${hooks} ; do continue fi (( debug )) && printf ' + Running function: "%s"\n' "${func}" + true ${func} "$@" case $? in (0) @@ -38,5 +42,5 @@ for hook in ${hooks} ; do ;; esac done -typeset +r vcs rrn usercontext maxexports msgs vcs_comm +typeset -g +r vcs rrn usercontext maxexports msgs vcs_comm return $ret -- cgit 1.4.1