X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/80da2b28403a7b2c9dd797e8acecdbe8088ec279..238e8b95a5b084e7131d3314b78419b9404cba4c:/IkiWiki/Plugin/git.pm diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm index 5922494bc..996ab6fba 100644 --- a/IkiWiki/Plugin/git.pm +++ b/IkiWiki/Plugin/git.pm @@ -29,7 +29,6 @@ sub import { hook(type => "rcs", id => "rcs_receive", call => \&rcs_receive); hook(type => "rcs", id => "rcs_preprevert", call => \&rcs_preprevert); hook(type => "rcs", id => "rcs_revert", call => \&rcs_revert); - hook(type => "rcs", id => "rcs_showpatch", call => \&rcs_showpatch); } sub checkconfig () { @@ -847,30 +846,17 @@ sub rcs_preprevert (@) { [git_parse_changes(git_commit_info($rev, 1))]); } -sub rcs_revert (@) { - # Try to revert the given patch; returns undef on _success_. - my %params = @_; - my $rev = $params{rev}; +sub rcs_revert ($) { + # Try to revert the given rev; returns undef on _success_. + my $rev = $shift; if (run_or_non('git', 'revert', '--no-commit', $rev)) { - debug "Committing revert for patch '$rev'."; - rcs_commit_staged(message => - sprintf(gettext("This reverts commit %s"), $rev), @_); + return undef; } else { - # No idea what is actually getting reverted, so all we can - # do is say we failed. run_or_die('git', 'reset', '--hard'); return sprintf(gettext("Failed to revert commit %s"), $rev); } } -sub rcs_showpatch (@) { - # Show the patch with the given revision id. - my %params = @_; - my $rev = $params{rev}; - - return join "\n", run_or_die('git', 'show', $rev); -} - 1