mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-02 22:11:54 +02:00
30197: complete subversion changelists
This commit is contained in:
parent
b627021d6f
commit
32eb4faf7c
2 changed files with 20 additions and 4 deletions
|
@ -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 $
|
||||
*****************************************************
|
||||
|
|
|
@ -18,7 +18,7 @@ _svn () {
|
|||
|
||||
if [[ -n $state ]] && (( ! $+_svn_cmds )); then
|
||||
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=(
|
||||
${=${(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
|
||||
;;
|
||||
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'
|
||||
|
@ -281,7 +287,7 @@ _svn_urls() {
|
|||
if [[ ! -prefix *://? ]] ; then
|
||||
zstyle -a ":completion:${curcontext}:" url-schemas urlsch \
|
||||
|| urlsch=( file:// http:// https:// svn:// svn+ssh:// )
|
||||
|
||||
|
||||
if (( $#urlsch )) ; then
|
||||
compset -S '[^:]*'
|
||||
_wanted url-schemas expl 'URL schema' compadd -S '' - $urlsch[@] && ret=0
|
||||
|
@ -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 "$@" ;;
|
||||
|
|
Loading…
Reference in a new issue