]> code.delx.au - gnu-emacs/blobdiff - lib-src/rcs2log
(last_node): Make it a global variable.
[gnu-emacs] / lib-src / rcs2log
index eabd369a9d6f0c5cb0d55c648bd54df642f33ad6..a304df9adbd4f1bfd43aee0c0ce93fc50d5858ca 100755 (executable)
@@ -29,9 +29,9 @@ Options:
 
 Report bugs to <bug-gnu-emacs@gnu.org>.'
 
-Id='$Id: rcs2log,v 1.47 2001/07/20 09:05:26 gerd Exp eggert $'
+Id='$Id: rcs2log,v 1.49 2001/11/28 23:55:08 eggert Exp eggert $'
 
-# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2001
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2001, 2002
 #  Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
@@ -49,7 +49,7 @@ Id='$Id: rcs2log,v 1.47 2001/07/20 09:05:26 gerd Exp eggert $'
 # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 # Boston, MA 02111-1307, USA.
 
-Copyright='Copyright 2001 Free Software Foundation, Inc.
+Copyright='Copyright (C) 2002 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.
@@ -79,8 +79,8 @@ nl='
 # 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)
@@ -354,6 +354,12 @@ case $rlogfile in
 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;
@@ -491,7 +497,7 @@ printlogline='{
        #       * file: (function): comment
        # to
        #       * file (function): comment
-       if (Log ~ /^\([^)]*\): /) {
+       if (Log ~ /^\([^)]*\):[\t\n ]/) {
                i = index(Log, ")")
                filefunc = substr(Log, 1, i)
                while ((j = index(filefunc, "\n"))) {
@@ -615,7 +621,7 @@ $AWK '
 # 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" '
@@ -663,7 +669,7 @@ $AWK -F"$SOH" '
                                newclumpname = substr(newlog, 1, i)
                                while (substr(newlog, i+1) ~ /^['"$tab"' ]/) i++
                                newlog = substr(newlog, i+1)
-                               if (clumpname == newclumpname) sep = ""
+                               if (clumpname == newclumpname && date == $3 && author == $5) sep = ""
                        }
                        printf sep
                        clumpname = newclumpname