Statistics
| Branch: | Revision:

iof-bird / bird-2.0.1 / tools / cvslog @ 6b3f1a54

History | View | Annotate | Download (1.41 KB)

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
	'feela'	=> 'Ondrej Filip <feela@network.cz>',
11
	'pavel' => 'Pavel Machek <pavel@ucw.cz>'
12
);
13

    
14
while (<STDIN>) {
15
	chomp;
16
	/^$/ && next;
17
	/^[?]/ && next;
18
	/^RCS file: / || die;
19
	$_ = <STDIN>;
20
	chomp;
21
	my ($file) = /^Working file: (.*)$/ or die;
22
	#print "$file\n";
23
	do {
24
		$_ = <STDIN> or die;
25
	} while (!/^description:/);
26
	$_ = <STDIN>;
27
	for(;;) {
28
		/^======/ && last;
29
		if (/^------/) { $_ = <STDIN>; next; }
30
		/^revision / || die;
31
		$_ = <STDIN>;
32
		my ($author) = /;\s*author:\s*([^;]+)/ or die;
33
		my ($yy,$mm,$dd,$HH,$MM,$SS) = /^date: (....)\/(..)\/(..) (..):(..):(..);/ or die;
34
		my $t = POSIX::mktime($SS,$MM,$HH,$dd,$mm-1,$yy-1900) or die;
35
		my $T = sprintf("%06d", int(($t + 1800)/3600));
36
		$d = "";
37
		while ($_ = <STDIN>) {
38
			/^(-----|=====)/ && last;
39
			$d .= "  $_";
40
		}
41
		my $id = "$T:" . Digest::MD5::md5_hex($d);
42
		if (!defined $msg{$id}) {
43
			$date{$id} = "$yy-$mm-$dd $HH:$MM:$SS";
44
			$msg{$id} = $d;
45
			$files{$id} = "";
46
			$author{$id} = $author;
47
		}
48
		$files{$id} .= "  * $file\n";
49
		#print "\t$id\n";
50
	}
51
}
52

    
53
foreach $id (sort keys %date) {
54
	if (!exists ($names{$author{$id}})) {
55
		die "Unknown commiter $author{$id}";
56
	}
57
	print "### ", $date{$id}, "  ", $names{$author{$id}}, "\n\n";
58
	print $files{$id}, "\n";
59
	print $msg{$id}, "\n";
60
}