1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-12 13:21:15 +02:00

30197: complete subversion changelists

This commit is contained in:
Oliver Kiddle 2012-02-10 16:00:59 +00:00
parent b627021d6f
commit 32eb4faf7c
2 changed files with 20 additions and 4 deletions

View file

@ -1,5 +1,7 @@
2012-02-10 Oliver Kiddle <opk@zsh.org>
* 30197: Completion/Unix/Command/_subversion: complete changelists
* 30177: Completion/X/Command/_xterm,
Completion/X/Type/_xft_fonts: completion for fontconfig fonts
@ -15933,5 +15935,5 @@
*****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL
* $Revision: 1.5578 $
* $Revision: 1.5579 $
*****************************************************

View file

@ -31,7 +31,7 @@ _svn () {
_wanted commands expl 'svn command' _svn_commands && ret=0
;;
args)
local cmd args usage
local cmd args usage idx
typeset -gHA _cache_svn_status _cache_svn_mtime
cmd="${${(k)_svn_cmds[(R)*:$words[1]:*]}:-${(k)_svn_cmds[(i):$words[1]:]}}"
@ -50,6 +50,9 @@ _svn () {
args=(
${=${${${(M)${(f)"$(LC_ALL=C _call_program options svn help $cmd)"#(*Valid options:|(#e))}:#* :*}%% #:*}/ (arg|ARG)/:arg:}/(#b)(-##)([[:alpha:]]##) \[--([a-z-]##)\](:arg:)#/(--$match[3])$match[1]$match[2]$match[4] ($match[1]$match[2])--$match[3]$match[4]}
)
while (( idx=$args[(I)*--c(l|hangelist):arg:] )); do
args[(I)*--c(l|hangelist):arg:]=( \*{--cl,--changelist}':change list:_svn_changelists' )
done
_store_cache svn-${cmd}-args args
fi
@ -92,6 +95,9 @@ _svn () {
'*:file:_files -g "*(e:_svn_controlled:)"'
)
;;
(mergeinfo)
args[(r)--show-revs:arg:]=( '--show-revs:revisions:(merged eligible)' )
;;
(propget|propedit)
args+=(
'1:property name:_svn_props'
@ -309,6 +315,14 @@ _svn_props() {
compadd "$@" -a properties && return 0
}
(( $+functions[_svn_changelists] )) ||
_svn_changelists() {
local cls
cls=( ${${${(M)${(f)"$(LC_ALL=C _call_program changelists svn status 2>/dev/null)"}:#--- Changelist*}%??}##*\'} )
compadd "$@" -a cls && return 0
}
_subversion () {
case $service in
(svn) _svn "$@" ;;