changeset 594:efa0c124c178

Add clumpname support.
author Paul Eggert <eggert@twinsun.com>
date Sat, 21 Mar 1992 05:58:05 +0000
parents bd5346b8a486
children 114b502d0822
files lib-src/=rcs2log lib-src/rcs2log
diffstat 2 files changed, 54 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/=rcs2log	Sat Mar 21 00:53:35 1992 +0000
+++ b/lib-src/=rcs2log	Sat Mar 21 05:58:05 1992 +0000
@@ -2,7 +2,7 @@
 
 # RCS to ChangeLog generator
 
-#	$Id: rcs2clog,v 1.2 1992/02/05 04:31:18 eggert Exp eggert $
+#	$Id: rcs2clog,v 1.3 1992/02/05 17:25:10 eggert Exp eggert $
 
 # Generate a change log prefix from RCS/* and the existing ChangeLog (if any).
 # Output the new prefix to standard output.
@@ -91,7 +91,7 @@
 # Function to print a single log line.
 # We don't use awk functions, to stay compatible with old awk versions.
 # `Log' is the log message (with \n replaced by \r).
-# `files' contains the affected files (each preceded by a space).
+# `files' contains the affected files.
 printlogline='{
 
 	# Following the GNU coding standards, rewrite
@@ -117,8 +117,6 @@
 		sep = indent_string
 		Log = substr(Log, i+1)
 	}
-
-	printf "\n"
 }'
 
 hostname=`(
@@ -198,10 +196,28 @@
 	{
 		newlog = substr($0, 1 + index($0, "\r"))
 		if (Log != newlog || date != $2 || author != $4) {
+
 			# The previous log and this log differ.
-			# Print the old one.
+
+			# Print the old log.
 			if (date != "") '"$printlogline"'
 
+			# Logs that begin with "{clumpname} " should be grouped together,
+			# and the clumpname should be removed.
+			# Extract the new clumpname from the log header,
+			# and use it to decide whether to output a blank line.
+			newclumpname = ""
+			sep = "\n"
+			if (newlog ~ /^{[^	 }]+}[	 ]/) {
+				i = index(newlog, "}")
+				newclumpname = substr(newlog, 1, i)
+				while (substr(newlog, i+1) ~ /^[	 ]/) i++
+				newlog = substr(newlog, i+1)
+				if (clumpname == newclumpname) sep = ""
+			}
+			printf sep
+			clumpname = newclumpname
+
 			# Get ready for the next log.
 			Log = newlog
 			if (files != "")
@@ -240,12 +256,16 @@
 		}
 		if (! filesknown[$1]) {
 			filesknown[$1] = 1
-			files = files " " $1
+			if (files == "") files = " " $1
+			else files = files ", " $1
 		}
 	}
 	END {
 		# Print the last log.
-		if (date != "") '"$printlogline"'
+		if (date != "") {
+			'"$printlogline"'
+			printf "\n"
+		}
 	}
 ' &&
 
--- a/lib-src/rcs2log	Sat Mar 21 00:53:35 1992 +0000
+++ b/lib-src/rcs2log	Sat Mar 21 05:58:05 1992 +0000
@@ -2,7 +2,7 @@
 
 # RCS to ChangeLog generator
 
-#	$Id: rcs2clog,v 1.2 1992/02/05 04:31:18 eggert Exp eggert $
+#	$Id: rcs2clog,v 1.3 1992/02/05 17:25:10 eggert Exp eggert $
 
 # Generate a change log prefix from RCS/* and the existing ChangeLog (if any).
 # Output the new prefix to standard output.
@@ -91,7 +91,7 @@
 # Function to print a single log line.
 # We don't use awk functions, to stay compatible with old awk versions.
 # `Log' is the log message (with \n replaced by \r).
-# `files' contains the affected files (each preceded by a space).
+# `files' contains the affected files.
 printlogline='{
 
 	# Following the GNU coding standards, rewrite
@@ -117,8 +117,6 @@
 		sep = indent_string
 		Log = substr(Log, i+1)
 	}
-
-	printf "\n"
 }'
 
 hostname=`(
@@ -198,10 +196,28 @@
 	{
 		newlog = substr($0, 1 + index($0, "\r"))
 		if (Log != newlog || date != $2 || author != $4) {
+
 			# The previous log and this log differ.
-			# Print the old one.
+
+			# Print the old log.
 			if (date != "") '"$printlogline"'
 
+			# Logs that begin with "{clumpname} " should be grouped together,
+			# and the clumpname should be removed.
+			# Extract the new clumpname from the log header,
+			# and use it to decide whether to output a blank line.
+			newclumpname = ""
+			sep = "\n"
+			if (newlog ~ /^{[^	 }]+}[	 ]/) {
+				i = index(newlog, "}")
+				newclumpname = substr(newlog, 1, i)
+				while (substr(newlog, i+1) ~ /^[	 ]/) i++
+				newlog = substr(newlog, i+1)
+				if (clumpname == newclumpname) sep = ""
+			}
+			printf sep
+			clumpname = newclumpname
+
 			# Get ready for the next log.
 			Log = newlog
 			if (files != "")
@@ -240,12 +256,16 @@
 		}
 		if (! filesknown[$1]) {
 			filesknown[$1] = 1
-			files = files " " $1
+			if (files == "") files = " " $1
+			else files = files ", " $1
 		}
 	}
 	END {
 		# Print the last log.
-		if (date != "") '"$printlogline"'
+		if (date != "") {
+			'"$printlogline"'
+			printf "\n"
+		}
 	}
 ' &&