]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/git.pm
convert rcs_revert to only stage the reversion
[ikiwiki.git] / IkiWiki / Plugin / git.pm
index 5922494bce8859124b99dcd53613ca7c49320fe6..996ab6fba0f5e6076c3a793d4ec06ef57ec93b6f 100644 (file)
@@ -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