]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki.pm
First cut at the revert plugin.
[ikiwiki.git] / IkiWiki.pm
index d114c9a69d760194e05c788e36a74d4c8ab3c144..e2b2ceda301ba064bd8808f0421d16a74fc08362 100644 (file)
@@ -1455,12 +1455,11 @@ sub filter ($$$) {
        return $content;
 }
 
-sub check_canedit ($$$;$$) {
+sub check_canedit ($$$;$) {
        my $page=shift;
        my $q=shift;
        my $session=shift;
        my $nonfatal=shift;
-       my $nosubs=shift;
        
        my $canedit;
        run_hooks(canedit => sub {
@@ -1471,7 +1470,6 @@ sub check_canedit ($$$;$$) {
                                $canedit=1;
                        }
                        elsif (ref $ret eq 'CODE') {
-                               error(sprintf(gettext("you are not allowed to change %s"), $page)) if $nosubs && ! $nonfatal;
                                $ret->() unless $nonfatal;
                                $canedit=0;
                        }
@@ -1771,12 +1769,14 @@ sub template_depends ($$;@) {
        my $page=shift;
        
        my ($filename, $tpage, $untrusted)=template_file($name);
+       if (! defined $filename) {
+               error(sprintf(gettext("template %s not found"), $name))
+       }
+
        if (defined $page && defined $tpage) {
                add_depends($page, $tpage);
        }
-
-       return unless defined $filename;
-
+       
        my @opts=(
                filter => sub {
                        my $text_ref = shift;
@@ -1941,6 +1941,18 @@ sub rcs_receive () {
        $hooks{rcs}{rcs_receive}{call}->();
 }
 
+sub rcs_preprevert ($) {
+       $hooks{rcs}{rcs_preprevert}{call}->(@_);
+}
+
+sub rcs_revert (@) {
+       $hooks{rcs}{rcs_revert}{call}->(@_);
+}
+
+sub rcs_showpatch ($) {
+       $hooks{rcs}{rcs_showpatch}{call}->(@_);
+}
+
 sub add_depends ($$;$) {
        my $page=shift;
        my $pagespec=shift;