1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-25 17:20:25 +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> 2012-02-10 Oliver Kiddle <opk@zsh.org>
* 30197: Completion/Unix/Command/_subversion: complete changelists
* 30177: Completion/X/Command/_xterm, * 30177: Completion/X/Command/_xterm,
Completion/X/Type/_xft_fonts: completion for fontconfig fonts Completion/X/Type/_xft_fonts: completion for fontconfig fonts
@ -15933,5 +15935,5 @@
***************************************************** *****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL * This is used by the shell to define $ZSH_PATCHLEVEL
* $Revision: 1.5578 $ * $Revision: 1.5579 $
***************************************************** *****************************************************

View file

@ -18,7 +18,7 @@ _svn () {
if [[ -n $state ]] && (( ! $+_svn_cmds )); then if [[ -n $state ]] && (( ! $+_svn_cmds )); then
typeset -gHA _svn_cmds typeset -gHA _svn_cmds
if _cache_invalid svn-cmds || ! _retrieve_cache svn-cmds; then if _cache_invalid svn-cmds || ! _retrieve_cache svn-cmds; then
_svn_cmds=( _svn_cmds=(
${=${(f)${${"$(LC_ALL=C _call_program commands svn help)"#l#*Available subcommands:}%%Subversion is a tool*}}/(#s)[[:space:]]#(#b)([a-z]##)[[:space:]]#(\([a-z, ?]##\))#/$match[1] :$match[1]${match[2]:+:${${match[2]//[(),]}// /:}}:} ${=${(f)${${"$(LC_ALL=C _call_program commands svn help)"#l#*Available subcommands:}%%Subversion is a tool*}}/(#s)[[:space:]]#(#b)([a-z]##)[[:space:]]#(\([a-z, ?]##\))#/$match[1] :$match[1]${match[2]:+:${${match[2]//[(),]}// /:}}:}
) )
@ -31,7 +31,7 @@ _svn () {
_wanted commands expl 'svn command' _svn_commands && ret=0 _wanted commands expl 'svn command' _svn_commands && ret=0
;; ;;
args) args)
local cmd args usage local cmd args usage idx
typeset -gHA _cache_svn_status _cache_svn_mtime typeset -gHA _cache_svn_status _cache_svn_mtime
cmd="${${(k)_svn_cmds[(R)*:$words[1]:*]}:-${(k)_svn_cmds[(i):$words[1]:]}}" cmd="${${(k)_svn_cmds[(R)*:$words[1]:*]}:-${(k)_svn_cmds[(i):$words[1]:]}}"
@ -50,6 +50,9 @@ _svn () {
args=( 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]} ${=${${${(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 _store_cache svn-${cmd}-args args
fi fi
@ -92,6 +95,9 @@ _svn () {
'*:file:_files -g "*(e:_svn_controlled:)"' '*:file:_files -g "*(e:_svn_controlled:)"'
) )
;; ;;
(mergeinfo)
args[(r)--show-revs:arg:]=( '--show-revs:revisions:(merged eligible)' )
;;
(propget|propedit) (propget|propedit)
args+=( args+=(
'1:property name:_svn_props' '1:property name:_svn_props'
@ -281,7 +287,7 @@ _svn_urls() {
if [[ ! -prefix *://? ]] ; then if [[ ! -prefix *://? ]] ; then
zstyle -a ":completion:${curcontext}:" url-schemas urlsch \ zstyle -a ":completion:${curcontext}:" url-schemas urlsch \
|| urlsch=( file:// http:// https:// svn:// svn+ssh:// ) || urlsch=( file:// http:// https:// svn:// svn+ssh:// )
if (( $#urlsch )) ; then if (( $#urlsch )) ; then
compset -S '[^:]*' compset -S '[^:]*'
_wanted url-schemas expl 'URL schema' compadd -S '' - $urlsch[@] && ret=0 _wanted url-schemas expl 'URL schema' compadd -S '' - $urlsch[@] && ret=0
@ -309,6 +315,14 @@ _svn_props() {
compadd "$@" -a properties && return 0 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 () { _subversion () {
case $service in case $service in
(svn) _svn "$@" ;; (svn) _svn "$@" ;;