]> sipb.mit.edu Git - ikiwiki.git/blobdiff - ikiwiki
web commit by joey: thoughts on conflict resolution, gobbing, locking
[ikiwiki.git] / ikiwiki
diff --git a/ikiwiki b/ikiwiki
index fd9904e3daf9e6c682baf61f51239b7c2dc5d46e..e218979d1068ecfebfe0b6134a8b921fe788c688 100755 (executable)
--- a/ikiwiki
+++ b/ikiwiki
@@ -420,6 +420,10 @@ sub lockwiki () { #{{{
        }
 } #}}}
 
+sub unlockwiki () { #{{{
+       close WIKILOCK;
+} #}}}
+
 sub loadindex () { #{{{
        open (IN, "$config{srcdir}/.ikiwiki/index") || return;
        while (<IN>) {
@@ -564,10 +568,9 @@ sub prune ($) { #{{{
 } #}}}
 
 sub refresh () { #{{{
-       # Find existing pages.
+       # find existing pages
        my %exists;
        my @files;
-       
        eval q{use File::Find};
        find({
                no_chdir => 1,
@@ -608,7 +611,7 @@ sub refresh () { #{{{
        foreach my $page (keys %oldpagemtime) {
                if (! $exists{$page}) {
                        debug("removing old page $page");
-                       push @del, $renderedfiles{$page};
+                       push @del, $pagesources{$page};
                        prune($config{destdir}."/".$renderedfiles{$page});
                        delete $renderedfiles{$page};
                        $oldpagemtime{$page}=0;
@@ -1131,6 +1134,8 @@ sub cgi_editpage ($$) { #{{{
                        # presumably the commit will trigger an update
                        # of the wiki
                        rcs_commit($message);
+                       # prevent deadlock with post-commit hook
+                       unlockwiki();
                }
                else {
                        loadindex();