From: Martin Mares Date: Mon, 31 May 2004 22:34:43 +0000 (+0000) Subject: Improved cvslog script. X-Git-Tag: holmes-import~1060 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=565b06449d4ffe2959efff47f99a02f4b09ea2c7;p=libucw.git Improved cvslog script. --- diff --git a/build/cvslog b/build/cvslog index feded092..fd2f0ca4 100755 --- a/build/cvslog +++ b/build/cvslog @@ -1,13 +1,27 @@ #!/usr/bin/perl # Process `cvs log' output to get a resonable changelog -# (c) 2003 Martin Mares +# (c) 2003--2004 Martin Mares use Digest::MD5; use POSIX; +my %names= ( + 'mj' => 'Martin Mares ', + 'robert' => 'Robert Spalek ', + 'tom' => 'Tomas Valla ', + 'valla' => 'Tomas Valla ', + 'milan' => 'Milan Vancura ', + 'milanek' => 'Milan Vancura ', + 'tomhol' => 'Tomas Holusa ', + 'centrum' => 'Tomas Holusa ', + 'root' => 'Tomas Holusa ', + 'pavel' => 'Pavel Machek ' +); + while () { chomp; /^$/ && next; + /^[?]/ && next; /^RCS file: / || die; $_ = ; chomp; @@ -22,27 +36,32 @@ while () { if (/^------/) { $_ = ; next; } /^revision / || die; $_ = ; + my ($author) = /;\s*author:\s*([^;]+)/ or die; my ($yy,$mm,$dd,$HH,$MM,$SS) = /^date: (....)\/(..)\/(..) (..):(..):(..);/ or die; my $t = POSIX::mktime($SS,$MM,$HH,$dd,$mm-1,$yy-1900) or die; my $T = sprintf("%06d", int(($t + 1800)/3600)); $d = ""; while ($_ = ) { /^(-----|=====)/ && last; - $d .= $_; + $d .= " $_"; } my $id = "$T:" . Digest::MD5::md5_hex($d); if (!defined $msg{$id}) { $date{$id} = "$yy-$mm-$dd $HH:$MM:$SS"; $msg{$id} = $d; $files{$id} = ""; + $author{$id} = $author; } - $files{$id} .= "\t* $file\n"; + $files{$id} .= " * $file\n"; #print "\t$id\n"; } } foreach $id (sort keys %date) { - print "### ", $date{$id}, "\n\n"; + if (!exists ($names{$author{$id}})) { + die "Unknown commiter $author{$id}"; + } + print "### ", $date{$id}, " ", $names{$author{$id}}, "\n\n"; print $files{$id}, "\n"; print $msg{$id}, "\n"; }