summaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/git.pm14
-rw-r--r--IkiWiki/Plugin/recentchanges.pm9
2 files changed, 12 insertions, 11 deletions
diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm
index 996ab6fba..48e71aa9a 100644
--- a/IkiWiki/Plugin/git.pm
+++ b/IkiWiki/Plugin/git.pm
@@ -836,19 +836,15 @@ sub rcs_receive () {
return reverse @rets;
}
-sub rcs_preprevert (@) {
- my %params = @_;
- my $rev = $params{rev};
-
- # Note test_changes expects 'cgi' and 'session' parameters.
- require IkiWiki::Receive;
- IkiWiki::Receive::test_changes(%params, changes =>
- [git_parse_changes(git_commit_info($rev, 1))]);
+sub rcs_preprevert ($) {
+ my $rev=shift;
+
+ return git_parse_changes(git_commit_info($rev, 1));
}
sub rcs_revert ($) {
# Try to revert the given rev; returns undef on _success_.
- my $rev = $shift;
+ my $rev = shift;
if (run_or_non('git', 'revert', '--no-commit', $rev)) {
return undef;
diff --git a/IkiWiki/Plugin/recentchanges.pm b/IkiWiki/Plugin/recentchanges.pm
index a6d7f9fce..56e17dcca 100644
--- a/IkiWiki/Plugin/recentchanges.pm
+++ b/IkiWiki/Plugin/recentchanges.pm
@@ -93,8 +93,13 @@ sub sessioncgi ($$) {
return unless $do eq 'revert' && $rev;
- $IkiWiki::hooks{rcs}{rcs_preprevert}{call}->(
- cgi => $q, session => $session, rev => $rev);
+ my @changes=$IkiWiki::hooks{rcs}{rcs_preprevert}{call}->($rev);
+ require IkiWiki::Receive;
+ IkiWiki::Receive::test_changes(
+ cgi => $q,
+ session => $session,
+ changes => \@changes,
+ );
my ($form, $buttons) = confirmation_form($q, $session);
IkiWiki::decode_form_utf8($form);