zsh-workers
 help / color / mirror / code / Atom feed
From: Clint Adams <clint@zsh.org>
To: zsh-workers@sunsite.dk
Subject: PATCH: _subversion
Date: Fri, 2 Jun 2006 10:09:36 -0400	[thread overview]
Message-ID: <20060602140936.GA10481@scowler.net> (raw)

This is from Oliver.

Index: Completion/Unix/Command/_subversion
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_subversion,v
retrieving revision 1.17
diff -u -r1.17 _subversion
--- Completion/Unix/Command/_subversion	27 Sep 2005 13:56:55 -0000	1.17
+++ Completion/Unix/Command/_subversion	2 Jun 2006 14:08:30 -0000
@@ -49,6 +49,11 @@
               '*: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 @@
 	      '*: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 @@
   [[ -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 @@
 
 (( $+functions[_svn_urls] )) ||
 _svn_urls() {
-  local expl
+  local expl remfiles remdispf remdispd suf ret=1
 
-  if [[ -prefix *: ]]; then
-    _urls
+  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] )) ||


                 reply	other threads:[~2006-06-02 14:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060602140936.GA10481@scowler.net \
    --to=clint@zsh.org \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).