}
} #}}}
-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
Be vebose about what is being done.
-* --fixctime
+* --getctime
- Pull last changed time for all pages out of the revision control system.
- This rarely used option provides a way to get the real creation times of
- items in weblogs, for example when building a wiki from a new subversion
- checkout. It is unoptimised and quite slow.
+ Pull last changed time for each new page out of the revision control
+ system. This rarely used option provides a way to get the real creation
+ times of items in weblogs, for example when building a wiki from a new
+ subversion checkout. It is unoptimised and quite slow. It is best used
+ with --rebuild, to force ikiwiki to get the ctime for all pages.
# AUTHOR