]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Rcs/svn.pm
misc fixes from Recai
[ikiwiki.git] / IkiWiki / Rcs / svn.pm
index b45b69197a62c0afa3421491620f794893395071..61c6409a7fe136b8ad7b88815c877cbee27b4300 100644 (file)
@@ -126,7 +126,7 @@ sub rcs_recentchanges ($) { #{{{
                                $diffurl=~s/\[\[r1\]\]/$rev - 1/eg;
                                $diffurl=~s/\[\[r2\]\]/$rev/g;
                                push @pages, {
-                                       link => htmllink("", pagename($file), 1),
+                                       link => htmllink("", "", pagename($file), 1),
                                        diffurl => $diffurl,
                                } if length $file;
                        }
@@ -145,7 +145,7 @@ sub rcs_recentchanges ($) { #{{{
                                }
                                
                                push @ret, { rev => $rev,
-                                       user => htmllink("", $user, 1),
+                                       user => htmllink("", "", $user, 1),
                                        committype => $committype,
                                        when => $when, message => [@message],
                                        pages => [@pages],
@@ -227,32 +227,31 @@ sub rcs_notify () { #{{{
        }
 } #}}}
 
-sub rcs_getctime () { #{{{
+sub rcs_getctime ($) { #{{{
+       my $file=shift;
        eval q{use Date::Parse};
-       foreach my $page (keys %pagectime) {
-               my $file="$config{srcdir}/$pagesources{$page}";
-               next unless -e $file;
-               my $child = open(SVNLOG, "-|");
-               if (! $child) {
-                       exec("svn", "log", $file) || error("svn log $file failed to run");
-               }
+               
+       my $child = open(SVNLOG, "-|");
+       if (! $child) {
+               exec("svn", "log", $file) || error("svn log $file failed to run");
+       }
 
-               my $date;
-               while (<SVNLOG>) {
-                       if (/$svn_log_infoline/) {
-                               $date=$3;
-                       }
-               }
-               close SVNLOG || warn "svn log $file exited $?";
+       my $date;
+       while (<SVNLOG>) {
+               if (/$svn_log_infoline/) {
+                       $date=$3;
+               }
+       }
+       close SVNLOG || warn "svn log $file exited $?";
 
-               if (! defined $date) {
-                       warn "failed to parse svn log for $file\n";
-                       next;
-               }
-               
-               $pagectime{$page}=$date=str2time($date);
-               debug("found ctime ".localtime($date)." for $page");
+       if (! defined $date) {
+               warn "failed to parse svn log for $file\n";
+               return 0;
        }
+               
+       $date=str2time($date);
+       debug("found ctime ".localtime($date)." for $file");
+       return $date;
 } #}}}
 
 1