Report bugs to <bug-gnu-emacs@gnu.org>.'
-Id='$Id: rcs2log,v 1.48 2001/09/05 23:07:46 eggert Exp $'
+Id='$Id: rcs2log,v 1.51 2003/09/01 15:45:03 miles Exp $'
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2001
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2001, 2002, 2003
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-Copyright='Copyright (C) 2001 Free Software Foundation, Inc.
+Copyright='Copyright (C) 2003 Free Software Foundation, Inc.
This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of this program
under the terms of the GNU General Public License.
# Parse options.
# defaults
-: ${AWK=awk}
-: ${TMPDIR=/tmp}
+AWK=${AWK-awk}
+TMPDIR=${TMPDIR-/tmp}
changelog=ChangeLog # change log file name
datearg= # rlog date option
hostname= # name of local host (if empty, will deduce it later)
# If no rlog options are given,
# log the revisions checked in since the first ChangeLog entry.
- # Since ChangeLog is only by date, some of these revisions may be duplicates of
- # what's already in ChangeLog; it's the user's responsibility to remove them.
+ # Since ChangeLog is only by date, some of these revisions may be
+ # duplicates of what's already in ChangeLog; it's the user's
+ # responsibility to remove them.
case $rlog_options in
'')
if test -s "$changelog"
esac
done
+ # If no rlog options are given, and if we are in a tagged CVS branch,
+ # log only the changes in that branch.
+ case $rlog_options in
+ '')
+ if test -f CVS/Tag
+ then
+ CVSTAG=`cat <CVS/Tag` || exit
+ case $CVSTAG in
+ T?*)
+ rlog_options=-r`expr "$CVSTAG" : 'T\(.*\)'`;;
+ *)
+ echo >&2 "$0: invalid CVS/Tag"; exit 1;;
+ esac
+ fi;;
+ esac
fi
# Use $rlog's -zLT option, if $rlog supports it.
esac
+# Prefer the POSIX-style -k options, since POSIX 1003.1-2001 prohibits
+# support for the traditional-style +M -N options.
+SORT_K_OPTIONS='-k 3,4r -k 5 -k 1'
+sort $SORT_K_OPTIONS </dev/null 2>/dev/null || SORT_K_OPTIONS='+2 -4r +4 +0'
+
+
# Get the full name of each author the logs mention, and set initialize_fullname
# to awk code that initializes the `fullname' awk associative array.
# Warning: foreign authors (i.e. not known in the passwd file) are mishandled;
# Sort the log entries, first by date+time (in reverse order),
# then by author, then by log entry, and finally by file name and revision
# (just in case).
-sort -t"$SOH" +2 -4r +4 +0 |
+sort -t"$SOH" $SORT_K_OPTIONS |
# Finally, reformat the sorted log entries.
$AWK -F"$SOH" '
# Local Variables:
# tab-width:4
# End:
+
+# arch-tag: cea067bd-a552-4254-ba17-078208933073