Mercurial > emacs
comparison lib-src/rcs2log @ 636:dce8cdbac0ea
Ignore log messages that start with `#'.
author | Paul Eggert <eggert@twinsun.com> |
---|---|
date | Fri, 08 May 1992 21:45:00 +0000 |
parents | d2de231ee7f5 |
children | 36e7f4e402bd |
comparison
equal
deleted
inserted
replaced
635:197f38dd0105 | 636:dce8cdbac0ea |
---|---|
1 #!/bin/sh | 1 #!/bin/sh |
2 | 2 |
3 # RCS to ChangeLog generator | 3 # RCS to ChangeLog generator |
4 | 4 |
5 # $Id: rcs2log,v 1.4 1992/03/21 05:58:05 eggert Exp eggert $ | 5 # $Id: rcs2log,v 1.5 1992/04/01 08:57:55 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 |
11 # Ignore log entries that start with `#'. | |
12 # Clump together log entries that start with `{topic} ', | |
13 # where `topic' contains neither white space nor `}'. | |
11 | 14 |
12 # Parse options. | 15 # Parse options. |
13 | 16 |
14 # defaults | 17 # defaults |
15 indent=8 # indent of log line | 18 indent=8 # indent of log line |
148 time = substr($3, 1, length($3)-1) | 151 time = substr($3, 1, length($3)-1) |
149 author = substr($5, 1, length($5)-1) | 152 author = substr($5, 1, length($5)-1) |
150 printf "%s %s %s %s \r", filename, $2, time, author | 153 printf "%s %s %s %s \r", filename, $2, time, author |
151 next | 154 next |
152 } | 155 } |
153 if ($0 ~ /^(-----------*|===========*)/) { print ""; next } | 156 if ($0 ~ /^(-----------*|===========*)$/) { print ""; next } |
154 { printf "%s\r", $0 } | 157 printf "%s\r", $0 |
155 } | 158 } |
156 ' | | 159 ' | |
157 | 160 |
158 # Now each line is of the form | 161 # Now each line is of the form |
159 # FILENAME YYYY/MM/DD HH:MM:SS AUTHOR \rLOG | 162 # FILENAME YYYY/MM/DD HH:MM:SS AUTHOR \rLOG |
199 mo[0]=0; mo[1]=31; mo[2]=59; mo[3]=90 | 202 mo[0]=0; mo[1]=31; mo[2]=59; mo[3]=90 |
200 mo[4]=120; mo[5]=151; mo[6]=181; mo[7]=212 | 203 mo[4]=120; mo[5]=151; mo[6]=181; mo[7]=212 |
201 mo[8]=243; mo[9]=273; mo[10]=304; mo[11]=334 | 204 mo[8]=243; mo[9]=273; mo[10]=304; mo[11]=334 |
202 mo[12]=365 | 205 mo[12]=365 |
203 } | 206 } |
207 | |
204 { | 208 { |
205 newlog = substr($0, 1 + index($0, "\r")) | 209 newlog = substr($0, 1 + index($0, "\r")) |
210 | |
211 # Ignore log entries prefixed by "#". | |
212 if (newlog ~ /^#/) { next } | |
213 | |
206 if (Log != newlog || date != $2 || author != $4) { | 214 if (Log != newlog || date != $2 || author != $4) { |
207 | 215 |
208 # The previous log and this log differ. | 216 # The previous log and this log differ. |
209 | 217 |
210 # Print the old log. | 218 # Print the old log. |
215 # Extract the new clumpname from the log header, | 223 # Extract the new clumpname from the log header, |
216 # and use it to decide whether to output a blank line. | 224 # and use it to decide whether to output a blank line. |
217 newclumpname = "" | 225 newclumpname = "" |
218 sep = "\n" | 226 sep = "\n" |
219 if (date == "") sep = "" | 227 if (date == "") sep = "" |
220 if (newlog ~ /^{[^ }]+}[ ]/) { | 228 if (newlog ~ /^{[^ }]*}[ ]/) { |
221 i = index(newlog, "}") | 229 i = index(newlog, "}") |
222 newclumpname = substr(newlog, 1, i) | 230 newclumpname = substr(newlog, 1, i) |
223 while (substr(newlog, i+1) ~ /^[ ]/) i++ | 231 while (substr(newlog, i+1) ~ /^[ ]/) i++ |
224 newlog = substr(newlog, i+1) | 232 newlog = substr(newlog, i+1) |
225 if (clumpname == newclumpname) sep = "" | 233 if (clumpname == newclumpname) sep = "" |