From 4f93b8e2b44a3d9e5455d3f369f6cad929faf899 Mon Sep 17 00:00:00 2001 From: joey Date: Thu, 23 Mar 2006 21:54:30 +0000 Subject: [PATCH] preserve ctimes across rebuilds --- IkiWiki/Render.pm | 4 ++-- ikiwiki | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index b3dfc364d..f397ff320 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -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 9001c5e2a..87414ab5b 100755 --- 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();