aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert1995-04-30 15:34:52 +0000
committerPaul Eggert1995-04-30 15:34:52 +0000
commit64736f55e159ae981a7331e9b3fbd178d84c2655 (patch)
treeeb7640a05c50f69e05666d6dc53ee0fe7728b153
parent5949c48ae043f464bc5f0f52ff9068d4e0551ca4 (diff)
downloademacs-64736f55e159ae981a7331e9b3fbd178d84c2655.tar.gz
emacs-64736f55e159ae981a7331e9b3fbd178d84c2655.zip
(datearg): If rlog options are specified explicitly,
omit the implicit '-d>DATE' option. (repository, rlog): Allow absolute paths to CVS repositories. Look only at the first line of CVS/Repository.
-rwxr-xr-xlib-src/rcs2log128
1 files changed, 70 insertions, 58 deletions
diff --git a/lib-src/rcs2log b/lib-src/rcs2log
index 831010e77c7..63c4b71ca8c 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.20 1995/03/21 23:14:41 eggert Exp eggert $ 15# $Id: rcs2log,v 1.22 1995/04/30 15:34:52 eggert Exp $
16 16
17# Copyright 1992, 1993, 1994, 1995 Free Software Foundation, Inc. 17# Copyright 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
18 18
@@ -42,7 +42,7 @@ nl='
42hostname= # name of local host (if empty, will deduce it later) 42hostname= # name of local host (if empty, will deduce it later)
43indent=8 # indent of log line 43indent=8 # indent of log line
44length=79 # suggested max width of log line 44length=79 # suggested max width of log line
45logins= # login names for people we know fullnames and mailaddresses of 45logins= # login names for people we know fullnames and mailaddrs of
46loginFullnameMailaddrs= # login<tab>fullname<tab>mailaddr triplets 46loginFullnameMailaddrs= # login<tab>fullname<tab>mailaddr triplets
47recursive= # t if we want recursive rlog 47recursive= # t if we want recursive rlog
48rlog_options= # options to pass to rlog 48rlog_options= # options to pass to rlog
@@ -116,69 +116,78 @@ month_data='
116' 116'
117 117
118 118
119# Log into $rlogout the revisions checked in since the first ChangeLog entry. 119# Put rlog output into $rlogout.
120 120
121date=1970 121# If no rlog options are given,
122if test -s ChangeLog 122# log the revisions checked in since the first ChangeLog entry.
123then 123case $rlog_options in
124 # Add 1 to seconds to avoid duplicating most recent log. 124'')
125 e=' 125 date=1970
126 /^... ... [ 0-9][0-9] [ 0-9][0-9]:[0-9][0-9]:[0-9][0-9] [0-9]+ /{ 126 if test -s ChangeLog
127 '"$month_data"' 127 then
128 year = $5 128 # Add 1 to seconds to avoid duplicating most recent log.
129 for (i=0; i<=11; i++) if (m[i] == $2) break 129 e='
130 dd = $3 130 /^... ... [ 0-9][0-9] [ 0-9][0-9]:[0-9][0-9]:[0-9][0-9] [0-9]+ /{
131 hh = substr($0,12,2) 131 '"$month_data"'
132 mm = substr($0,15,2) 132 year = $5
133 ss = substr($0,18,2) 133 for (i=0; i<=11; i++) if (m[i] == $2) break
134 ss++ 134 dd = $3
135 if (ss == 60) { 135 hh = substr($0,12,2)
136 ss = 0 136 mm = substr($0,15,2)
137 mm++ 137 ss = substr($0,18,2)
138 if (mm == 60) { 138 ss++
139 mm = 0 139 if (ss == 60) {
140 hh++ 140 ss = 0
141 if (hh == 24) { 141 mm++
142 hh = 0 142 if (mm == 60) {
143 dd++ 143 mm = 0
144 monthdays = mo[i+1] - mo[i] 144 hh++
145 if (i == 1 && year%4 == 0 && (year%100 != 0 || year%400 == 0)) monthdays++ 145 if (hh == 24) {
146 if (dd == monthdays + 1) { 146 hh = 0
147 dd = 1 147 dd++
148 i++ 148 monthdays = mo[i+1] - mo[i]
149 if (i == 12) { 149 if (i == 1 && year%4 == 0 && (year%100 != 0 || year%400 == 0)) monthdays++
150 i = 0 150 if (dd == monthdays + 1) {
151 year++ 151 dd = 1
152 i++
153 if (i == 12) {
154 i = 0
155 year++
156 }
152 } 157 }
153 } 158 }
154 } 159 }
155 } 160 }
161 printf "%d/%02d/%02d %02d:%02d:%02d\n", year,i+1,dd,hh,mm,ss
162 exit
156 } 163 }
157 printf "%d/%02d/%02d %02d:%02d:%02d\n", year, i+1, dd, hh, mm, ss 164 '
158 exit 165 d=`$AWK "$e" <ChangeLog` || exit
159 } 166 case $d in
160 ' 167 ?*) date=$d
161 d=`$AWK "$e" <ChangeLog` || exit 168 esac
162 case $d in 169 fi
163 ?*) date=$d 170 datearg="-d>$date"
164 esac 171esac
165fi
166datearg="-d>$date"
167 172
168repository= 173# If CVS is in use, examine its repository, not the normal RCS files.
169rlog=rlog 174if test ! -f CVS/Repository
170case $CVSROOT in 175then
171?*) 176 rlog=rlog
172 if test -d "$CVSROOT" && test -f CVS/Repository 177 repository=
178else
179 rlog='cvs log'
180 repository=`sed 1q <CVS/Repository` || exit
181 case $repository in
182 /*) ;;
183 *) repository=${CVSROOT?}/$repository
184 esac
185 if test ! -d "$repository"
173 then 186 then
174 r=`cat <CVS/Repository` || exit 187 echo >&2 "$0: $repository: bad repository (see CVS/Repository)"
175 if test -d "$CVSROOT/$r" 188 exit 1
176 then
177 repository=$CVSROOT/$r
178 rlog='cvs log'
179 fi
180 fi 189 fi
181esac 190fi
182 191
183# With no arguments, examine all files under the RCS directory. 192# With no arguments, examine all files under the RCS directory.
184case $# in 193case $# in
@@ -226,7 +235,10 @@ rlogout=$TMPDIR/rcs2log$$r
226trap exit 1 2 13 15 235trap exit 1 2 13 15
227trap "rm -f $llogout $rlogout; exit 1" 0 236trap "rm -f $llogout $rlogout; exit 1" 0
228 237
229$rlog "$datearg" $rlog_options ${1+"$@"} >$rlogout || exit 238case $rlog_options in
239?*) $rlog $rlog_options ${1+"$@"} >$rlogout;;
240'') $rlog "$datearg" ${1+"$@"} >$rlogout
241esac || exit
230 242
231 243
232# Get the full name of each author the logs mention, and set initialize_fullname 244# Get the full name of each author the logs mention, and set initialize_fullname
@@ -450,7 +462,7 @@ sort +1 -3r +3 +0 |
450# Finally, reformat the sorted log entries. 462# Finally, reformat the sorted log entries.
451$AWK ' 463$AWK '
452 BEGIN { 464 BEGIN {
453 # Some awks do not understand "\r" or "\013", so we have to 465 # Some awk variants do not understand "\r" or "\013", so we have to
454 # put a carriage return directly in the file. 466 # put a carriage return directly in the file.
455 CR=" " # <-- There is a single CR between the " chars here. 467 CR=" " # <-- There is a single CR between the " chars here.
456 468