1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-27 16:50:58 +01:00

36077: vcs_info: stop exporting everything

This commit is contained in:
Mikael Magnusson 2015-08-09 23:53:24 +02:00
parent c21a3fddf4
commit c5abf2bcff
13 changed files with 37 additions and 21 deletions

View file

@ -1,3 +1,18 @@
2015-08-12 Mikael Magnusson <mikachu@gmail.com>
* 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 <schaefer@zsh.org> 2015-08-11 Barton E. Schaefer <schaefer@zsh.org>
* 36108: NEWS: list of major changes so far since 5.0.8 * 36108: NEWS: list of major changes so far since 5.0.8

View file

@ -6,7 +6,7 @@
setopt localoptions noksharrays extendedglob NO_shwordsplit setopt localoptions noksharrays extendedglob NO_shwordsplit
local bzrbase bzrbr bzr_changes bzr_type local bzrbase bzrbr bzr_changes bzr_type
local -a bzrinfo local -a bzrinfo
local -xA hook_com bzr_info local -A hook_com bzr_info
VCS_INFO_bzr_get_info() { VCS_INFO_bzr_get_info() {
bzrinfo=( ${(s.:.)$( ${vcs_comm[cmd]} version-info --custom \ bzrinfo=( ${(s.:.)$( ${vcs_comm[cmd]} version-info --custom \

View file

@ -16,7 +16,7 @@ local -a hgid_args defrevformat defbranchformat \
hgbmarks mqpatches mqseries mqguards mqunapplied hgmisc \ hgbmarks mqpatches mqseries mqguards mqunapplied hgmisc \
i_patchguards i_negguards i_posguards i_patchguards i_negguards i_posguards
local -xA hook_com local -A hook_com
hgbase=${vcs_comm[basedir]} hgbase=${vcs_comm[basedir]}
rrn=${hgbase:t} rrn=${hgbase:t}

View file

@ -6,7 +6,7 @@
setopt localoptions extendedglob setopt localoptions extendedglob
local p4base a b local p4base a b
local -A p4info 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 ${vcs_comm[cmd]} info | while IFS=: read a b; do p4info[${a// /_}]="${b## #}"; done
p4base=${vcs_comm[basedir]} p4base=${vcs_comm[basedir]}

View file

@ -4,7 +4,7 @@
setopt localoptions NO_shwordsplit setopt localoptions NO_shwordsplit
local svkbranch svkbase local svkbranch svkbase
local -xA hook_com local -A hook_com
svkbase=${vcs_comm[basedir]} svkbase=${vcs_comm[basedir]}
rrn=${svkbase:t} rrn=${svkbase:t}

View file

@ -8,7 +8,7 @@ setopt localoptions noksharrays extendedglob NO_shwordsplit
local svnbase svnbranch a b rrn local svnbase svnbranch a b rrn
local -i rc local -i rc
local -A svninfo parentinfo cwdinfo local -A svninfo parentinfo cwdinfo
local -xA hook_com local -A hook_com
svnbase="."; svnbase=".";
svninfo=() svninfo=()

View file

@ -5,7 +5,7 @@
setopt localoptions noksharrays NO_shwordsplit setopt localoptions noksharrays NO_shwordsplit
local msg tmp local msg tmp
local -i i local -i i
local -xA hook_com local -A hook_com
# The _origs are needed because hooks can change values and there would # 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 # be no way to get the originals back for later hooks (a hook is run for
# each message, that's being created). # each message, that's being created).
@ -68,7 +68,7 @@ if [[ -n ${hook_com[unstaged]} ]] ; then
fi fi
if [[ ${quiltmode} != 'standalone' ]] && VCS_INFO_hook "pre-addon-quilt"; then if [[ ${quiltmode} != 'standalone' ]] && VCS_INFO_hook "pre-addon-quilt"; then
local -x REPLY local REPLY
VCS_INFO_quilt addon VCS_INFO_quilt addon
hook_com[quilt]="${REPLY}" hook_com[quilt]="${REPLY}"
unset REPLY unset REPLY

View file

@ -3,8 +3,8 @@
## Distributed under the same BSD-ish license as zsh itself. ## Distributed under the same BSD-ish license as zsh itself.
local hook static func local hook static func
local -x context hook_name local context hook_name
local -xi ret local -i ret
local -a hooks tmp local -a hooks tmp
local -i debug local -i debug

View file

@ -86,9 +86,9 @@ function VCS_INFO_quilt() {
local mode="$1" local mode="$1"
local patches pc tmp qstring root local patches pc tmp qstring root
local -i ret local -i ret
local -x context local context
local -a applied unapplied all applied_string unapplied_string quiltcommand quilt_env 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}" context=":vcs_info:${vcs}.quilt-${mode}:${usercontext}:${rrn}"
zstyle -t "${context}" use-quilt || return 1 zstyle -t "${context}" use-quilt || return 1
@ -183,7 +183,7 @@ function VCS_INFO_quilt() {
VCS_INFO_set VCS_INFO_set
;; ;;
(addon) (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. # should be in place. That variable can be unset after it's being used.
REPLY="${qstring}" REPLY="${qstring}"
;; ;;

View file

@ -8,7 +8,7 @@ local -i i j
if [[ $1 == '--nvcs' ]] ; then if [[ $1 == '--nvcs' ]] ; then
[[ $2 == '-preinit-' ]] && (( maxexports == 0 )) && (( maxexports = 1 )) [[ $2 == '-preinit-' ]] && (( maxexports == 0 )) && (( maxexports = 1 ))
for i in {0..$((maxexports - 1))} ; do for i in {0..$((maxexports - 1))} ; do
typeset -gx vcs_info_msg_${i}_= typeset -g vcs_info_msg_${i}_=
done done
VCS_INFO_nvcsformats $2 VCS_INFO_nvcsformats $2
[[ $2 != '-preinit-' ]] && VCS_INFO_hook "no-vcs" [[ $2 != '-preinit-' ]] && VCS_INFO_hook "no-vcs"
@ -17,12 +17,12 @@ fi
(( ${#msgs} - 1 < 0 )) && return 0 (( ${#msgs} - 1 < 0 )) && return 0
for i in {0..$(( ${#msgs} - 1 ))} ; do for i in {0..$(( ${#msgs} - 1 ))} ; do
(( j = i + 1 )) (( j = i + 1 ))
typeset -gx vcs_info_msg_${i}_=${msgs[$j]} typeset -g vcs_info_msg_${i}_=${msgs[$j]}
done done
if (( i < maxexports )) ; then if (( i < maxexports )) ; then
for j in {$(( i + 1 ))..${maxexports}} ; do 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 done
fi fi
return 0 return 0

View file

@ -51,10 +51,11 @@ vcs_info () {
local pat local pat
local -i found retval local -i found retval
local -a enabled disabled dps local -a enabled disabled dps
local -x usercontext vcs rrn quiltmode LC_MESSAGES local usercontext vcs rrn quiltmode
local -ix maxexports local -x LC_MESSAGES
local -ax msgs local -i maxexports
local -Ax vcs_comm hook_com backend_misc user_data local -a msgs
local -A vcs_comm hook_com backend_misc user_data
LC_MESSAGES=C LC_MESSAGES=C
if [[ -n ${LC_ALL} ]]; then if [[ -n ${LC_ALL} ]]; then

View file

@ -5,7 +5,7 @@
emulate -L zsh emulate -L zsh
local -i i local -i i
local -ix maxexports local -i maxexports
VCS_INFO_maxexports VCS_INFO_maxexports
for i in {0..$((maxexports - 1))} ; do for i in {0..$((maxexports - 1))} ; do

View file

@ -7,7 +7,7 @@ setopt extendedglob
local sys local sys
local -a disabled enabled local -a disabled enabled
local -Ax vcs_comm local -A vcs_comm
zstyle -a ":vcs_info:-init-:${1:-default}:-all-" "enable" enabled zstyle -a ":vcs_info:-init-:${1:-default}:-all-" "enable" enabled
(( ${#enabled} == 0 )) && enabled=( all ) (( ${#enabled} == 0 )) && enabled=( all )