Rebuild pages that change their type.
authorGabriel McManus <gmcmanus@gmail.com>
Sun, 20 Jul 2008 07:40:16 +0000 (17:40 +1000)
committerJoey Hess <joey@kodama.kitenet.net>
Wed, 23 Jul 2008 20:00:26 +0000 (16:00 -0400)
Previously, if a page changed its type but not its mtime
(e.g. mv page.txt page.mdwn), then it would not be rebuilt.

Now, check if the source of a page has changed,
in which case force a rebuild of that page.
(cherry picked from commit b6a3b8a683fed7a7f6d77a5b3f2dfbd14c849843)

IkiWiki/Render.pm

index ab3ccd7aec0655035e7626bedc77e87053699ab5..90058199c128ebd68f7fa41c2e0f4d71c36e6d32 100644 (file)
@@ -319,6 +319,10 @@ sub refresh () { #{{{
        # check for added or removed pages
        foreach my $file (@files) {
                my $page=pagename($file);
+               if (exists $pagesources{$page} && $pagesources{$page} ne $file) {
+                       # the page has changed its type
+                       $forcerebuild{$page}=1;
+               }
                $pagesources{$page}=$file;
                if (! $pagemtime{$page}) {
                        if (isinternal($page)) {