From dcd2e04c8166ab0ad9a64f7f92ba9d83bfd18e47 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Tue, 27 Jul 1999 08:32:20 +0000 Subject: zsh-workers:7285 --- Completion/User/_cvs | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/Completion/User/_cvs b/Completion/User/_cvs index bd59bdcd3..66c031f36 100644 --- a/Completion/User/_cvs +++ b/Completion/User/_cvs @@ -157,7 +157,7 @@ _cvsprefix () { _cvsentries () { setopt localoptions nullglob unset if [[ -f ${pref}CVS/Entries ]]; then - entries=( "${(@)${(@)${(@)${(f@)$(<${pref}CVS/Entries)}:#D}#(D|)/}%%/*}" ) + entries=( ${${${${(f)"$(<${pref}CVS/Entries)"}:#D}#(D|)/}%%/*} ) fi } @@ -168,26 +168,27 @@ _cvsentries_modified () { local line Entries typeset -A mtime + if [[ -f "${pref}CVS/Entries" ]]; then + Entries="$(<${pref}CVS/Entries)" + fi + if ! zmodload -e stat; then zmodload stat; fi if zmodload -e stat; then - if [[ -f "${pref}CVS/Entries" ]]; then - Entries="$(<${pref}CVS/Entries)" - mtime=( "${(@s:/:)${(j:/:)${(@)${(@)${(@)${(M@)${(f@)Entries}:#/*}#/}%/*/*}/\/*\///}}}" ) - entries=( "${(@)${(@)${(M@)${(f@)Entries}:#D/*}#D/}%%/*}" ) - builtin stat -n +mtime -F '%a %b %e %T %Y' "$pref${(@k)^mtime}" | - while read line - do - line=${line#$pref} - if [[ x"$mtime[${line%% *}]" == x"${line#* }" ]]; then - #print up-to-date "${line%% *}" - else - #print locally-modified "${line%% *}" - entries=($entries "${line%% *}") - fi - done - fi + mtime=( ${(s:/:)${(j:/:)${${${${(M)${(f)Entries}:#/*}#/}%/*/*}/\\/*\\///}}} ) + entries=( ${${${(M)${(f)Entries}:#D/*}#D/}%%/*} ) + builtin stat -n +mtime -F '%a %b %e %T %Y' "$pref${(@k)^mtime}" | + while read line + do + line=${line#$pref} + if [[ x"$mtime[${line%% *}]" == x"${line#* }" ]]; then + #print up-to-date "${line%% *}" + else + #print locally-modified "${line%% *}" + entries=($entries "${line%% *}") + fi + done else - entries=( "${(@)${(@)${(@)${(f@)Entries}:#D}#(D|)/}%%/*}" ) + entries=( ${${${${(f)Entries}:#D}#(D|)/}%%/*} ) fi if (( $+OLDTZ )); then TZ="$OLDTZ"; else unset TZ; fi @@ -210,7 +211,7 @@ _cvstargets_modified () { } _cvsrevisions () { - compadd - "${(@)${(@)${(@M)${(@f)$(cvs -q status -vl .)}:# *}##[ ]##}%%[ ]*}" + compadd - ${${${(M)${(f)"$(cvs -q status -vl .)"}:# *}##[ ]##}%%[ ]*} } _cvsrepositories () { @@ -222,7 +223,7 @@ _cvsrepositories () { else compadd - \ $root/^CVSROOT(:t) \ - "${(@)${(@M)${(@f)$(<$root/CVSROOT/modules)}:#[^#]*}%%[ ]*}" + ${${(M)${(f)"$(<$root/CVSROOT/modules)"}:#[^#]*}%%[ ]*} fi } -- cgit 1.4.1