annotate lib-src/rcs2log @ 5908:6174848f3e6c

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