]> sipb.mit.edu Git - ikiwiki.git/commitdiff
* --getctime had bitrotted (well I only ever used it the once so far..),
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Fri, 26 May 2006 15:22:43 +0000 (15:22 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Fri, 26 May 2006 15:22:43 +0000 (15:22 +0000)
   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.

IkiWiki/Rcs/Stub.pm
IkiWiki/Rcs/svn.pm
doc/usage.mdwn

index 15e6cfb480db22c59d1dd8cc47a3994f7e1b1455..82edbd43eb644651718c7a6ed9bca4737203dc2b 100644 (file)
@@ -27,7 +27,7 @@ sub rcs_recentchanges ($) {
 sub rcs_notify () {
 }
 
 sub rcs_notify () {
 }
 
-sub rcs_getctime () {
+sub rcs_getctime ($) {
        error "getctime not implemented";
 }
 
        error "getctime not implemented";
 }
 
index b45b69197a62c0afa3421491620f794893395071..86fe69ab88ebfdbafb25093ef26785ec77e07c1e 100644 (file)
@@ -227,32 +227,31 @@ sub rcs_notify () { #{{{
        }
 } #}}}
 
        }
 } #}}}
 
-sub rcs_getctime () { #{{{
+sub rcs_getctime ($) { #{{{
+       my $file=shift;
        eval q{use Date::Parse};
        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
 } #}}}
 
 1
index 03f40a8924edb902483d80bf16ba20e4fb6c9fd5..c0fab5232e5d5a0ec529d1f5db1c08e1f0c8a483 100644 (file)
@@ -181,12 +181,13 @@ These options configure the wiki.
 
   Be vebose about what is being done.
 
 
   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
 
 
 # AUTHOR