Mercurial > emacs
comparison lib-src/rcs2log @ 594:efa0c124c178
Add clumpname support.
author | Paul Eggert <eggert@twinsun.com> |
---|---|
date | Sat, 21 Mar 1992 05:58:05 +0000 |
parents | 4b75abb93479 |
children | d2de231ee7f5 |
comparison
equal
deleted
inserted
replaced
593:bd5346b8a486 | 594:efa0c124c178 |
---|---|
1 #!/bin/sh | 1 #!/bin/sh |
2 | 2 |
3 # RCS to ChangeLog generator | 3 # RCS to ChangeLog generator |
4 | 4 |
5 # $Id: rcs2clog,v 1.2 1992/02/05 04:31:18 eggert Exp eggert $ | 5 # $Id: rcs2clog,v 1.3 1992/02/05 17:25:10 eggert Exp eggert $ |
6 | 6 |
7 # Generate a change log prefix from RCS/* and the existing ChangeLog (if any). | 7 # Generate a change log prefix from RCS/* and the existing ChangeLog (if any). |
8 # Output the new prefix to standard output. | 8 # Output the new prefix to standard output. |
9 # You can edit this prefix by hand, and then prepend it to ChangeLog. | 9 # You can edit this prefix by hand, and then prepend it to ChangeLog. |
10 | 10 |
89 | 89 |
90 | 90 |
91 # Function to print a single log line. | 91 # Function to print a single log line. |
92 # We don't use awk functions, to stay compatible with old awk versions. | 92 # We don't use awk functions, to stay compatible with old awk versions. |
93 # `Log' is the log message (with \n replaced by \r). | 93 # `Log' is the log message (with \n replaced by \r). |
94 # `files' contains the affected files (each preceded by a space). | 94 # `files' contains the affected files. |
95 printlogline='{ | 95 printlogline='{ |
96 | 96 |
97 # Following the GNU coding standards, rewrite | 97 # Following the GNU coding standards, rewrite |
98 # * file: (function): comment | 98 # * file: (function): comment |
99 # to | 99 # to |
115 while ((i = index(Log, "\r")) != 0) { | 115 while ((i = index(Log, "\r")) != 0) { |
116 printf "%s%s\n", sep, substr(Log, 1, i-1) | 116 printf "%s%s\n", sep, substr(Log, 1, i-1) |
117 sep = indent_string | 117 sep = indent_string |
118 Log = substr(Log, i+1) | 118 Log = substr(Log, i+1) |
119 } | 119 } |
120 | |
121 printf "\n" | |
122 }' | 120 }' |
123 | 121 |
124 hostname=`( | 122 hostname=`( |
125 hostname || cat /etc/whoami || uuname -l || uname -n | 123 hostname || cat /etc/whoami || uuname -l || uname -n |
126 ) 2>/dev/null` || { | 124 ) 2>/dev/null` || { |
196 mo[12]=365 | 194 mo[12]=365 |
197 } | 195 } |
198 { | 196 { |
199 newlog = substr($0, 1 + index($0, "\r")) | 197 newlog = substr($0, 1 + index($0, "\r")) |
200 if (Log != newlog || date != $2 || author != $4) { | 198 if (Log != newlog || date != $2 || author != $4) { |
199 | |
201 # The previous log and this log differ. | 200 # The previous log and this log differ. |
202 # Print the old one. | 201 |
202 # Print the old log. | |
203 if (date != "") '"$printlogline"' | 203 if (date != "") '"$printlogline"' |
204 | |
205 # Logs that begin with "{clumpname} " should be grouped together, | |
206 # and the clumpname should be removed. | |
207 # Extract the new clumpname from the log header, | |
208 # and use it to decide whether to output a blank line. | |
209 newclumpname = "" | |
210 sep = "\n" | |
211 if (newlog ~ /^{[^ }]+}[ ]/) { | |
212 i = index(newlog, "}") | |
213 newclumpname = substr(newlog, 1, i) | |
214 while (substr(newlog, i+1) ~ /^[ ]/) i++ | |
215 newlog = substr(newlog, i+1) | |
216 if (clumpname == newclumpname) sep = "" | |
217 } | |
218 printf sep | |
219 clumpname = newclumpname | |
204 | 220 |
205 # Get ready for the next log. | 221 # Get ready for the next log. |
206 Log = newlog | 222 Log = newlog |
207 if (files != "") | 223 if (files != "") |
208 for (i in filesknown) | 224 for (i in filesknown) |
238 else | 254 else |
239 printf "%s\n\n", author | 255 printf "%s\n\n", author |
240 } | 256 } |
241 if (! filesknown[$1]) { | 257 if (! filesknown[$1]) { |
242 filesknown[$1] = 1 | 258 filesknown[$1] = 1 |
243 files = files " " $1 | 259 if (files == "") files = " " $1 |
260 else files = files ", " $1 | |
244 } | 261 } |
245 } | 262 } |
246 END { | 263 END { |
247 # Print the last log. | 264 # Print the last log. |
248 if (date != "") '"$printlogline"' | 265 if (date != "") { |
266 '"$printlogline"' | |
267 printf "\n" | |
268 } | |
249 } | 269 } |
250 ' && | 270 ' && |
251 | 271 |
252 | 272 |
253 # Exit successfully. | 273 # Exit successfully. |