From f98b1c149e3460914be9785cd4370701dd142bc8 Mon Sep 17 00:00:00 2001 From: "slamm%netscape.com" Date: Thu, 4 Nov 1999 02:14:56 +0000 Subject: [PATCH] Do run-length encoding for the raw data option. End revision records with a period. Buffer the raw data output. --- webtools/bonsai/cvsblame.cgi | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/webtools/bonsai/cvsblame.cgi b/webtools/bonsai/cvsblame.cgi index 2bf631c0bf51..fa6afb65acfc 100755 --- a/webtools/bonsai/cvsblame.cgi +++ b/webtools/bonsai/cvsblame.cgi @@ -57,8 +57,6 @@ require 'CGI.pl'; require 'cvsblame.pl'; use SourceChecker; -$| = 1; - # Cope with the cookie and print the header, first thing. That way, if # any errors result, they will show up for the user. @@ -438,6 +436,8 @@ sub print_top { $title_text .= ")"; $title_text =~ s/\(\)//; + $| = 1; + print "CVS Blame $title_text"; print <<__TOP__ if $use_layers; @@ -636,13 +636,22 @@ __BOTTOM__ sub print_raw_data { my %revs_seen = (); + my $prev_rev = $::revision_map[0]; + my $count = 0; for my $rev (@::revision_map) { - print "$rev\n"; - $revs_seen{$rev} = 1; + if ($prev_rev eq $rev) { + $count++; + } else { + print "$prev_rev:$count\n"; + $count = 1; + $prev_rev = $rev; + $revs_seen{$rev} = 1; + } } + print "$prev_rev:$count\n"; print "REVISION DETAILS\n"; for my $rev (sort keys %revs_seen) { - print "$rev|$::revision_ctime{$rev}|$::revision_author{$rev}|$::revision_log{$rev}"; + print "$rev|$::revision_ctime{$rev}|$::revision_author{$rev}|$::revision_log{$rev}.\n"; } }