From d7fdd04b5a113b6dded40cb79b670b16570c11b3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 29 Jan 2008 00:36:58 -0500 Subject: * Removed support for sending commit notification mails. Along with it went the svnrepo and notify settings, though both will be ignored if left in setup files. --- ikiwiki.in | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'ikiwiki.in') diff --git a/ikiwiki.in b/ikiwiki.in index 2aeaf94ec..9d1f6b520 100755 --- a/ikiwiki.in +++ b/ikiwiki.in @@ -36,12 +36,10 @@ sub getconfig () { #{{{ "cgi!" => \$config{cgi}, "discussion!" => \$config{discussion}, "w3mmode!" => \$config{w3mmode}, - "notify!" => \$config{notify}, "url=s" => \$config{url}, "cgiurl=s" => \$config{cgiurl}, "historyurl=s" => \$config{historyurl}, "diffurl=s" => \$config{diffurl}, - "svnrepo" => \$config{svnrepo}, "svnpath" => \$config{svnpath}, "adminemail=s" => \$config{adminemail}, "timeformat=s" => \$config{timeformat}, @@ -132,10 +130,7 @@ sub main () { #{{{ commandline_render(); } elsif ($config{post_commit} && ! commit_hook_enabled()) { - if ($config{notify}) { - loadindex(); - rcs_notify(); - } + # do nothing } else { lockwiki(); @@ -143,7 +138,6 @@ sub main () { #{{{ require IkiWiki::Render; rcs_update(); refresh(); - rcs_notify() if $config{notify}; saveindex(); } } #}}} -- cgit v1.2.3 From 80915c830a03cf67c6770ef5e62d5178824b101e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 3 Feb 2008 00:23:04 -0500 Subject: * cgi hooks are now run before ikiwiki state is loaded. * This allows locking the wiki before loading state, which avoids some tricky locking code when saving a web edit. --- IkiWiki/CGI.pm | 5 +---- debian/changelog | 3 +++ doc/plugins/write.mdwn | 7 +++++-- ikiwiki.in | 1 - 4 files changed, 9 insertions(+), 7 deletions(-) (limited to 'ikiwiki.in') diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index c8c1b63dd..3f588e427 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -539,10 +539,6 @@ sub cgi_editpage ($$) { #{{{ # may have been committed while the post-commit hook was # disabled. require IkiWiki::Render; - # Reload index, since the first time it's loaded is before - # the wiki is locked, and things may have changed in the - # meantime. - loadindex(); refresh(); saveindex(); @@ -616,6 +612,7 @@ sub cgi (;$$) { #{{{ # Need to lock the wiki before getting a session. lockwiki(); + loadindex(); if (! $session) { $session=cgi_getsession($q); diff --git a/debian/changelog b/debian/changelog index df7b8b424..ceaf3cf71 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,9 @@ ikiwiki (2.31) UNRELEASED; urgency=low too complex to do. * aggregate: Forking a child broke the one state that mattered: Forcing the aggregating page to be rebuilt. Fix this. + * cgi hooks are now run before ikiwiki state is loaded. + * This allows locking the wiki before loading state, which avoids some + tricky locking code when saving a web edit. -- Joey Hess Sat, 02 Feb 2008 23:36:31 -0500 diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 9c3a36b8f..216cfa51c 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -222,8 +222,11 @@ source files that were rendered. Use this to hook into ikiwiki's cgi script. Each registered cgi hook is called in turn, and passed a CGI object. The hook should examine the -parameters, and if it will handle this CGI request, output a page (including the http headers) and -terminate the program. +parameters, and if it will handle this CGI request, output a page +(including the http headers) and terminate the program. + +Note that cgi hooks are called as early as possible, before any ikiwiki +state is loaded, and with no session information. ### auth diff --git a/ikiwiki.in b/ikiwiki.in index 9d1f6b520..1ce7e1688 100755 --- a/ikiwiki.in +++ b/ikiwiki.in @@ -121,7 +121,6 @@ sub main () { #{{{ gen_wrapper(); } elsif ($config{cgi}) { - loadindex(); require IkiWiki::CGI; cgi(); } -- cgit v1.2.3