Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: subversion complete functions obsolete



Dear Daniel,
attached you can find the diff file which you requested,

cheers C.

--- _subversion_original_zsh_5.7.1	2019-08-24 09:54:06.000000000 +0200
+++ _subversion_orthogonal	2019-08-24 22:10:57.000000000 +0200
@@ -1,5 +1,9 @@
 #compdef svn svnlite=svn svnadmin svnadmin-static=svnadmin
 
+# This is the file provided by zsh 5.7.1 patched in such a way that I removed from all the calls
+# to _file zsh function the option -g and the relative argument, thus making completion less smart
+# with compared to original version.
+
 _svn () {
   local curcontext="$curcontext" state line expl ret=1
   typeset -A opt_args
@@ -106,23 +110,23 @@
         case $cmd in;
           (add)
             args+=(
-              '*:file:_files -g "*(^e:_svn_controlled:)"'
+              '*:file:_files'
             )
           ;;
           (commit)
             args=(
 	      ${args/(#b)(*--file*):arg:/$match[1]:file:_files}
-              '*:file:_files -g "*(e:_svn_status:)"'
+              '*:file:_files'
             )
           ;;
           (delete)
             args+=(
-              '*:file:_files -g ".svn(/e:_svn_deletedfiles:)"'
+              '*:file:_files'
             )
           ;;
           (diff)
             args+=(
-	      '*: : _alternative "files:file:_files -g \*\(e:_svn_status:\)" "urls:URL:_svn_urls"'
+	      '*: : _alternative "files:file:_files" "urls:URL:_svn_urls"'
 	    )
           ;;
           (help)
@@ -138,8 +142,8 @@
           ;;
           (log)
             args+=(
-              '1: : _alternative "files:file:_files -g \*\(e:_svn_controlled:\)" "urls:URL:_svn_urls"'
-	      '*:file:_files -g "*(e:_svn_controlled:)"'
+              '1: : _alternative "files:file:_files" "urls:URL:_svn_urls"'
+	      '*:file:_files'
             )
           ;;
           (mergeinfo)
@@ -161,12 +165,12 @@
 	  ;;
           (resolved)
             args+=(
-              '*:file:_files -g "*(e:_svn_conflicts:)"'
+              '*:file:_files'
             )
           ;;
           (revert)
             args+=(
-              '*:file:_files -g "(.svn|*)(/e:_svn_deletedfiles:,e:_svn_status:)"'
+              '*:file:_files'
             )
           ;;
 	  (unshelve)
@@ -308,44 +312,6 @@
   return ret
 }
 
-(( $+functions[_svn_controlled] )) ||
-_svn_controlled() {
-  [[ -f ${(M)REPLY##*/}.svn/text-base/${REPLY##*/}.svn-base ]]
-}
-
-(( $+functions[_svn_conflicts] )) ||
-_svn_conflicts() {
-  [ -n $REPLY.(mine|r<->)(N[1]) ]
-}
-
-(( $+functions[_svn_deletedfiles] )) ||
-_svn_deletedfiles() {
-  # Typical usage would be _files -g '.svn(/e:_svn_deletedfiles:)'
-  local cont controlled
-  reply=( )
-  [[ $REPLY = (*/|).svn ]] || return
-  controlled=( $REPLY/text-base/*.svn-base(N:r:t) )
-  for cont in ${controlled}; do
-    [[ -e $REPLY:h/$cont ]] || reply+=( ${REPLY%.svn}$cont )
-  done
-}
-
-(( $+functions[_svn_status] )) ||
-_svn_status() {
-  local dir=$REPLY:h
-  local pat="${1:-([ADMR~]|?M)}"
-
-  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[$key]}:#(#s)${~pat}*$REPLY} ))
-}
 
 (( $+functions[_svn_remote_paths] )) ||
 _svn_remote_paths() {

____________
Cristiano De Michele, Ph.D.           
Department of Physics                       Tel.  :  +390649913524                                                          
University of Rome  "La Sapienza"    Fax  :  +39064463158                                                        
Piazzale Aldo Moro, 2                              
I-00185 Roma - Italy  
homepage: http://www.roma1.infn.it/~demichel







Il giorno 24 ago 2019, alle ore 23:56, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> ha scritto:

Cristiano De Michele wrote on Sat, 24 Aug 2019 21:41 +00:00:
attached you can find the diff file which you requested,

Thanks!  Yes, that's the right form to use in the future.




Messages sorted by: Reverse Date, Date, Thread, Author