]> mj.ucw.cz Git - libucw.git/blob - build/cvslog
added th2
[libucw.git] / build / cvslog
1 #!/usr/bin/perl
2 # Process `cvs log' output to get a resonable changelog
3 # (c) 2003--2004 Martin Mares <mj@ucw.cz>
4
5 use Digest::MD5;
6 use POSIX;
7
8 my %names= (
9         'mj'            => 'Martin Mares <mj@ucw.cz>',
10         'robert'        => 'Robert Spalek <robert@ucw.cz>',
11         'tom'           => 'Tomas Valla <tom@ucw.cz>',
12         'valla'         => 'Tomas Valla <tom@ucw.cz>',
13         'milan'         => 'Milan Vancura <milan@ucw.cz>',
14         'milanek'       => 'Milan Vancura <milan@ucw.cz>',
15         'tomhol'        => 'Tomas Holusa <tomas.holusa@netcentrum.cz>',
16         'centrum'       => 'Tomas Holusa <tomas.holusa@netcentrum.cz>',
17         'root'          => 'Tomas Holusa <tomas.holusa@netcentrum.cz>',
18         'pavel'         => 'Pavel Machek <pavel@ucw.cz>',
19         'th2'           => 'Tomas Holenda <tomas.holenda@netcentrum.cz>',
20 );
21
22 while (<STDIN>) {
23         chomp;
24         /^$/ && next;
25         /^[?]/ && next;
26         /^RCS file: / || die;
27         $_ = <STDIN>;
28         chomp;
29         my ($file) = /^Working file: (.*)$/ or die;
30         #print "$file\n";
31         do {
32                 $_ = <STDIN> or die;
33         } while (!/^description:/);
34         $_ = <STDIN>;
35         for(;;) {
36                 /^======/ && last;
37                 if (/^------/) { $_ = <STDIN>; next; }
38                 /^revision / || die;
39                 $_ = <STDIN>;
40                 my ($author) = /;\s*author:\s*([^;]+)/ or die;
41                 my ($yy,$mm,$dd,$HH,$MM,$SS) = /^date: (....)\/(..)\/(..) (..):(..):(..);/ or die;
42                 my $t = POSIX::mktime($SS,$MM,$HH,$dd,$mm-1,$yy-1900) or die;
43                 my $T = sprintf("%06d", int(($t + 1800)/3600));
44                 $d = "";
45                 while ($_ = <STDIN>) {
46                         /^(-----|=====)/ && last;
47                         $d .= "  $_";
48                 }
49                 my $id = "$T:" . Digest::MD5::md5_hex($d);
50                 if (!defined $msg{$id}) {
51                         $date{$id} = "$yy-$mm-$dd $HH:$MM:$SS";
52                         $msg{$id} = $d;
53                         $files{$id} = "";
54                         $author{$id} = $author;
55                 }
56                 $files{$id} .= "  * $file\n";
57                 #print "\t$id\n";
58         }
59 }
60
61 foreach $id (sort keys %date) {
62         if (!exists ($names{$author{$id}})) {
63                 die "Unknown commiter $author{$id}";
64         }
65         print "### ", $date{$id}, "  ", $names{$author{$id}}, "\n\n";
66         print $files{$id}, "\n";
67         print $msg{$id}, "\n";
68 }