about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Unix/Command/_darcs21
2 files changed, 15 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index afe95b84a..c023507f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-08-08  Oliver Kiddle  <opk@zsh.org>
+
+	* 21566: Tobias Gruetzmacher: Completion/Unix/Command/_darcs:
+	fix to list all repositories
+
 2005-08-07  Clint Adams  <clint@zsh.org>
 
 	unposted: Completion/Unix/Command/_mencal: fix syntax error
diff --git a/Completion/Unix/Command/_darcs b/Completion/Unix/Command/_darcs
index 543aca97e..6d590585d 100644
--- a/Completion/Unix/Command/_darcs
+++ b/Completion/Unix/Command/_darcs
@@ -69,6 +69,8 @@ if (( CURRENT > 2 )); then
 	  action[i]='_users' ;;
 	EMAIL|FROM)
 	  action[i]='_email_addresses' ;;
+	URL)
+	  action[i]='_darcs_repository_or_tree' ;;
 	*)
  	  action[i]='' ;;
  	esac
@@ -249,17 +251,14 @@ _darcs_controlled_files() {
 
 (( $+functions[_darcs_repositories] )) ||
 _darcs_repositories() {
-    local local_repos_path="$(_darcs_absolute_tree_root)/_darcs/prefs/repos"
-    local global_repos_path="$HOME/.darcs/repos"
-    local -a local_repos global_repos
-    local -a global_repos
-    [[ -e $local_repos_path ]] && cat $local_repos_path | read -A local_repos
-    [[ -e $global_repos_path ]] && cat $global_repos_path | read -A global_repos
-    local_repos=${local_repos:# #}
-    global_repos=${global_repos:# #}
-    _description repositories expl "repositories"
-    (( ${#local_repos} )) && compadd "$expl[@]" -- "$local_repos[@]"
-    (( ${#global_repos} )) && compadd "$expl[@]" -- "$global_repos[@]"
+  local local_repos_path="$(_darcs_absolute_tree_root)/_darcs/prefs/repos"
+  local global_repos_path="$HOME/.darcs/repos"
+  local -a local_repos global_repos
+  [[ -e $local_repos_path ]] && local_repos=( $(<$local_repos_path) )
+  [[ -e $global_repos_path ]] && global_repos=( $(<$global_repos_path) )
+  _description repositories expl "repositories"
+  (( ${#local_repos} )) && compadd "$expl[@]" -- "$local_repos[@]"
+  (( ${#global_repos} )) && compadd "$expl[@]" -- "$global_repos[@]"
 }