diff options
author | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-05-26 15:22:43 +0000 |
---|---|---|
committer | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-05-26 15:22:43 +0000 |
commit | 361ec86696628cdfe2f8904211c8b747bde10468 (patch) | |
tree | 1c78f989e9104fbffd9ae8adaefb34e2596981dc /IkiWiki/Rcs | |
parent | 526044e1da808a3ab291e21be5401e7d84ebecc0 (diff) |
* --getctime had bitrotted (well I only ever used it the once so far..),
fix and make it a bit more flexible
* rcs_getctime is changed, now rather than needing to loop over all pages,
it should just use the rcs to get the ctime of the passed file.
Diffstat (limited to 'IkiWiki/Rcs')
-rw-r--r-- | IkiWiki/Rcs/Stub.pm | 2 | ||||
-rw-r--r-- | IkiWiki/Rcs/svn.pm | 43 |
2 files changed, 22 insertions, 23 deletions
diff --git a/IkiWiki/Rcs/Stub.pm b/IkiWiki/Rcs/Stub.pm index 15e6cfb48..82edbd43e 100644 --- a/IkiWiki/Rcs/Stub.pm +++ b/IkiWiki/Rcs/Stub.pm @@ -27,7 +27,7 @@ sub rcs_recentchanges ($) { sub rcs_notify () { } -sub rcs_getctime () { +sub rcs_getctime ($) { error "getctime not implemented"; } diff --git a/IkiWiki/Rcs/svn.pm b/IkiWiki/Rcs/svn.pm index b45b69197..86fe69ab8 100644 --- a/IkiWiki/Rcs/svn.pm +++ b/IkiWiki/Rcs/svn.pm @@ -227,32 +227,31 @@ sub rcs_notify () { #{{{ } } #}}} -sub rcs_getctime () { #{{{ +sub rcs_getctime ($) { #{{{ + my $file=shift; eval q{use Date::Parse}; - foreach my $page (keys %pagectime) { - my $file="$config{srcdir}/$pagesources{$page}"; - next unless -e $file; - my $child = open(SVNLOG, "-|"); - if (! $child) { - exec("svn", "log", $file) || error("svn log $file failed to run"); - } + + my $child = open(SVNLOG, "-|"); + if (! $child) { + exec("svn", "log", $file) || error("svn log $file failed to run"); + } - my $date; - while (<SVNLOG>) { - if (/$svn_log_infoline/) { - $date=$3; - } - } - close SVNLOG || warn "svn log $file exited $?"; + my $date; + while (<SVNLOG>) { + if (/$svn_log_infoline/) { + $date=$3; + } + } + close SVNLOG || warn "svn log $file exited $?"; - if (! defined $date) { - warn "failed to parse svn log for $file\n"; - next; - } - - $pagectime{$page}=$date=str2time($date); - debug("found ctime ".localtime($date)." for $page"); + if (! defined $date) { + warn "failed to parse svn log for $file\n"; + return 0; } + + $date=str2time($date); + debug("found ctime ".localtime($date)." for $file"); + return $date; } #}}} 1 |