$hooks{rcs}{rcs_receive}{call}->();
}
-sub rcs_preprevert ($) {
- $hooks{rcs}{rcs_preprevert}{call}->(@_);
-}
-
-sub rcs_revert ($) {
- $hooks{rcs}{rcs_revert}{call}->(@_);
-}
-
sub add_depends ($$;$) {
my $page=shift;
my $pagespec=shift;
return unless $do eq 'revert' && $rev;
- IkiWiki::rcs_preprevert(cgi => $q, session => $session, rev => $rev);
+ $IkiWiki::hooks{rcs}{rcs_preprevert}{call}->(
+ cgi => $q, session => $session, rev => $rev);
my ($form, $buttons) = confirmation_form($q, $session);
IkiWiki::decode_form_utf8($form);
if ($form->submitted eq 'Revert' && $form->validate) {
IkiWiki::checksessionexpiry($q, $session, $q->param('sid'));
IkiWiki::disable_commit_hook();
- my $r = IkiWiki::rcs_revert($rev);
+ my $r = $IkiWiki::hooks{rcs}{rcs_revert}{call}->($rev);
if (! defined $r) { # success
rcs_commit_staged(
message => sprintf(gettext("This reverts commit %s"), $rev),
];
push @{$change->{pages}}, { link => '...' } if $is_excess;
- if (length $config{cgiurl}) {
+ if (length $config{cgiurl} &&
+ exists $IkiWiki::hooks{rcs}{rcs_preprevert} &&
+ exists $IkiWiki::hooks{rcs}{rcs_revert}) {
$change->{reverturl} = IkiWiki::cgiurl(
do => "revert",
rev => $change->{rev}
This is used to get the page creation time for a file from the RCS, by looking
it up in the history.
-It's ok if this is not implemented, and throws an error.
-
If the RCS cannot determine a ctime for the file, return 0.
#### `rcs_getmtime($)`
so `rcs_commit_staged` will complete it. It should return undef on _success_
and an error message on failure.
+This hook and `rcs_preprevert` are optional, if not implemented, no revert
+web interface will be available.
+
### PageSpec plugins
It's also possible to write plugins that add new functions to