From 7c50fa1262bd106a923f8b7be85d8f23afc4ecc7 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Wed, 30 Mar 2011 21:19:17 +0000 Subject: 28961: Add `no-vcs' hook. --- ChangeLog | 5 ++++- Doc/Zsh/contrib.yo | 5 +++++ Functions/VCS_Info/VCS_INFO_set | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 808344d2f..6c70d1acf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,9 @@ Functions/VCS_Info/vcs_info_hookdel: Add functions to add/remove static hooks. + * 28961: Doc/Zsh/contrib.yo, Functions/VCS_Info/VCS_INFO_set: Add + `no-vcs' hook. + 2011-03-29 Mikael Magnusson * unposted: Completion/Unix/Command/_vim: Fix typo in @@ -14407,5 +14410,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.5237 $ +* $Revision: 1.5238 $ ***************************************************** diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo index 5c82c5d46..bc4a814a5 100644 --- a/Doc/Zsh/contrib.yo +++ b/Doc/Zsh/contrib.yo @@ -1307,6 +1307,11 @@ When setting tt(ret) to non-zero, the string in tt(${hook_com[guards-string]}) will be used in the var(%g) escape in the tt(patch-format) and tt(nopatch-format) styles. ) +item(tt(no-vcs))( +This hooks is called when no version control system was detected. + +The `hook_com' parameter is not used. +) item(tt(post-quilt))( Called after the tt(quilt) support is done. The following information is passed as arguments to the hook: 1. the quilt-support mode (`addon' or diff --git a/Functions/VCS_Info/VCS_INFO_set b/Functions/VCS_Info/VCS_INFO_set index a2b838cdb..23dc06b4b 100644 --- a/Functions/VCS_Info/VCS_INFO_set +++ b/Functions/VCS_Info/VCS_INFO_set @@ -16,6 +16,7 @@ if [[ $1 == '--nvcs' ]] ; then typeset -gx vcs_info_msg_${i}_= done VCS_INFO_nvcsformats $2 + [[ $2 != '-preinit-' ]] && VCS_INFO_hook "no-vcs" fi (( ${#msgs} - 1 < 0 )) && return 0 -- cgit v1.2.3