about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2009-05-22 15:48:32 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2009-05-22 15:48:32 +0000
commit8edf8a06581667ca33477a864d7f93b2d6e9eccf (patch)
treec64585e354f71252781b68ade807e525bf95d080 /Completion
parentcfd6be99eeb9083862d28b4138c5c25e133ca232 (diff)
downloadzsh-8edf8a06581667ca33477a864d7f93b2d6e9eccf.tar.gz
zsh-8edf8a06581667ca33477a864d7f93b2d6e9eccf.tar.xz
zsh-8edf8a06581667ca33477a864d7f93b2d6e9eccf.zip
26970: Greg Klanderman: _subversion: fix caching.
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Unix/Command/_subversion13
1 files changed, 9 insertions, 4 deletions
diff --git a/Completion/Unix/Command/_subversion b/Completion/Unix/Command/_subversion
index 01b2bbb2a..d31f0243a 100644
--- a/Completion/Unix/Command/_subversion
+++ b/Completion/Unix/Command/_subversion
@@ -22,7 +22,7 @@ _svn () {
     ;;
     args)
       local cmd args usage
-      typeset -gHA _cache_svn_status
+      typeset -gHA _cache_svn_status _cache_svn_mtime
 
       cmd="${${(k)_svn_cmds[(R)*:$words[1]:*]}:-${(k)_svn_cmds[(i):$words[1]:]}}"
       if (( $#cmd )); then
@@ -193,11 +193,16 @@ _svn_status() {
   local dir=$REPLY:h
   local pat="${1:-([ADMR~]|?M)}"
 
-  if (( ! $+_cache_svn_status[$dir] )); then
-    _cache_svn_status[$dir]="$(_call_program files svn status -N $dir)"
+  zmodload -F zsh/stat b:zstat 2>/dev/null
+  local key="$(zstat +device $dir):$(zstat +inode $dir)"
+  local mtime="$(zstat +mtime $dir/.svn/entries)"
+
+  if (( ! $+_cache_svn_status[$key] || _cache_svn_mtime[$key] != mtime )); then
+    _cache_svn_status[$key]="$(_call_program files svn status -N $dir)"
+    _cache_svn_mtime[$key]="$mtime"
   fi
 
-  (( ${(M)#${(f)_cache_svn_status[$dir]}:#(#s)${~pat}*$REPLY} ))
+  (( ${(M)#${(f)_cache_svn_status[$key]}:#(#s)${~pat}*$REPLY} ))
 }
 
 (( $+functions[_svn_urls] )) ||