about summary refs log tree commit diff
path: root/Completion/Unix/Command/_subversion
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2009-11-19 09:48:42 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2009-11-19 09:48:42 +0000
commitbe1e9c189d3791ab740bfd6901a904528c9362a7 (patch)
treec0afa7fac28b58fb392369e609c4fecd42d3340f /Completion/Unix/Command/_subversion
parent9e260715c42b8f121cfefed5b4fce145194d6e91 (diff)
downloadzsh-be1e9c189d3791ab740bfd6901a904528c9362a7.tar.gz
zsh-be1e9c189d3791ab740bfd6901a904528c9362a7.tar.xz
zsh-be1e9c189d3791ab740bfd6901a904528c9362a7.zip
Greg: 27416: repository path enhancement
Diffstat (limited to 'Completion/Unix/Command/_subversion')
-rw-r--r--Completion/Unix/Command/_subversion15
1 files changed, 12 insertions, 3 deletions
diff --git a/Completion/Unix/Command/_subversion b/Completion/Unix/Command/_subversion
index 9d6babed5..2dbcb6d65 100644
--- a/Completion/Unix/Command/_subversion
+++ b/Completion/Unix/Command/_subversion
@@ -2,6 +2,7 @@
 
 _svn () {
   local curcontext="$curcontext" state line expl ret=1
+  typeset -A opt_args
 
   _arguments -C \
     '(-)--help[print help information]' \
@@ -207,12 +208,20 @@ _svn_status() {
 
 (( $+functions[_svn_remote_paths] )) ||
 _svn_remote_paths() {
-  local expl remfiles remdispf remdispd suf ret=1
+  local expl remfiles remdispf remdispd suf ret=1 pfx='\^/' sub='^/'
+
+  # prefix must match a valid repository path format, either standard style
+  # schema://host/path/.. or ^/path/.. specifying a path relative to the
+  # root of the working directory repository.  In the second form, allow the
+  # leading '^' be escaped in case the user has the extendedglob option set.
+  [[ -prefix *://*/ ]] ||
+  [[ -f .svn/entries && ( -prefix '^/' || -prefix '\^/' ) ]] ||
+  return 1
 
-  [[ -prefix *://*/ ]] || return 1
+  # return if remote access is not permitted
   zstyle -T ":completion:${curcontext}:" remote-access || return 1
 
-  remfiles=( ${(f)"$(svn list $IPREFIX${PREFIX%%[^./][^/]#} 2>/dev/null)"} )
+  remfiles=( ${(f)"$(svn list $IPREFIX${${PREFIX%%[^/]#}/#$pfx/$sub} 2>/dev/null)"} )
   (( $? == 0 )) || return 1
 
   # you might consider trying to return early if $#remfiles is zero,