From c5abf2bcff289363207e0faae8fd33413f59231f Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sun, 9 Aug 2015 23:53:24 +0200 Subject: 36077: vcs_info: stop exporting everything --- ChangeLog | 15 +++++++++++++++ Functions/VCS_Info/Backends/VCS_INFO_get_data_bzr | 2 +- Functions/VCS_Info/Backends/VCS_INFO_get_data_hg | 2 +- Functions/VCS_Info/Backends/VCS_INFO_get_data_p4 | 2 +- Functions/VCS_Info/Backends/VCS_INFO_get_data_svk | 2 +- Functions/VCS_Info/Backends/VCS_INFO_get_data_svn | 2 +- Functions/VCS_Info/VCS_INFO_formats | 4 ++-- Functions/VCS_Info/VCS_INFO_hook | 4 ++-- Functions/VCS_Info/VCS_INFO_quilt | 6 +++--- Functions/VCS_Info/VCS_INFO_set | 6 +++--- Functions/VCS_Info/vcs_info | 9 +++++---- Functions/VCS_Info/vcs_info_lastmsg | 2 +- Functions/VCS_Info/vcs_info_printsys | 2 +- 13 files changed, 37 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 883fa77f8..398e69f15 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2015-08-12 Mikael Magnusson + + * 36077: Functions/VCS_Info/Backends/VCS_INFO_get_data_bzr, + Functions/VCS_Info/Backends/VCS_INFO_get_data_hg, + Functions/VCS_Info/Backends/VCS_INFO_get_data_p4, + Functions/VCS_Info/Backends/VCS_INFO_get_data_svk, + Functions/VCS_Info/Backends/VCS_INFO_get_data_svn, + Functions/VCS_Info/VCS_INFO_formats, + Functions/VCS_Info/VCS_INFO_hook, + Functions/VCS_Info/VCS_INFO_quilt, + Functions/VCS_Info/VCS_INFO_set, Functions/VCS_Info/vcs_info, + Functions/VCS_Info/vcs_info_lastmsg, + Functions/VCS_Info/vcs_info_printsys: vcs_info: stop exporting + everything + 2015-08-11 Barton E. Schaefer * 36108: NEWS: list of major changes so far since 5.0.8 diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_bzr b/Functions/VCS_Info/Backends/VCS_INFO_get_data_bzr index cae1a3b08..e8c8e81de 100644 --- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_bzr +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_bzr @@ -6,7 +6,7 @@ setopt localoptions noksharrays extendedglob NO_shwordsplit local bzrbase bzrbr bzr_changes bzr_type local -a bzrinfo -local -xA hook_com bzr_info +local -A hook_com bzr_info VCS_INFO_bzr_get_info() { bzrinfo=( ${(s.:.)$( ${vcs_comm[cmd]} version-info --custom \ diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg index 1274ca337..f35ad5965 100644 --- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg @@ -16,7 +16,7 @@ local -a hgid_args defrevformat defbranchformat \ hgbmarks mqpatches mqseries mqguards mqunapplied hgmisc \ i_patchguards i_negguards i_posguards -local -xA hook_com +local -A hook_com hgbase=${vcs_comm[basedir]} rrn=${hgbase:t} diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_p4 b/Functions/VCS_Info/Backends/VCS_INFO_get_data_p4 index 430cfa6f0..329884982 100644 --- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_p4 +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_p4 @@ -6,7 +6,7 @@ setopt localoptions extendedglob local p4base a b local -A p4info -local -xA hook_com +local -A hook_com ${vcs_comm[cmd]} info | while IFS=: read a b; do p4info[${a// /_}]="${b## #}"; done p4base=${vcs_comm[basedir]} diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_svk b/Functions/VCS_Info/Backends/VCS_INFO_get_data_svk index 6107a14f3..1d2d22ffb 100644 --- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_svk +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_svk @@ -4,7 +4,7 @@ setopt localoptions NO_shwordsplit local svkbranch svkbase -local -xA hook_com +local -A hook_com svkbase=${vcs_comm[basedir]} rrn=${svkbase:t} diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn b/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn index e56afee02..e1334f661 100644 --- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn @@ -8,7 +8,7 @@ setopt localoptions noksharrays extendedglob NO_shwordsplit local svnbase svnbranch a b rrn local -i rc local -A svninfo parentinfo cwdinfo -local -xA hook_com +local -A hook_com svnbase="."; svninfo=() diff --git a/Functions/VCS_Info/VCS_INFO_formats b/Functions/VCS_Info/VCS_INFO_formats index 138091944..4d0dd75c2 100644 --- a/Functions/VCS_Info/VCS_INFO_formats +++ b/Functions/VCS_Info/VCS_INFO_formats @@ -5,7 +5,7 @@ setopt localoptions noksharrays NO_shwordsplit local msg tmp local -i i -local -xA hook_com +local -A hook_com # The _origs are needed because hooks can change values and there would # be no way to get the originals back for later hooks (a hook is run for # each message, that's being created). @@ -68,7 +68,7 @@ if [[ -n ${hook_com[unstaged]} ]] ; then fi if [[ ${quiltmode} != 'standalone' ]] && VCS_INFO_hook "pre-addon-quilt"; then - local -x REPLY + local REPLY VCS_INFO_quilt addon hook_com[quilt]="${REPLY}" unset REPLY diff --git a/Functions/VCS_Info/VCS_INFO_hook b/Functions/VCS_Info/VCS_INFO_hook index 479f5968b..94ae63017 100644 --- a/Functions/VCS_Info/VCS_INFO_hook +++ b/Functions/VCS_Info/VCS_INFO_hook @@ -3,8 +3,8 @@ ## Distributed under the same BSD-ish license as zsh itself. local hook static func -local -x context hook_name -local -xi ret +local context hook_name +local -i ret local -a hooks tmp local -i debug diff --git a/Functions/VCS_Info/VCS_INFO_quilt b/Functions/VCS_Info/VCS_INFO_quilt index 34ff1edbf..bc71cfb7d 100644 --- a/Functions/VCS_Info/VCS_INFO_quilt +++ b/Functions/VCS_Info/VCS_INFO_quilt @@ -86,9 +86,9 @@ function VCS_INFO_quilt() { local mode="$1" local patches pc tmp qstring root local -i ret - local -x context + local context local -a applied unapplied all applied_string unapplied_string quiltcommand quilt_env - local -Ax hook_com + local -A hook_com context=":vcs_info:${vcs}.quilt-${mode}:${usercontext}:${rrn}" zstyle -t "${context}" use-quilt || return 1 @@ -183,7 +183,7 @@ function VCS_INFO_quilt() { VCS_INFO_set ;; (addon) - # When VCS_INFO_quilt() is called with "addon" a "local -x REPLY" variable + # When VCS_INFO_quilt() is called with "addon" a "local REPLY" variable # should be in place. That variable can be unset after it's being used. REPLY="${qstring}" ;; diff --git a/Functions/VCS_Info/VCS_INFO_set b/Functions/VCS_Info/VCS_INFO_set index 5087be43f..484c7937d 100644 --- a/Functions/VCS_Info/VCS_INFO_set +++ b/Functions/VCS_Info/VCS_INFO_set @@ -8,7 +8,7 @@ local -i i j if [[ $1 == '--nvcs' ]] ; then [[ $2 == '-preinit-' ]] && (( maxexports == 0 )) && (( maxexports = 1 )) for i in {0..$((maxexports - 1))} ; do - typeset -gx vcs_info_msg_${i}_= + typeset -g vcs_info_msg_${i}_= done VCS_INFO_nvcsformats $2 [[ $2 != '-preinit-' ]] && VCS_INFO_hook "no-vcs" @@ -17,12 +17,12 @@ fi (( ${#msgs} - 1 < 0 )) && return 0 for i in {0..$(( ${#msgs} - 1 ))} ; do (( j = i + 1 )) - typeset -gx vcs_info_msg_${i}_=${msgs[$j]} + typeset -g vcs_info_msg_${i}_=${msgs[$j]} done if (( i < maxexports )) ; then for j in {$(( i + 1 ))..${maxexports}} ; do - [[ -n ${(P)${:-vcs_info_msg_${j}_}} ]] && typeset -gx vcs_info_msg_${j}_= + [[ -n ${(P)${:-vcs_info_msg_${j}_}} ]] && typeset -g vcs_info_msg_${j}_= done fi return 0 diff --git a/Functions/VCS_Info/vcs_info b/Functions/VCS_Info/vcs_info index 46938691d..350b189e9 100644 --- a/Functions/VCS_Info/vcs_info +++ b/Functions/VCS_Info/vcs_info @@ -51,10 +51,11 @@ vcs_info () { local pat local -i found retval local -a enabled disabled dps - local -x usercontext vcs rrn quiltmode LC_MESSAGES - local -ix maxexports - local -ax msgs - local -Ax vcs_comm hook_com backend_misc user_data + local usercontext vcs rrn quiltmode + local -x LC_MESSAGES + local -i maxexports + local -a msgs + local -A vcs_comm hook_com backend_misc user_data LC_MESSAGES=C if [[ -n ${LC_ALL} ]]; then diff --git a/Functions/VCS_Info/vcs_info_lastmsg b/Functions/VCS_Info/vcs_info_lastmsg index ddfaaf88b..438567cef 100644 --- a/Functions/VCS_Info/vcs_info_lastmsg +++ b/Functions/VCS_Info/vcs_info_lastmsg @@ -5,7 +5,7 @@ emulate -L zsh local -i i -local -ix maxexports +local -i maxexports VCS_INFO_maxexports for i in {0..$((maxexports - 1))} ; do diff --git a/Functions/VCS_Info/vcs_info_printsys b/Functions/VCS_Info/vcs_info_printsys index f29061463..b44b9c9b4 100644 --- a/Functions/VCS_Info/vcs_info_printsys +++ b/Functions/VCS_Info/vcs_info_printsys @@ -7,7 +7,7 @@ setopt extendedglob local sys local -a disabled enabled -local -Ax vcs_comm +local -A vcs_comm zstyle -a ":vcs_info:-init-:${1:-default}:-all-" "enable" enabled (( ${#enabled} == 0 )) && enabled=( all ) -- cgit 1.4.1