aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorPaul Eggert1994-08-15 22:44:10 +0000
committerPaul Eggert1994-08-15 22:44:10 +0000
commit7a833f0bafa49ebe060f8b5c65c361034ef44aa6 (patch)
tree2e7d23b696eb0f9f0036448df13ccd0242da71c8 /lib-src
parent12d733d066dcb7a8b67502a8d291e2bdf4663a3e (diff)
downloademacs-7a833f0bafa49ebe060f8b5c65c361034ef44aa6.tar.gz
emacs-7a833f0bafa49ebe060f8b5c65c361034ef44aa6.zip
Add support for CVS.
Work with `rlog's that output ISO 8601 dates.
Diffstat (limited to 'lib-src')
-rwxr-xr-xlib-src/rcs2log69
1 files changed, 49 insertions, 20 deletions
diff --git a/lib-src/rcs2log b/lib-src/rcs2log
index 86f64917fb9..63d366dcf63 100755
--- a/lib-src/rcs2log
+++ b/lib-src/rcs2log
@@ -12,7 +12,7 @@
12 12
13# Author: Paul Eggert <eggert@twinsun.com> 13# Author: Paul Eggert <eggert@twinsun.com>
14 14
15# $Id: rcs2log,v 1.16 1993/10/19 02:50:31 eggert Exp rms $ 15# $Id: rcs2log,v 1.17 1994/08/09 20:43:48 rms Exp eggert $
16 16
17# Copyright 1992, 1993 Free Software Foundation, Inc. 17# Copyright 1992, 1993 Free Software Foundation, Inc.
18 18
@@ -140,32 +140,50 @@ then
140fi 140fi
141datearg="-d>$date" 141datearg="-d>$date"
142 142
143repository=
144rlog=rlog
145case $CVSROOT in
146?*)
147 if test -d "$CVSROOT" && test -f CVS/Repository
148 then
149 r=`cat <CVS/Repository` || exit
150 if test -d "$CVSROOT/$r"
151 then
152 repository=$CVSROOT/$r
153 rlog='cvs log'
154 fi
155 fi
156esac
157
143# With no arguments, examine all files under the RCS directory. 158# With no arguments, examine all files under the RCS directory.
144case $# in 159case $# in
1450) 1600)
146 files= 161 case $repository in
147 for file in RCS/.* RCS/* .*,v *,v 162 '')
148 do 163 files=
149 case $file in 164 for file in RCS/.* RCS/* .*,v *,v
150 RCS/. | RCS/..) continue;; 165 do
151 RCS/.\* | RCS/\* | .\*,v | \*,v) test -f "$file" || continue 166 case $file in
167 RCS/. | RCS/..) continue;;
168 RCS/.\* | RCS/\* | .\*,v | \*,v) test -f "$file" || continue
169 esac
170 files=$files$nl$file
171 done
172 case $files in
173 '') exit 0
152 esac 174 esac
153 files=$files$nl$file 175 oldIFS=$IFS
154 done 176 IFS=$nl
155 case $files in 177 set $files
156 '') exit 0 178 IFS=$oldIFS
157 esac 179 esac
158 oldIFS=$IFS
159 IFS=$nl
160 set $files
161 IFS=$oldIFS
162esac 180esac
163 181
164rlogout=$TMPDIR/rcs2log$$r 182rlogout=$TMPDIR/rcs2log$$r
165trap exit 1 2 13 15 183trap exit 1 2 13 15
166trap "rm -f $loginsout $rlogout; exit 1" 0 184trap "rm -f $loginsout $rlogout; exit 1" 0
167 185
168rlog "$datearg" $rlog_options "$@" >$rlogout || exit 186$rlog "$datearg" $rlog_options ${1+"$@"} >$rlogout || exit
169 187
170 188
171# Get the full name of each author the logs mention, and set initialize_fullname 189# Get the full name of each author the logs mention, and set initialize_fullname
@@ -179,7 +197,7 @@ $logins
179EOF 197EOF
180esac 198esac
181authors=` 199authors=`
182 sed -n 's|^date: *[0-9]*/[0-9][0-9]/[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]; *author: *\([^; ]*\).*|\1|p' <$rlogout | 200 sed -n 's|^date: *[0-9]*[-/][0-9][0-9][-/][0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9][-+0-9]*; *author: *\([^; ]*\).*|\1|p' <$rlogout |
183 case $loginsout in 201 case $loginsout in
184 '') sort -u;; 202 '') sort -u;;
185 ?*) sort -u | comm -23 - $loginsout 203 ?*) sort -u | comm -23 - $loginsout
@@ -290,10 +308,21 @@ awk <$rlogout '
290 /^Working file:/ { filename = $3 } 308 /^Working file:/ { filename = $3 }
291 /^date: /, /^(-----------*|===========*)$/ { 309 /^date: /, /^(-----------*|===========*)$/ {
292 if ($0 ~ /^branches: /) { next } 310 if ($0 ~ /^branches: /) { next }
293 if ($0 ~ /^date: [0-9][ \/0-9:]*;/) { 311 if ($0 ~ /^date: [0-9][- +\/0-9:]*;/) {
294 time = substr($3, 1, length($3)-1) 312 date = $2
313 if (date ~ /-/) {
314 # An ISO format date. Replace all "-"s with "/"s.
315 newdate = ""
316 while ((i = index(date, "-")) != 0) {
317 newdate = newdate substr(date, 1, i-1) "/"
318 date = substr(date, i+1)
319 }
320 date = newdate date
321 }
322 # Ignore any time zone; ChangeLog has no room for it.
323 time = substr($3, 1, 8)
295 author = substr($5, 1, length($5)-1) 324 author = substr($5, 1, length($5)-1)
296 printf "%s %s %s %s %c", filename, $2, time, author, 13 325 printf "%s %s %s %s %c", filename, date, time, author, 13
297 next 326 next
298 } 327 }
299 if ($0 ~ /^(-----------*|===========*)$/) { print ""; next } 328 if ($0 ~ /^(-----------*|===========*)$/) { print ""; next }