]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki.pm
Complete rcs_preprevert and lightly test.
[ikiwiki.git] / IkiWiki.pm
index df8abe2c2711281c220a604aa0ddca09ec915a02..aa4dccac3f215c57fc833f1b6efda615eabac6ae 100644 (file)
@@ -1769,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;
@@ -1939,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;
@@ -2402,10 +2416,16 @@ sub derel ($$) {
        my $path=shift;
        my $from=shift;
 
-       if ($path =~ m!^\./!) {
-               $from=~s#/?[^/]+$## if defined $from;
-               $path=~s#^\./##;
-               $path="$from/$path" if defined $from && length $from;
+       if ($path =~ m!^\.(/|$)!) {
+               if ($1) {
+                       $from=~s#/?[^/]+$## if defined $from;
+                       $path=~s#^\./##;
+                       $path="$from/$path" if defined $from && length $from;
+               }
+               else {
+                       $path = $from;
+                       $path = "" unless defined $path;
+               }
        }
 
        return $path;