From 5c6f7a8d1b805001a3d1ee912683755cec773682 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 8 Oct 2010 18:02:47 -0400 Subject: fix rcs_prepedit implementation to match spec --- IkiWiki/Plugin/git.pm | 14 +++++--------- IkiWiki/Plugin/recentchanges.pm | 9 +++++++-- 2 files changed, 12 insertions(+), 11 deletions(-) (limited to 'IkiWiki') 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); -- cgit v1.2.3