my @cmdline = ("hg", "-R", $config{srcdir}, "log", "-v", "-l", $num);
open (my $out, "@cmdline |");
+ eval q{use Date::Parse};
+ error($@) if $@;
+
my @ret;
foreach my $info (mercurial_log($out)) {
my @pages = ();
rev => $info->{"changeset"},
user => $user,
committype => "mercurial",
- when => $info->{"date"},
+ when => str2time($info->{"date"}),
message => [@message],
pages => [@pages],
};
} #}}}
sub rcs_getctime ($) { #{{{
- error "getctime not implemented";
+ my ($file) = @_;
+
+ # 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', $file);
+ open (my $out, "@cmdline |");
+
+ my @log = mercurial_log($out);
+
+ if (length @log < 1) {
+ return 0;
+ }
+
+ eval q{use Date::Parse};
+ error($@) if $@;
+
+ my $ctime = str2time($log[0]->{"date"});
+ return $ctime;
} #}}}
1
* Add softwaresite example.
* Add a poll plugin.
* Add quick mode for archive page generation.
+ * Mercurial backend improvements, including --get-ctime support.
- -- Joey Hess <joeyh@debian.org> Thu, 23 Nov 2006 17:13:32 -0500
+ -- Joey Hess <joeyh@debian.org> Sun, 26 Nov 2006 15:01:14 -0500
ikiwiki (1.33) unstable; urgency=low
}
}
}
-use Test::More tests => 10;
+use Test::More tests => 11;
BEGIN { use_ok("IkiWiki"); }
my $test2 = readfile("t/test2.mdwn");
writefile('test2.mdwn', $config{srcdir}, $test2);
system "hg add -R $config{srcdir} $config{srcdir}/test2.mdwn";
-system "hg commit -R $config{srcdir} -u \"$user\" -m \"$message\"";
+system "hg commit -R $config{srcdir} -u \"$user\" -m \"$message\" -d \"0 0\"";
@changes = IkiWiki::rcs_recentchanges(3);
is($changes[1]{pages}[0]{"page"}, "test1.mdwn");
+my $ctime = IkiWiki::rcs_getctime("test2.mdwn");
+is($ctime, 0);
+
system "rm -rf $dir";