]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/mercurial.pm
relativedate: Fix problem with localised dates not working.
[ikiwiki.git] / IkiWiki / Plugin / mercurial.pm
index 6c4855e5707016dd9e80776b22f795b15a182355..34e009c7a659a343f409adf4a1da1f379e469be6 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 () {
@@ -36,6 +37,7 @@ sub getsetup () {
                plugin => {
                        safe => 0, # rcs plugin
                        rebuild => undef,
+                       section => "rcs",
                },
                mercurial_wrapper => {
                        type => "string",
@@ -236,7 +238,7 @@ sub rcs_getctime ($) {
 
        # XXX filename passes through the shell here, should try to avoid
        # that just in case
-       my @cmdline = ("hg", "-R", $config{srcdir}, "log", "-v", "-l", '1', 
+       my @cmdline = ("hg", "-R", $config{srcdir}, "log", "-v",
                "--style", "default", "$config{srcdir}/$file");
        open (my $out, "@cmdline |");
 
@@ -249,8 +251,12 @@ sub rcs_getctime ($) {
        eval q{use Date::Parse};
        error($@) if $@;
        
-       my $ctime = str2time($log[0]->{"date"});
+       my $ctime = str2time($log[$#log]->{"date"});
        return $ctime;
 }
 
+sub rcs_getmtime ($) {
+       error "rcs_getmtime is not implemented for mercurial\n"; # TODO
+}
+
 1