]> scripts.mit.edu Git - www/ikiwiki.git/blobdiff - IkiWiki/Plugin/bzr.pm
--gettime revamp
[www/ikiwiki.git] / IkiWiki / Plugin / bzr.pm
index 7eb5cfe93dd9987d63634c05ae51193c97f08915..f79ca7c8f52e53831414d7f327d44664a4bf67b2 100644 (file)
@@ -20,6 +20,7 @@ sub import {
        hook(type => "rcs", id => "rcs_recentchanges", call => \&rcs_recentchanges);
        hook(type => "rcs", id => "rcs_diff", call => \&rcs_diff);
        hook(type => "rcs", id => "rcs_getctime", call => \&rcs_getctime);
+       hook(type => "rcs", id => "rcs_getmtime", call => \&rcs_getmtime);
 }
 
 sub checkconfig () {
@@ -83,15 +84,13 @@ sub bzr_log ($) {
                }
                elsif ($line =~ /^(modified|added|renamed|renamed and modified|removed):/) {
                        $key = "files";
-                       unless (defined($info{$key})) { $info{$key} = ""; }
+                       $info{$key} = "" unless defined $info{$key};
                }
                elsif (defined($key) and $line =~ /^  (.*)/) {
                        $info{$key} .= "$1\n";
                }
                elsif ($line eq "------------------------------------------------------------\n") {
-                       if (keys %info) {
-                               push (@infos, {%info});
-                       }
+                       push @infos, {%info} if keys %info;
                        %info = ();
                        $key = undef;
                }
@@ -108,6 +107,7 @@ sub bzr_log ($) {
                }
        }
        close $out;
+       push @infos, {%info} if keys %info;
 
        return @infos;
 }
@@ -307,4 +307,8 @@ sub rcs_getctime ($) {
        return $ctime;
 }
 
+sub rcs_getmtime ($) {
+       error "rcs_getmtime is not implemented for bzr\n"; # TODO
+}
+
 1