aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2010-10-08 17:54:12 -0400
committerJoey Hess <joey@kitenet.net>2010-10-08 17:54:12 -0400
commit84111d96c461a5d31a615ebf64cae751e6fd9aef (patch)
treec816fc340bd318eda018da949317d5e8787f595f /IkiWiki
parent594eb32780466e89390bacc61f8c28b1d4ca9f0b (diff)
downloadikiwiki-84111d96c461a5d31a615ebf64cae751e6fd9aef.tar
ikiwiki-84111d96c461a5d31a615ebf64cae751e6fd9aef.tar.gz
make revert hooks optional
I removed the IkiWiki::rcs_ stubs for the revert hooks. Instead recentchanges tests to see if the hooks are available and calls them directly.
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/recentchanges.pm9
1 files changed, 6 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/recentchanges.pm b/IkiWiki/Plugin/recentchanges.pm
index 44c981548..a6d7f9fce 100644
--- a/IkiWiki/Plugin/recentchanges.pm
+++ b/IkiWiki/Plugin/recentchanges.pm
@@ -93,7 +93,8 @@ sub sessioncgi ($$) {
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);
@@ -101,7 +102,7 @@ sub sessioncgi ($$) {
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),
@@ -186,7 +187,9 @@ sub store ($$$) {
];
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}