about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2006-06-02 14:22:21 +0000
committerClint Adams <clint@users.sourceforge.net>2006-06-02 14:22:21 +0000
commit38ad28d8ac1715cd0332d4188706b89af6f9ba73 (patch)
treeb7779a097ebc8d3d50eb89aa2bcb5fd20824f213 /Completion
parent1cf30c353e753675467c1a3ea198c78bafb5ae0e (diff)
downloadzsh-38ad28d8ac1715cd0332d4188706b89af6f9ba73.tar.gz
zsh-38ad28d8ac1715cd0332d4188706b89af6f9ba73.tar.xz
zsh-38ad28d8ac1715cd0332d4188706b89af6f9ba73.zip
22481: complete svn diff and resolved subcommands.
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Unix/Command/_subversion42
1 files changed, 37 insertions, 5 deletions
diff --git a/Completion/Unix/Command/_subversion b/Completion/Unix/Command/_subversion
index 04509611c..83590103b 100644
--- a/Completion/Unix/Command/_subversion
+++ b/Completion/Unix/Command/_subversion
@@ -49,6 +49,11 @@ _svn () {
               '*:file:_files -g ".svn(/e:_svn_deletedfiles:)"'
             )
           ;;
+          diff)
+            args+=(
+	      '*: : _alternative "files:file:_files -g \*\(e:_svn_status:\)" "urls:URL:_svn_urls"'
+	    )
+          ;;
           help)
             args+=(
               '*::sub command:_svn_commands'
@@ -60,6 +65,11 @@ _svn () {
 	      '*:file:_files -g "*(e:_svn_controlled:)"'
             )
           ;;
+          resolved)
+            args+=(
+              '*:file:_files -g "*(e:_svn_conflicts:)"'
+            )
+          ;;
           revert)
             args+=(
               '*:file:_files -g "(.svn|*)(/e:_svn_deletedfiles:,e:_svn_status:)"'
@@ -141,6 +151,11 @@ _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:)'
@@ -167,15 +182,32 @@ _svn_status() {
 
 (( $+functions[_svn_urls] )) ||
 _svn_urls() {
-  local expl
-
-  if [[ -prefix *: ]]; then
-    _urls
+  local expl remfiles remdispf remdispd suf ret=1
+
+  if [[ -prefix *: ]] && ! _urls &&
+      zstyle -T ":completion:${curcontext}:" remote-access
+  then
+    remfiles=( ${(f)"$(svn list $IPRFIX${PREFIX%%[^./][^/]#} 2>/dev/null)"} )
+    compset -P '*/'
+    compset -S '/*' || suf=file
+    remdispf=(${remfiles:#*/})
+    remdispd=(${(M)remfiles:#*/})
+    _tags files
+    while _tags; do
+      while _next_label files expl ${suf:-directory}; do
+        [[ -n $suf ]] && compadd "$@" "$expl[@]" -d remdispf $remdispf && ret=0
+        compadd ${suf:+-S/} "$@" "$expl[@]" -d remdispd \
+            ${remdispd%/} && ret=0
+      done
+      (( ret )) || return 0
+    done
   else
     compset -S '[^:]*'
     _wanted url-schemas expl 'URL schema' compadd -S '' - \
-        file:// http:// https:// svn:// svn+ssh://
+        file:// http:// https:// svn:// svn+ssh:// && ret=0
   fi
+  
+  return ret
 }
 
 (( $+functions[_svn_commands] )) ||