call => \&htmlize);
} #}}}
-sub needsbuild () { #{{{
+sub needsbuild ($) { #{{{
+ my $needsbuild=shift;
my @changes=IkiWiki::rcs_recentchanges(100);
- updatechanges("*", "recentchanges", \@changes);
+ push @$needsbuild, updatechanges("*", "recentchanges", \@changes);
} #}}}
sub preprocess (@) { #{{{
];
push @{$change->{pages}}, { link => '...' } if $is_excess;
- # Take the first line of the commit message as a summary.
- #my $m=shift @{$change->{message}};
- #$change->{summary}=$m->{line};
- #delete $change->{message} unless @{$change->{message}};
-
# See if the committer is an openid.
my $oiduser=IkiWiki::openiduser($change->{user});
if (defined $oiduser) {
$change->{user};
}
+ # escape wikilinks and preprocessor stuff in commit messages
+ if (ref $change->{message}) {
+ foreach my $field (@{$change->{message}}) {
+ if (exists $field->{line}) {
+ $field->{line} =~ s/(?<!\\)\[\[/\\\[\[/g;
+ }
+ }
+ }
+
# Fill out a template with the change info.
my $template=template("change.tmpl", blind_cache => 1);
$template->param(
shift->(page => $page, destpage => $page, template => $template);
});
- my $html=$template->output;
- # escape wikilinks and preprocessor stuff
- $html=~s/(?<!\\)\[\[/\\\[\[/g;
- writefile($page."._change", $config{srcdir}, $html);
- utime $change->{when}, $change->{when}, "$config{srcdir}/$page._change";
+ my $file=$page."._change";
+ writefile($file, $config{srcdir}, $template->output);
+ utime $change->{when}, $change->{when}, "$config{srcdir}/$file";
+ return $file;
} #}}}
sub updatechanges ($$) { #{{{
my $pagespec=shift;
my $subdir=shift;
my @changes=@{shift()};
+ my @ret;
foreach my $change (@changes) {
- store($change, $subdir);
+ my $file=store($change, $subdir);
+ push @ret, $file if defined $file;
}
# TODO: delete old
+
+ return @ret;
} #}}}
1