annotate lib-src/rcs2log @ 384:bbff43aa5eb7 r21-2-7

Import from CVS: tag r21-2-7
author cvs
date Mon, 13 Aug 2007 11:08:24 +0200
parents 929b76928fce
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
1 #! /bin/sh
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 # RCS to ChangeLog generator
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
5 # Generate a change log prefix from RCS files (perhaps in the CVS repository)
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
6 # and the ChangeLog (if any).
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 # Output the new prefix to standard output.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 # You can edit this prefix by hand, and then prepend it to ChangeLog.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 # Ignore log entries that start with `#'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 # Clump together log entries that start with `{topic} ',
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 # where `topic' contains neither white space nor `}'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
14 Help='The default FILEs are the files registered under the working directory.
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
15 Options:
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
17 -c CHANGELOG Output a change log prefix to CHANGELOG (default ChangeLog).
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
18 -h HOSTNAME Use HOSTNAME in change log entries (default current host).
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
19 -i INDENT Indent change log lines by INDENT spaces (default 8).
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
20 -l LENGTH Try to limit log lines to LENGTH characters (default 79).
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
21 -R If no FILEs are given and RCS is used, recurse through working directory.
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
22 -r OPTION Pass OPTION to subsidiary log command.
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
23 -t TABWIDTH Tab stops are every TABWIDTH characters (default 8).
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
24 -u "LOGIN<tab>FULLNAME<tab>MAILADDR" Assume LOGIN has FULLNAME and MAILADDR.
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
25 -v Append RCS revision to file names in log lines.
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
26 --help Output help.
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
27 --version Output version number.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
29 Report bugs to <bug-gnu-emacs@prep.ai.mit.edu>.'
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
30
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
31 Id='$Id: rcs2log,v 1.2 1997/07/09 04:31:03 steve Exp $'
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
32
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
33 # Copyright 1992, 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 # This program is free software; you can redistribute it and/or modify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 # it under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 # the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 # any later version.
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
39 #
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 # This program is distributed in the hope that it will be useful,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 # but WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 # GNU General Public License for more details.
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
44 #
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 # You should have received a copy of the GNU General Public License
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
46 # along with this program; see the file COPYING. If not, write to the
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
47 # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
48 # Boston, MA 02111-1307, USA.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
50 Copyright='Copyright 1997 Free Software Foundation, Inc.
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
51 This program comes with NO WARRANTY, to the extent permitted by law.
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
52 You may redistribute copies of this program
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
53 under the terms of the GNU General Public License.
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
54 For more information about these matters, see the files named COPYING.
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
55 Author: Paul Eggert <eggert@twinsun.com>'
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
56
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
57 tab=' '
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 nl='
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 '
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 # Parse options.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 # defaults
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
64 : ${AWK=awk}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 : ${TMPDIR=/tmp}
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
66 changelog=ChangeLog # change log file name
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
67 datearg= # rlog date option
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 hostname= # name of local host (if empty, will deduce it later)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 indent=8 # indent of log line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 length=79 # suggested max width of log line
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
71 logins= # login names for people we know fullnames and mailaddrs of
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
72 loginFullnameMailaddrs= # login<tab>fullname<tab>mailaddr triplets
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
73 logTZ= # time zone for log dates (if empty, use local time)
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
74 recursive= # t if we want recursive rlog
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
75 revision= # t if we want revision numbers
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 rlog_options= # options to pass to rlog
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 tabwidth=8 # width of horizontal tab
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 while :
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 do
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 case $1 in
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
82 -c) changelog=${2?}; shift;;
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
83 -i) indent=${2?}; shift;;
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
84 -h) hostname=${2?}; shift;;
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
85 -l) length=${2?}; shift;;
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
86 -[nu]) # -n is obsolescent; it is replaced by -u.
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
87 case $1 in
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
88 -n) case ${2?}${3?}${4?} in
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
89 *"$tab"* | *"$nl"*)
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
90 echo >&2 "$0: -n '$2' '$3' '$4': tabs, newlines not allowed"
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
91 exit 1
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
92 esac
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
93 loginFullnameMailaddrs=$loginFullnameMailaddrs$nl$2$tab$3$tab$4
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
94 shift; shift; shift;;
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
95 -u)
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
96 # If $2 is not tab-separated, use colon for separator.
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
97 case ${2?} in
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
98 *"$nl"*)
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
99 echo >&2 "$0: -u '$2': newlines not allowed"
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
100 exit 1;;
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
101 *"$tab"*)
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
102 t=$tab;;
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
103 *)
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
104 t=:
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
105 esac
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
106 case $2 in
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
107 *"$t"*"$t"*"$t"*)
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
108 echo >&2 "$0: -u '$2': too many fields"
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
109 exit 1;;
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
110 *"$t"*"$t"*)
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
111 ;;
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
112 *)
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
113 echo >&2 "$0: -u '$2': not enough fields"
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
114 exit 1
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
115 esac
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
116 loginFullnameMailaddrs=$loginFullnameMailaddrs$nl$2
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
117 shift
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 esac
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
119 logins=$logins$nl$login
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
120 ;;
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
121 -r) rlog_options=$rlog_options$nl${2?}; shift;;
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
122 -R) recursive=t;;
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
123 -t) tabwidth=${2?}; shift;;
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
124 -v) revision=t;;
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
125 --version)
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
126 set $Id
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
127 rcs2logVersion=$3
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
128 echo >&2 "rcs2log (GNU Emacs) $rcs2logVersion$nl$Copyright"
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
129 exit 0;;
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
130 -*) echo >&2 "Usage: $0 [OPTION]... [FILE ...]$nl$Help"
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
131 case $1 in
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
132 --help) exit 0;;
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
133 *) exit 1
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
134 esac;;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 *) break
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 esac
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
137 shift
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 done
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 month_data='
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 m[0]="Jan"; m[1]="Feb"; m[2]="Mar"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 m[3]="Apr"; m[4]="May"; m[5]="Jun"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 m[6]="Jul"; m[7]="Aug"; m[8]="Sep"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 m[9]="Oct"; m[10]="Nov"; m[11]="Dec"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 '
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
148 # Put rlog output into $rlogout.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
150 # If no rlog options are given,
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
151 # log the revisions checked in since the first ChangeLog entry.
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
152 # Since ChangeLog is only by date, some of these revisions may be duplicates of
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
153 # what's already in ChangeLog; it's the user's responsibility to remove them.
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
154 case $rlog_options in
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
155 '')
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
156 if test -s "$changelog"
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
157 then
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
158 e='
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
159 /^[0-9]+-[0-9][0-9]-[0-9][0-9]/{
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
160 # ISO 8601 date
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
161 print $1
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
162 exit
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
163 }
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
164 /^... ... [ 0-9][0-9] [ 0-9][0-9]:[0-9][0-9]:[0-9][0-9] [0-9]+ /{
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
165 # old-fashioned date and time (Emacs 19.31 and earlier)
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
166 '"$month_data"'
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
167 year = $5
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
168 for (i=0; i<=11; i++) if (m[i] == $2) break
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
169 dd = $3
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
170 printf "%d-%02d-%02d\n", year, i+1, dd
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
171 exit
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
172 }
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
173 '
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
174 d=`$AWK "$e" <"$changelog"` || exit
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
175 case $d in
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
176 ?*) datearg="-d>$d"
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
177 esac
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
178 fi
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
179 esac
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
180
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
181 # Use TZ specified by ChangeLog local variable, if any.
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
182 if test -s "$changelog"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 then
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
184 extractTZ='
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
185 /^.*change-log-time-zone-rule['"$tab"' ]*:['"$tab"' ]*"\([^"]*\)".*/{
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
186 s//\1/; p; q
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
187 }
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
188 /^.*change-log-time-zone-rule['"$tab"' ]*:['"$tab"' ]*t.*/{
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
189 s//UTC0/; p; q
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 '
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
192 logTZ=`tail "$changelog" | sed -n "$extractTZ"`
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
193 case $logTZ in
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
194 ?*) TZ=$logTZ; export TZ
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 esac
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
198 # If CVS is in use, examine its repository, not the normal RCS files.
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
199 if test ! -f CVS/Repository
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
200 then
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
201 rlog=rlog
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
202 repository=
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
203 else
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
204 rlog='cvs -q log'
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
205 repository=`sed 1q <CVS/Repository` || exit
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
206 test ! -f CVS/Root || CVSROOT=`cat <CVS/Root` || exit
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
207 case $CVSROOT in
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
208 *:/*)
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
209 # remote repository
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
210 ;;
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
211 *)
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
212 # local repository
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
213 case $repository in
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
214 /*) ;;
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
215 *) repository=${CVSROOT?}/$repository
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
216 esac
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
217 if test ! -d "$repository"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 then
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
219 echo >&2 "$0: $repository: bad repository (see CVS/Repository)"
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
220 exit 1
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 fi
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
222 esac
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
223 fi
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
224
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
225 # Use $rlog's -zLT option, if $rlog supports it.
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
226 case `$rlog -zLT 2>&1` in
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
227 *' option'*) ;;
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
228 *) rlog_options=-zLT$nl$rlog_options
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 esac
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 # With no arguments, examine all files under the RCS directory.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 case $# in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 case $repository in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 '')
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 oldIFS=$IFS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 IFS=$nl
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
238 case $recursive in
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
239 t)
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
240 RCSdirs=`find . -name RCS -type d -print`
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
241 filesFromRCSfiles='s|,v$||; s|/RCS/|/|; s|^\./||'
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
242 files=`
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
243 {
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
244 case $RCSdirs in
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
245 ?*) find $RCSdirs \
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
246 -type f \
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
247 ! -name '*_' \
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
248 ! -name ',*,' \
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
249 ! -name '.*_' \
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
250 ! -name .rcsfreeze.log \
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
251 ! -name .rcsfreeze.ver \
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
252 -print
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
253 esac
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
254 find . -name '*,v' -print
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
255 } |
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
256 sort -u |
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
257 sed "$filesFromRCSfiles"
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
258 `;;
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
259 *)
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
260 files=
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
261 for file in RCS/.* RCS/* .*,v *,v
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
262 do
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
263 case $file in
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
264 RCS/. | RCS/.. | RCS/,*, | RCS/*_) continue;;
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
265 RCS/.rcsfreeze.log | RCS/.rcsfreeze.ver) continue;;
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
266 RCS/.\* | RCS/\* | .\*,v | \*,v) test -f "$file" || continue
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
267 esac
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
268 files=$files$nl$file
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
269 done
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
270 case $files in
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
271 '') exit 0
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
272 esac
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
273 esac
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
274 set x $files
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
275 shift
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 IFS=$oldIFS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 esac
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 esac
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
280 llogout=$TMPDIR/rcs2log$$l
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 rlogout=$TMPDIR/rcs2log$$r
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 trap exit 1 2 13 15
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
283 trap "rm -f $llogout $rlogout; exit 1" 0
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
285 case $datearg in
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
286 ?*) $rlog $rlog_options "$datearg" ${1+"$@"} >$rlogout;;
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
287 '') $rlog $rlog_options ${1+"$@"} >$rlogout
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
288 esac || exit
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 # Get the full name of each author the logs mention, and set initialize_fullname
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 # to awk code that initializes the `fullname' awk associative array.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 # Warning: foreign authors (i.e. not known in the passwd file) are mishandled;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 # you have to fix the resulting output by hand.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
296 initialize_fullname=
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
297 initialize_mailaddr=
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
298
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
299 case $loginFullnameMailaddrs in
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
300 ?*)
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
301 case $loginFullnameMailaddrs in
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
302 *\"* | *\\*)
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
303 sed 's/["\\]/\\&/g' >$llogout <<EOF || exit
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
304 $loginFullnameMailaddrs
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
305 EOF
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
306 loginFullnameMailaddrs=`cat $llogout`
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
307 esac
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
308
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
309 oldIFS=$IFS
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
310 IFS=$nl
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
311 for loginFullnameMailaddr in $loginFullnameMailaddrs
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
312 do
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
313 case $loginFullnameMailaddr in
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
314 *"$tab"*) IFS=$tab;;
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
315 *) IFS=:
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
316 esac
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
317 set x $loginFullnameMailaddr
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
318 login=$2
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
319 fullname=$3
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
320 mailaddr=$4
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
321 initialize_fullname="$initialize_fullname
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
322 fullname[\"$login\"] = \"$fullname\""
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
323 initialize_mailaddr="$initialize_mailaddr
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
324 mailaddr[\"$login\"] = \"$mailaddr\""
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
325 done
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
326 IFS=$oldIFS
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
327 esac
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
328
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
329 case $llogout in
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
330 ?*) sort -u -o $llogout <<EOF || exit
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 $logins
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 EOF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 esac
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
334 output_authors='/^date: / {
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
335 if ($2 ~ /^[0-9]*[-\/][0-9][0-9][-\/][0-9][0-9]$/ && $3 ~ /^[0-9][0-9]:[0-9][0-9]:[0-9][0-9][-+0-9:]*;$/ && $4 == "author:" && $5 ~ /^[^;]*;$/) {
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
336 print substr($5, 1, length($5)-1)
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
337 }
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
338 }'
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 authors=`
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
340 $AWK "$output_authors" <$rlogout |
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
341 case $llogout in
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 '') sort -u;;
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
343 ?*) sort -u | comm -23 - $llogout
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 esac
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 `
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 case $authors in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 ?*)
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
348 cat >$llogout <<EOF || exit
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
349 $authors
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
350 EOF
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
351 initialize_author_script='s/["\\]/\\&/g; s/.*/author[\"&\"] = 1/'
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
352 initialize_author=`sed -e "$initialize_author_script" <$llogout`
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 awkscript='
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 BEGIN {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 alphabet = "abcdefghijklmnopqrstuvwxyz"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 '"$initialize_author"'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 if (author[$1]) {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 fullname = $5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 if (fullname ~ /[0-9]+-[^(]*\([0-9]+\)$/) {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 # Remove the junk from fullnames like "0000-Admin(0000)".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 fullname = substr(fullname, index(fullname, "-") + 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 fullname = substr(fullname, 1, index(fullname, "(") - 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 if (fullname ~ /,[^ ]/) {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 # Some sites put comma-separated junk after the fullname.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 # Remove it, but leave "Bill Gates, Jr" alone.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 fullname = substr(fullname, 1, index(fullname, ",") - 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 abbr = index(fullname, "&")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 if (abbr) {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 a = substr($1, 1, 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 A = a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 i = index(alphabet, a)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 if (i) A = substr(ALPHABET, i, 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 fullname = substr(fullname, 1, abbr-1) A substr($1, 2) substr(fullname, abbr+1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 }
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
380
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
381 # Quote quotes and backslashes properly in full names.
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
382 # Do not use gsub; traditional awk lacks it.
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
383 quoted = ""
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
384 rest = fullname
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
385 for (;;) {
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
386 p = index(rest, "\\")
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
387 q = index(rest, "\"")
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
388 if (p) {
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
389 if (q && q<p) p = q
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
390 } else {
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
391 if (!q) break
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
392 p = q
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
393 }
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
394 quoted = quoted substr(rest, 1, p-1) "\\" substr(rest, p, 1)
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
395 rest = substr(rest, p+1)
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
396 }
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
397
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
398 printf "fullname[\"%s\"] = \"%s%s\"\n", $1, quoted, rest
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 author[$1] = 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 '
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 initialize_fullname=`
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
405 (
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
406 cat /etc/passwd
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
407 for author in $authors
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
408 do nismatch $author passwd.org_dir
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
409 done
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
410 ypmatch $authors passwd
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
411 ) 2>/dev/null |
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
412 $AWK -F: "$awkscript"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 `$initialize_fullname
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 esac
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 # Function to print a single log line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 # We don't use awk functions, to stay compatible with old awk versions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 # `Log' is the log message (with \n replaced by \r).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 # `files' contains the affected files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 printlogline='{
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 # Following the GNU coding standards, rewrite
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 # * file: (function): comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 # to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 # * file (function): comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 if (Log ~ /^\([^)]*\): /) {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 i = index(Log, ")")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 files = files " " substr(Log, 1, i)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 Log = substr(Log, i+3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 # If "label: comment" is too long, break the line after the ":".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 sep = " "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 if ('"$length"' <= '"$indent"' + 1 + length(files) + index(Log, CR)) sep = "\n" indent_string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 # Print the label.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 printf "%s*%s:", indent_string, files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 # Print each line of the log, transliterating \r to \n.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 while ((i = index(Log, CR)) != 0) {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 logline = substr(Log, 1, i-1)
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
443 if (logline ~ /[^'"$tab"' ]/) {
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 printf "%s%s\n", sep, logline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 } else {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 print ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 sep = indent_string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 Log = substr(Log, i+1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 }'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
453 # Pattern to match the `revision' line of rlog output.
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
454 rlog_revision_pattern='^revision [0-9]+\.[0-9]+(\.[0-9]+\.[0-9]+)*(['"$tab"' ]+locked by: [^'"$tab"' $,.0-9:;@]*[^'"$tab"' $,:;@][^'"$tab"' $,.0-9:;@]*;)?['"$tab"' ]*$'
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
455
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 case $hostname in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 '')
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 hostname=`(
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 hostname || uname -n || uuname -l || cat /etc/whoami
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 ) 2>/dev/null` || {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 echo >&2 "$0: cannot deduce hostname"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 exit 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 }
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
464
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
465 case $hostname in
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
466 *.*) ;;
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
467 *)
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
468 domainname=`(domainname) 2>/dev/null` &&
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
469 case $domainname in
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
470 *.*) hostname=$hostname.$domainname
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
471 esac
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
472 esac
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 esac
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 # Process the rlog output, generating ChangeLog style entries.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 # First, reformat the rlog output so that each line contains one log entry.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 # Transliterate \n to \r so that multiline entries fit on a single line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 # Discard irrelevant rlog output.
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
481 $AWK <$rlogout '
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
482 BEGIN { repository = "'"$repository"'" }
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
483 /^RCS file:/ {
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
484 if (repository != "") {
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
485 filename = $3
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
486 if (substr(filename, 1, length(repository) + 1) == repository "/") {
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
487 filename = substr(filename, length(repository) + 2)
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
488 }
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
489 if (filename ~ /,v$/) {
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
490 filename = substr(filename, 1, length(filename) - 2)
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
491 }
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
492 if (filename ~ /(^|\/)Attic\/[^\/]*$/) {
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
493 i = length(filename)
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
494 while (substr(filename, i, 1) != "/") i--
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
495 filename = substr(filename, 1, i - 6) substr(filename, i + 1)
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
496 }
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
497 }
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
498 rev = "?"
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
499 }
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
500 /^Working file:/ { if (repository == "") filename = $3 }
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
501 /'"$rlog_revision_pattern"'/, /^(-----------*|===========*)$/ {
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
502 if ($0 ~ /'"$rlog_revision_pattern"'/) {
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
503 rev = $2
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
504 next
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
505 }
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 if ($0 ~ /^date: [0-9][- +\/0-9:]*;/) {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 date = $2
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
508 if (date ~ /\//) {
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
509 # This is a traditional RCS format date YYYY/MM/DD.
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
510 # Replace "/"s with "-"s to get ISO format.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 newdate = ""
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
512 while ((i = index(date, "/")) != 0) {
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
513 newdate = newdate substr(date, 1, i-1) "-"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 date = substr(date, i+1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 date = newdate date
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 }
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
518 time = substr($3, 1, length($3) - 1)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 author = substr($5, 1, length($5)-1)
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
520 printf "%s %s %s %s %s %c", filename, rev, date, time, author, 13
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
521 rev = "?"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 next
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 }
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
524 if ($0 ~ /^branches: /) { next }
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 if ($0 ~ /^(-----------*|===========*)$/) { print ""; next }
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
526 if ($0 == "Initial revision" || $0 ~ /^file .+ was initially added on branch .+\.$/) {
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
527 $0 = "New file."
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
528 }
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 printf "%s%c", $0, 13
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 ' |
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 # Now each line is of the form
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
534 # FILENAME REVISION YYYY-MM-DD HH:MM:SS[+-TIMEZONE] AUTHOR \rLOG
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 # where \r stands for a carriage return,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 # and each line of the log is terminated by \r instead of \n.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 # Sort the log entries, first by date+time (in reverse order),
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
538 # then by author, then by log entry, and finally by file name and revision
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
539 # (just in case).
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
540 sort +2 -4r +4 +0 |
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 # Finally, reformat the sorted log entries.
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
543 $AWK '
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 BEGIN {
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
545 logTZ = "'"$logTZ"'"
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
546 revision = "'"$revision"'"
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
547
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
548 # Some awk variants do not understand "\r" or "\013", so we have to
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 # put a carriage return directly in the file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 CR=" " # <-- There is a single CR between the " chars here.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 # Initialize the fullname and mailaddr associative arrays.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 '"$initialize_fullname"'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 '"$initialize_mailaddr"'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 # Initialize indent string.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 indent_string = ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 i = '"$indent"'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 if (0 < '"$tabwidth"')
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 for (; '"$tabwidth"' <= i; i -= '"$tabwidth"')
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 indent_string = indent_string "\t"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 while (1 <= i--)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563 indent_string = indent_string " "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 newlog = substr($0, 1 + index($0, CR))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 # Ignore log entries prefixed by "#".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570 if (newlog ~ /^#/) { next }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
572 if (Log != newlog || date != $3 || author != $5) {
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574 # The previous log and this log differ.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576 # Print the old log.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577 if (date != "") '"$printlogline"'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 # Logs that begin with "{clumpname} " should be grouped together,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580 # and the clumpname should be removed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581 # Extract the new clumpname from the log header,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 # and use it to decide whether to output a blank line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583 newclumpname = ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584 sep = "\n"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 if (date == "") sep = ""
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
586 if (newlog ~ /^\{[^'"$tab"' }]*}['"$tab"' ]/) {
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587 i = index(newlog, "}")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588 newclumpname = substr(newlog, 1, i)
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
589 while (substr(newlog, i+1) ~ /^['"$tab"' ]/) i++
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 newlog = substr(newlog, i+1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591 if (clumpname == newclumpname) sep = ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593 printf sep
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594 clumpname = newclumpname
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 # Get ready for the next log.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597 Log = newlog
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598 if (files != "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599 for (i in filesknown)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600 filesknown[i] = 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601 files = ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602 }
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
603 if (date != $3 || author != $5) {
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
604 # The previous date+author and this date+author differ.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605 # Print the new one.
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
606 date = $3
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
607 time = $4
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
608 author = $5
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
609
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
610 zone = ""
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
611 if (logTZ && ((i = index(time, "-")) || (i = index(time, "+"))))
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
612 zone = " " substr(time, i)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
613
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
614 # Print "date[ timezone] fullname <email address>".
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
615 # Get fullname and email address from associative arrays;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
616 # default to author and author@hostname if not in arrays.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617 if (fullname[author])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
618 auth = fullname[author]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
619 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
620 auth = author
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
621 printf "%s%s %s ", date, zone, auth
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
622 if (mailaddr[author])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
623 printf "<%s>\n\n", mailaddr[author]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
624 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
625 printf "<%s@%s>\n\n", author, "'"$hostname"'"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
626 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
627 if (! filesknown[$1]) {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
628 filesknown[$1] = 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
629 if (files == "") files = " " $1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
630 else files = files ", " $1
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
631 if (revision && $2 != "?") files = files " " $2
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
632 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
633 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
634 END {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
635 # Print the last log.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
636 if (date != "") {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
637 '"$printlogline"'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
638 printf "\n"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
639 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
640 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
641 ' &&
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
642
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
643
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
644 # Exit successfully.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
645
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
646 exec rm -f $llogout $rlogout
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
647
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
648 # Local Variables:
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
649 # tab-width:4
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 0
diff changeset
650 # End: