Hi,

with this patch 

svn ls ^/<tab><tab> and svn merge ^/<tab><tab> 

will list the remote directories.

to get "svn ls ^/" to autocomplete the path export SVN_BASH_COMPL_EXT=urls has 
to be set, I don't know why this check is only in ls ...

Regards,
Chris
--- /etc/bash_completion.d/subversion	2015-08-11 22:17:11.808000000 +0200
+++ subversion	2015-08-12 11:13:42.135616669 +0200
@@ -420,6 +420,16 @@
 
 			COMPREPLY=( $(compgen -W "$choices" -- $suffix ) )
 			return
+        elif [[ $cmd == @(ls|list) && $cur == ^/* ]] ; then
+          # autocomplete für svn ls ^/bla
+          if [[ $cur =~ ((.*/)([^/]*)) ]] ; then
+            url="${BASH_REMATCH[2]}"
+	        path="${BASH_REMATCH[3]}"
+            remote_files="$(svn ls "$url")"
+            COMPREPLY=( $(compgen -P "$url" -W "$remote_files" -- "$path" ) )
+            compopt -o nospace
+            return 0
+          fi
 		else
 			# show schemas
 			COMPREPLY=( $(compgen -W "$urlSchemas" -- $cur) )
@@ -451,6 +461,16 @@
 	    # force --reintegrate only if the current word is empty
 	    COMPREPLY=( $(compgen -W '--reintegrate' -- $cur ) )
 	    return 0
+      elif [[ $URL == ^/* ]] ; then
+        # autocomplete für svn merge ^/bla
+        if [[ $cur =~ ((.*/)([^/]*)) ]] ; then
+          url="${BASH_REMATCH[2]}"
+		  path="${BASH_REMATCH[3]}"
+		  remote_files="$(svn ls "$url")"
+	      COMPREPLY=( $(compgen -P "$url" -W "$remote_files" -- "$path" ) )
+		  compopt -o nospace
+          return 0
+        fi
 	  fi
 	fi
 

Reply via email to