zsh-workers
 help / color / mirror / code / Atom feed
* Updated svn completion file
@ 2011-04-13  2:19 gi1242+zsh
  0 siblings, 0 replies; only message in thread
From: gi1242+zsh @ 2011-04-13  2:19 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 180 bytes --]

Hi Guys,

I made the svn caching policy a little smarter. (I think there was a bug
with the old caching policy anyway.)

GI

-- 
'Wisdom' -- Having a lot to say and not saying it.

[-- Attachment #2: svn-caching-policy.patch --]
[-- Type: text/plain, Size: 1546 bytes --]

diff --git a/Completion/Unix/Command/_subversion b/Completion/Unix/Command/_subversion
index 44d83b7..88142d8 100644
--- a/Completion/Unix/Command/_subversion
+++ b/Completion/Unix/Command/_subversion
@@ -18,11 +18,11 @@ _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]//[(),]}// /:}}:}
       )
-      _store_cache svn_cmds _svn_cmds
+      _store_cache svn-cmds _svn_cmds
     fi
   fi
 
@@ -38,13 +38,13 @@ _svn () {
       if (( $#cmd )); then
         curcontext="${curcontext%:*:*}:svn-${cmd}:"
 
-	if ! _cache_invalid svn-${cmd}-usage && \
+	if _cache_invalid svn-${cmd}-usage || \
 	    ! _retrieve_cache svn-${cmd}-usage;
 	then
 	  usage=${${(M)${(f)"$(LC_ALL=C _call_program options svn help $cmd)"}:#usage:*}#usage:*$cmd] }
 	  _store_cache svn-${cmd}-usage usage
 	fi
-	if ! _cache_invalid svn-${cmd}-usage && \
+	if _cache_invalid svn-${cmd}-usage || \
 	    ! _retrieve_cache svn-${cmd}-args;
 	then
 	  args=(
@@ -317,12 +317,7 @@ _subversion () {
 }
 
 _svn_caching_policy() {
-  # Rebuild every week
-  local -a oldp
-
-  oldp=( "$1"(Nmw+1) )
-  (( $#oldp ))
+  [[ =$service -nt $1 ]]
 }
 
-
 _subversion "$@"

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-04-13  2:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-13  2:19 Updated svn completion file gi1242+zsh

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).