* PATCH: complete subversion change lists
@ 2012-02-10 15:38 Oliver Kiddle
2012-02-11 1:08 ` Daniel Shahaf
0 siblings, 1 reply; 2+ messages in thread
From: Oliver Kiddle @ 2012-02-10 15:38 UTC (permalink / raw)
To: Zsh workers
This updates subversion completion for one of the newer subversion
features.
Oliver
Index: Completion/Unix/Command/_subversion
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_subversion,v
retrieving revision 1.34
diff -u -r1.34 _subversion
--- Completion/Unix/Command/_subversion 16 Dec 2011 09:18:34 -0000 1.34
+++ Completion/Unix/Command/_subversion 10 Feb 2012 15:36:45 -0000
@@ -31,7 +31,7 @@
_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 @@
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
@@ -309,6 +312,14 @@
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 "$@" ;;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: PATCH: complete subversion change lists
2012-02-10 15:38 PATCH: complete subversion change lists Oliver Kiddle
@ 2012-02-11 1:08 ` Daniel Shahaf
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Shahaf @ 2012-02-11 1:08 UTC (permalink / raw)
To: Oliver Kiddle; +Cc: Zsh workers
Oliver Kiddle wrote on Fri, Feb 10, 2012 at 16:38:48 +0100:
> + while (( idx=$args[(I)*--c(l|hangelist):arg:] )); do
> + args[(I)*--c(l|hangelist):arg:]=( \*{--cl,--changelist}':change list:_svn_changelists' )
> + done
You could pass --quiet and/or --ignore-externals to save some disk
crawling. (If --depth is already present on the command-line, you could
pass that too; but I don't know how easy it is to check that.)
In 1.7+, determining all valid changelist names can be done in a single
SQLite query. Would it make sense to expose that in svn's API?
(Or you could run that query yourself --- but the SQLite schema is not
part of svn's public API and its backwards-compatibility guarantees.)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-02-11 1:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-10 15:38 PATCH: complete subversion change lists Oliver Kiddle
2012-02-11 1:08 ` Daniel Shahaf
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).