]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki.pm
Merge branch 'master' into revert
[git.ikiwiki.info.git] / IkiWiki.pm
index 6fd11296013eef2004dee6dd939c70230eaaf70c..466907c9db12ca308aed17a270c57326d0e64aff 100644 (file)
@@ -717,7 +717,7 @@ sub pagename ($) {
 
        my $type=pagetype($file);
        my $page=$file;
-       $page=~s/\Q.$type\E*$//
+       $page=~s/\Q.$type\E*$//
                if defined $type && !$hooks{htmlize}{$type}{keepextension}
                        && !$hooks{htmlize}{$type}{noextension};
        if ($config{indexpages} && $page=~/(.*)\/index$/) {
@@ -1124,7 +1124,7 @@ sub isselflink ($$) {
        my $page=shift;
        my $link=shift;
 
-        return $page eq $link;
+       return $page eq $link;
 }
 
 sub htmllink ($$$;@) {
@@ -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;
@@ -2401,14 +2415,17 @@ package IkiWiki::PageSpec;
 sub derel ($$) {
        my $path=shift;
        my $from=shift;
-       if ($path eq '.') {
-               $path = $from;
-       }
 
-       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;