preserve ctimes across rebuilds
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Thu, 23 Mar 2006 21:54:30 +0000 (21:54 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Thu, 23 Mar 2006 21:54:30 +0000 (21:54 +0000)
IkiWiki/Render.pm
ikiwiki

index b3dfc364d12805e5bc3e24005fff2d5c4197588d..f397ff3207add69a0b7a2b1b7a0fc31256c6b356 100644 (file)
@@ -288,11 +288,11 @@ sub refresh () { #{{{
        foreach my $file (@files) {
                my $page=pagename($file);
                if (! $oldpagemtime{$page}) {
-                       debug("new page $page");
+                       debug("new page $page") unless exists $pagectime{$page};
                        push @add, $file;
                        $links{$page}=[];
                        $pagesources{$page}=$file;
-                       $pagectime{$page}=time;
+                       $pagectime{$page}=time unless exists $pagectime{$page};
                }
        }
        my @del;
diff --git a/ikiwiki b/ikiwiki
index 9001c5e2a424b7653a1e9ae0478c83320be16f34..87414ab5b8e03ea479d34f2830f60e94b2c376b4 100755 (executable)
--- a/ikiwiki
+++ b/ikiwiki
@@ -325,12 +325,14 @@ sub loadindex () { #{{{
                }
 
                my $page=pagename($items{src}[0]);
-               $pagesources{$page}=$items{src}[0];
-               $oldpagemtime{$page}=$items{mtime}[0];
+               if (! $config{rebuild}) {
+                       $pagesources{$page}=$items{src}[0];
+                       $oldpagemtime{$page}=$items{mtime}[0];
+                       $oldlinks{$page}=[@{$items{link}}];
+                       $links{$page}=[@{$items{link}}];
+                       $renderedfiles{$page}=$items{dest}[0];
+               }
                $pagectime{$page}=$items{ctime}[0];
-               $oldlinks{$page}=[@{$items{link}}];
-               $links{$page}=[@{$items{link}}];
-               $renderedfiles{$page}=$items{dest}[0];
        }
        close IN;
 } #}}}
@@ -473,7 +475,7 @@ sub main () { #{{{
        }
        else {
                lockwiki();
-               loadindex() unless $config{rebuild};
+               loadindex();
                require IkiWiki::Render;
                rcs_update();
                refresh();