summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2010-10-08 18:02:47 -0400
committerJoey Hess <joey@kitenet.net>2010-10-08 18:02:47 -0400
commit5c6f7a8d1b805001a3d1ee912683755cec773682 (patch)
tree424edc6efbd279597d2a43991c4a3566174e73e1
parent84111d96c461a5d31a615ebf64cae751e6fd9aef (diff)
fix rcs_prepedit implementation to match spec
-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);