diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2010-04-17 18:45:23 +0200 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-04-17 13:52:16 -0400 |
commit | 9ff5174f1164cb2d31ff487a9c84d08559b81d39 (patch) | |
tree | 3b9a56a18ff54b009c2df4d552d7cbf1fcc6617b /IkiWiki/Plugin/bzr.pm | |
parent | a1aa71efc9d1db42b425f43afc1ff4a37c4c0f3a (diff) | |
download | ikiwiki-9ff5174f1164cb2d31ff487a9c84d08559b81d39.tar ikiwiki-9ff5174f1164cb2d31ff487a9c84d08559b81d39.tar.gz |
Fix get_ctime implementation in Bazaar plugin, add get_mtime implementation.
Diffstat (limited to 'IkiWiki/Plugin/bzr.pm')
-rw-r--r-- | IkiWiki/Plugin/bzr.pm | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/IkiWiki/Plugin/bzr.pm b/IkiWiki/Plugin/bzr.pm index f79ca7c8f..3712302ce 100644 --- a/IkiWiki/Plugin/bzr.pm +++ b/IkiWiki/Plugin/bzr.pm @@ -286,14 +286,8 @@ sub rcs_diff ($) { } } -sub rcs_getctime ($) { - my ($file) = @_; - - # XXX filename passes through the shell here, should try to avoid - # that just in case - my @cmdline = ("bzr", "log", "--limit", '1', "$config{srcdir}/$file"); - open (my $out, "@cmdline |"); - +sub extract_timestamp ($) { + my ($out) = @_; my @log = bzr_log($out); if (length @log < 1) { @@ -307,8 +301,24 @@ sub rcs_getctime ($) { return $ctime; } +sub rcs_getctime ($) { + my ($file) = @_; + + # XXX filename passes through the shell here, should try to avoid + # that just in case + my @cmdline = ("bzr", "log", "--forward", "--limit", '1', "$config{srcdir}/$file"); + open (my $out, "@cmdline |"); + return extract_timestamp($out); +} + sub rcs_getmtime ($) { - error "rcs_getmtime is not implemented for bzr\n"; # TODO + my ($file) = @_; + + # XXX filename passes through the shell here, should try to avoid + # that just in case + my @cmdline = ("bzr", "log", "--limit", '1', "$config{srcdir}/$file"); + open (my $out, "@cmdline |"); + return extract_timestamp($out); } 1 |