changeset 1484:840808c57969

zsh completion improvements. File completers now correctly deal with filenames that contain spaces. The completers also use 'hg status .' so they'll work correctly when the default behaviour changes.
author Steve Borho <steve@borho.org>
date Mon, 31 Oct 2005 09:58:05 -0800
parents a4ba63e04134
children 625f3f13d7be
files contrib/zsh_completion
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/zsh_completion	Mon Oct 31 09:57:54 2005 -0800
+++ b/contrib/zsh_completion	Mon Oct 31 09:58:05 2005 -0800
@@ -58,7 +58,7 @@
 
 case $service in
     (add)
-        newFiles=( $(hg status -un) )
+        newFiles=(${(ps:\0:)"$(hg status -0un .)"})
         _arguments $includeExclude \
         '*:file:->unknown'
         _wanted files expl 'unknown files' compadd -a newFiles
@@ -70,7 +70,7 @@
     ;;
 
     (forget)
-        addedFiles=( $(hg status -an) )
+        addedFiles=(${(ps:\0:)"$(hg status -0an .)"})
         _arguments $includeExclude  \
         '*:file:->added'
         _wanted files expl 'newly added files' compadd -a addedFiles
@@ -134,7 +134,7 @@
     ;;
 
     (revert)
-        addedFiles=( $(hg status -mrn) ) # modified, removed
+        addedFiles=(${(ps:\0:)"$(hg status -0amrn .)"})
         _arguments \
         '(--rev)-r[revision to revert to]:revision:($tags)' \
         '(-r)--rev[revision to revert to]:revision:($tags)' \
@@ -145,7 +145,7 @@
     ;;
 
     (commit|ci)
-        addedFiles=( $(hg status -amrn) ) # added, modified, removed
+        addedFiles=(${(ps:\0:)"$(hg status -0amrn .)"})
         _arguments $includeExclude \
         '(--addremove)-A[run addremove during commit]' \
         '(-A)--addremove[run addremove during commit]' \