diff options
author | Joey Hess <joey@kitenet.net> | 2011-07-30 10:52:49 +0200 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-07-30 10:52:49 +0200 |
commit | 5dd414fbe5c1b9ba5350e007486b5ff8d870fd04 (patch) | |
tree | c2ab479f4d452e2a1b0cb3407ac540331c7ee3c6 /IkiWiki | |
parent | 577f5d38376141a9bad565c8bbd4c35cd1e5c6e2 (diff) | |
download | ikiwiki-5dd414fbe5c1b9ba5350e007486b5ff8d870fd04.tar ikiwiki-5dd414fbe5c1b9ba5350e007486b5ff8d870fd04.tar.gz |
mercurial: fix date parsing so test suite passes
Diffstat (limited to 'IkiWiki')
-rw-r--r-- | IkiWiki/Plugin/mercurial.pm | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/IkiWiki/Plugin/mercurial.pm b/IkiWiki/Plugin/mercurial.pm index c7f920ab9..b7fe01485 100644 --- a/IkiWiki/Plugin/mercurial.pm +++ b/IkiWiki/Plugin/mercurial.pm @@ -361,15 +361,8 @@ sub findtimes ($$) { print $tmpl_fh 'file = "{file}\\n"' . "\n"; foreach my $line (run_or_die('hg', 'log', '--style', $tmpl_filename)) { - # {date} gives output on the form - # 1310694511.0-7200 - # where the first number is UTC Unix timestamp with one - # decimal (decimal always 0, at least on my system) - # followed by local timezone offset from UTC in - # seconds. - if (! defined $date && $line =~ /^\d+\.\d[+-]\d*$/) { - $line =~ s/^(\d+).*/$1/; - $date=$line; + if (! defined $date && $line =~ /^(\d+)/) { + $date=$1; } elsif (! length $line) { $date=undef; |