mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-10 12:40:58 +02:00
36077: vcs_info: stop exporting everything
This commit is contained in:
parent
c21a3fddf4
commit
c5abf2bcff
13 changed files with 37 additions and 21 deletions
15
ChangeLog
15
ChangeLog
|
@ -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>
|
||||
|
||||
* 36108: NEWS: list of major changes so far since 5.0.8
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -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]}
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -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=()
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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}"
|
||||
;;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 )
|
||||
|
|
Loading…
Reference in a new issue