my $div=qr/^--------------------+$/;
my $infoline=qr/^r(\d+)\s+\|\s+([^\s]+)\s+\|\s+(\d+-\d+-\d+\s+\d+:\d+:\d+\s+[-+]?\d+).*/;
my $state='start';
- my ($rev, $user, $when, @pages, $message);
+ my ($rev, $user, $when, @pages, @message);
foreach (`LANG=C svn log -v '$svn_url'`) {
chomp;
if ($state eq 'start' && /$div/) {
}
elsif ($state eq 'body' && /$div/) {
push @ret, { rev => $rev, user => $user,
- when => $when, message => $message,
+ when => $when, message => [@message],
pages => [@pages] } if @pages;
return @ret if @ret >= $num;
$state='header';
- $message=$rev=$user=$when=undef;
- @pages=();
+ $rev=$user=$when=undef;
+ @pages=@message=();
}
elsif ($state eq 'body') {
- $message.="$_<br>\n";
+ push @message, {line => $_},
}
}
}
exit 0;
} #}}}
-sub cgi_recentchanges () { #{{{
+sub cgi_recentchanges ($) { #{{{
my $q=shift;
my $template=HTML::Template->new(
wikiname => $wikiname,
changelog => [rcs_recentchanges(100)],
);
- return $template->output;
+ print $q->header, $template->output;
} #}}}
sub cgi_signin ($$) { #{{{
}
if ($do eq 'recentchanges') {
- cgi_recentchanges();
+ cgi_recentchanges($q);
return;
}
($templatedir) = possibly_foolish_untaint(shift);
($destdir) = possibly_foolish_untaint(shift);
-print cgi_recentchanges();
-
if ($cgi && ! length $url) {
error("Must specify url to wiki with --url when using --cgi");
}