From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8103 invoked from network); 13 Aug 1999 15:23:52 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 13 Aug 1999 15:23:52 -0000 Received: (qmail 25477 invoked by alias); 13 Aug 1999 15:23:41 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7432 Received: (qmail 25465 invoked from network); 13 Aug 1999 15:23:25 -0000 To: zsh-workers@sunsite.auc.dk Subject: PATCH: _cvs update. MIME-Version: 1.0 (generated by AKEMI 1.13.2 - =?ISO-2022-JP?B?Ig==?= =?ISO-2022-JP?B?GyRCQTA0Y0s8GyhCIg==?=) Content-Type: text/plain; charset=US-ASCII From: Tanaka Akira Date: 14 Aug 1999 00:22:59 +0900 Message-ID: User-Agent: Chao-gnus/6.12.5 AKEMI/1.13.2 (=?ISO-2022-JP?B?GyRCQTAbKEI=?= =?ISO-2022-JP?B?GyRCNGNLPBsoQg==?=) FLAM-DOODLE/1.12.6 (=?ISO-2022-JP?B?GyRCM3cbKEI=?= 10R4.0/5.0) Emacs/20.4 (sparc-sun-solaris2.6) MULE/4.0 (HANANOEN) This update _cvs. * TZ manipulations are abolished by using stat -g. * Use [[ -prefix */ ]]. (This depends on 7344.) * Some internal restructurings. Index: Completion/User/_cvs =================================================================== RCS file: /projects/zsh/zsh/Completion/User/_cvs,v retrieving revision 1.1.1.2 diff -u -F^( -r1.1.1.2 _cvs --- _cvs 1999/08/01 14:48:47 1.1.1.2 +++ _cvs 1999/08/13 15:15:49 @@ -47,14 +47,14 @@ commit|ci|com) # "+nlRm:fF:r:" _complete_opts n '' l '' R '' m: "$complete_m" f '' F: _files \ r: "$complete_r" || - _cvstargets_modified + _cvsmodified ;; diff|di|dif) # "+abcdefhilnpstuw0123456789BHNRC:D:F:I:L:U:V:W:k:r:" _complete_opts a '' b '' c '' d '' e '' f '' h '' i '' l '' n '' p '' \ s '' t '' u '' w '' 0 '' 1 '' 2 '' 3 '' 4 '' 5 '' 6 '' 7 '' 8 '' \ 9 '' B '' H '' N '' R '' C: '' D: "$complete_D" F: '' I: '' L: '' \ U: '' V: '' W: '' k: "$complete_k" r: "$complete_r" || - _cvstargets_modified || _cvstargets + _cvsmodified || _cvstargets ;; edit) # "+lRa:" _complete_opts l '' R '' a: 'compadd edit unedit commit all none' || @@ -174,8 +174,7 @@ } _cvsprefix () { - #if [[ -prefix */ ]]; then - if [[ x"$PREFIX" == x*/* ]]; then + if [[ -prefix */ ]]; then qpref="${PREFIX%/*}/" pref=$~qpref else @@ -184,56 +183,55 @@ fi } -_cvsdirentries () { - setopt localoptions nullglob unset - if [[ -f ${pref}CVS/Entries ]]; then - entries=(${${${(M)${(f)"$(<${pref}CVS/Entries)"}:#D/*}#D/}%%/*}) - else - entries=() - fi +_cvsentries_dir () { + entries=($entries ${${${(M)rawentries:#D/*}#D/}%%/*}) } -_cvsentries () { - setopt localoptions nullglob unset - if [[ -f ${pref}CVS/Entries ]]; then - entries=(${${${${(f)"$(<${pref}CVS/Entries)"}:#D}#(D|)/}%%/*}) - else - entries=() - fi +_cvsentries_plain () { + entries=($entries ${${${(M)rawentries:#/*}#/}%%/*}) } _cvsentries_modified () { if (( $+_cvsentries_modified_disable_stat )) || ! { zmodload -e stat || zmodload stat }; then - _cvsentries + _cvsentries_plain return fi - entries=() - local line Entries - typeset -A mtime + local ents pats + ents=(${${${${(M)rawentries:#/*}#/}/\\/[^\\/]#\\///}%/[^/]#/[^/]#}) + pats=(${${${(f)"$(LANG=C builtin stat -gn +mtime -F '%a %b %e %T %Y' ${pref}*(D))"}##*/}/ //}) + eval 'ents=(${ents:#('${(j:|:)pats:q}')})' + entries=($entries ${ents%%/*}) +} - if [[ -f "${pref}CVS/Entries" ]]; then - Entries="$(<${pref}CVS/Entries)" - else - return +_cvsdirentries () { + entries=() + if [[ -f ${pref}CVS/Entries ]]; then + local rawentries + rawentries=(${(f)"$(<${pref}CVS/Entries)"}) + _cvsentries_dir fi - - local LANG=C - local OLDTZ="$TZ"; if ! (( $+TZ )); then unset OLDTZ; fi; export TZ=GMT +} - 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 - entries=($entries "${line%% *}") - fi - done +_cvsentries () { + entries=() + if [[ -f ${pref}CVS/Entries ]]; then + local rawentries + rawentries=(${(f)"$(<${pref}CVS/Entries)"}) + _cvsentries_plain + _cvsentries_dir + fi +} - if (( $+OLDTZ )); then TZ="$OLDTZ"; else unset TZ; fi +_cvsmodentries () { + entries=() + if [[ -f ${pref}CVS/Entries ]]; then + local rawentries + rawentries=(${(f)"$(<${pref}CVS/Entries)"}) + _cvsentries_modified + _cvsentries_dir + fi } _cvsdirs () { @@ -264,11 +262,11 @@ fi } -_cvstargets_modified () { +_cvsmodified () { local qpref pref entries _cvsprefix if [[ -d ${pref}CVS ]]; then - _cvsentries_modified + _cvsmodentries case $#entries in 0) false;; 1) compgen -g "${entries:q}";; -- Tanaka Akira