From bbf29faf3766be349bb8c3132cb5f65db77c6703 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 28 Jan 2008 10:18:04 -0500 Subject: web commit by jelmer --- doc/todo/bzr.mdwn | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'doc/todo') diff --git a/doc/todo/bzr.mdwn b/doc/todo/bzr.mdwn index dbe35245c..9650b9da8 100644 --- a/doc/todo/bzr.mdwn +++ b/doc/todo/bzr.mdwn @@ -183,4 +183,8 @@ and rcs_getctime and rcs_notify aren't written at all. --[[bma]] >>> It's new (in fact I'm not even sure that it made it in to 0.90, it might be in 0.91 due >>> in a couple of weeks. ->>> I was just noting it for a future enhancement. --[[JamesWestby]] \ No newline at end of file +>>> I was just noting it for a future enhancement. --[[JamesWestby]] + +> I've just posted another patch with support for bzr, including support for +> --author and a testsuite to git://git.samba.org/jelmer/ikiwiki.git. I hadn't +> seen this page earlier. --[[jelmer]] -- cgit v1.2.3 From b810552073dce30af9e64821126d254b5b302e4d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 28 Jan 2008 20:51:37 -0500 Subject: redesigning recentchanges --- doc/todo/recentchanges.mdwn | 57 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) (limited to 'doc/todo') diff --git a/doc/todo/recentchanges.mdwn b/doc/todo/recentchanges.mdwn index d46c0d9a8..bdd7948e4 100644 --- a/doc/todo/recentchanges.mdwn +++ b/doc/todo/recentchanges.mdwn @@ -86,3 +86,60 @@ your pages. --Ethan > backend. > > -- CharlesMauch + +---- + +Here's a full design for redoing recentchanges, based on Ethan's ideas: + +* Add a recentchanges plugin that has a preprocessor directive: + \[[recentchanges num=100 pages=* template=recentchanges.tmpl]] + If put on the [[recentchanges]] page, this would result in up to 100 + recentchanges/change_$id.mdwn files being created. +* Which means the plugin has to store state and use a checkconfig hook + or the like to create the requested pages (and delete old ones) when + the wiki is rebuilt and when the post_commit hook is run. +* Then it's a simple matter of using inline on the recentchanges page + to display the changes. (With a special template to display nicely.) +* Rss/atom comes for free.. +* So drop mail notifications. +* If someone wants to subscribe to notifications for only a subset + of pages, they can either filter the recentchanges in their rss + aggregator, or they can set up their own page that uses the recentchanges + directive for only the pages they want. +* The `rcs_notify` functions will be removed. +* `rcs_getchange` is passed a change id (as returned from rcs_recentchanges) + and a partially filled out HTML::Template and fills out the remainer of the + template. So if a template is used that includes diffs, it will need to run + some expensive diffing operation, wikis with less resources can use a + template that doesn't include diffs and avoid that overhead. +* So to update the changes files, just call `rcs_recentchanges`, create + files for each new id, and delete files for each id that is no longer + included. +* The cgi support for recentchanges can be dropped, or moved to a different + plugin. + +I'm unsure how fast this will all be, but by using regular pages, there's +cacheing, at least. The main slowdown might turn out to be the inlining and +not the generation of the changes pages. The current cgi recentchanges +code saves a tenth of a second or so by memoizing htmllink, an optimisation +that won't be available when using the more general inlining code. + +An obvious optimisation, and one implied by this design, is that each change +file is only written once. This assumes that the data in them doesn't ever +change, which actually isn't true (svn commit messages can be changed), but +is probably close enough to true for our purposes. + +Another optimisation would be to htmlize the change files when they're +written out -- avoids re-rendering a given file each time a new change is +made (thus doing 1/100th the work). + +Links in the change files to the changed pages will need special handling. +These links should not generate backlinks. They probably shouldn't be +implemented as wikiliks at all. Instead, they should be raw, absolute +html links to the pages that were changed. + +Only problem with this approach is that the links break if the changed +page later gets deleted. I think that's acceptable. It could link to +`ikiwiki.cgi?do=redir&page=foo`, but that's probably overkill. + +--[[Joey]] -- cgit v1.2.3 From 5921b86fccde90e5a9c77623d808be06f40cbe47 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 28 Jan 2008 23:56:26 -0500 Subject: proof of concept implementation of static recentchanges Currently hardcoded to write to recentchanges/*, and the page format needs to be rethought to be usable for aggregation, but it basically works. --- IkiWiki/Plugin/recentchanges.pm | 92 +++++++++++++++++++++++++++++++++++++++++ doc/plugins/recentchanges.mdwn | 14 +++++++ doc/recentchanges.mdwn | 6 +-- doc/todo/recentchanges.mdwn | 7 +--- doc/wikitemplates.mdwn | 3 +- templates/change.tmpl | 42 ++++++++++++------- templates/recentchanges.tmpl | 65 +++-------------------------- 7 files changed, 145 insertions(+), 84 deletions(-) create mode 100644 IkiWiki/Plugin/recentchanges.pm create mode 100644 doc/plugins/recentchanges.mdwn (limited to 'doc/todo') diff --git a/IkiWiki/Plugin/recentchanges.pm b/IkiWiki/Plugin/recentchanges.pm new file mode 100644 index 000000000..94a2d4c33 --- /dev/null +++ b/IkiWiki/Plugin/recentchanges.pm @@ -0,0 +1,92 @@ +#!/usr/bin/perl +package IkiWiki::Plugin::recentchanges; + +use warnings; +use strict; +use IkiWiki 2.00; + +sub import { #{{{ + hook(type => "checkconfig", id => "recentchanges", + call => \&checkconfig); + hook(type => "needsbuild", id => "recentchanges", + call => \&needsbuild); + hook(type => "preprocess", id => "recentchanges", + call => \&preprocess); + hook(type => "htmlize", id => "_change", + call => \&htmlize); +} #}}} + +sub checkconfig () { #{{{ + updatechanges(); +} #}}} + +sub needsbuild () { #{{{ + # TODO +} #}}} + +sub preprocess (@) { #{{{ + my %params=@_; + + # TODO + + return ""; +} #}}} + +# Pages with extension _change have plain html markup, pass through. +sub htmlize (@) { #{{{ + my %params=@_; + return $params{content}; +} #}}} + +sub store ($$) { #{{{ + my $change=shift; + my $subdir=shift; + + my $page="$subdir/change_".IkiWiki::titlepage($change->{rev}); + + # Optimisation to avoid re-writing pages. Assumes commits never + # change, or that any changes are not important. + return if exists $pagesources{$page} && ! $config{rebuild}; + + # Limit pages to first 10, and add links to the changed pages. + my $is_excess = exists $change->{pages}[10]; + delete @{$change->{pages}}[10 .. @{$change->{pages}}] if $is_excess; + $change->{pages} = [ + map { + if (length $config{url}) { + $_->{link} = "{page},"")."\">". + IkiWiki::pagetitle($_->{page}).""; + } + else { + $_->{link} = IkiWiki::pagetitle($_->{page}); + } + $_; + } @{$change->{pages}} + ]; + push @{$change->{pages}}, { link => '...' } if $is_excess; + + # Fill out a template with the change info. + $change->{user} = IkiWiki::userlink($change->{user}); + my $ctime=$change->{when}; + $change->{when} = IkiWiki::displaytime($change->{when}, "%X %x"); + my $template=template("change.tmpl", blind_cache => 1); + $template->param(%$change); + $template->param(baseurl => "$config{url}/") if length $config{url}; + IkiWiki::run_hooks(pagetemplate => sub { + shift->(page => $page, destpage => $page, template => $template); + }); + + writefile($page."._change", $config{srcdir}, $template->output); + utime $ctime, $ctime, "$config{srcdir}/$page._change"; +} #}}} + +sub updatechanges () { #{{{ + my @changelog=IkiWiki::rcs_recentchanges(100); + foreach my $change (@changelog) { + store($change, "recentchanges"); + } + # TODO: delete old +} #}}} + +1 diff --git a/doc/plugins/recentchanges.mdwn b/doc/plugins/recentchanges.mdwn new file mode 100644 index 000000000..9e0d8dc51 --- /dev/null +++ b/doc/plugins/recentchanges.mdwn @@ -0,0 +1,14 @@ +[[template id=plugin name=recentchanges core=1 author="[[Joey]]"]] + +This plugin examines the [[revision_control_system|rcs]] history and +generates a page describing each recent change made to the wiki. These +pages can be joined together with [[inline]] to generate the +[[RecentChanges]] page. + +Typically only the RecentChanges page will use the plugin, but you can +use it elsewhere too if you like. It's used like this: + + \[[recentchanges pages="*" num=100 template=change]] + +The pages describing recent changes will be created as [[subpages|subpage]] +of the page where the `recentchanges` directive is placed. diff --git a/doc/recentchanges.mdwn b/doc/recentchanges.mdwn index 2e67f02e7..a027bf462 100644 --- a/doc/recentchanges.mdwn +++ b/doc/recentchanges.mdwn @@ -1,3 +1,3 @@ -ikiwiki generates the list of recent changes by examining the history of -the [[revision_control_system|rcs]] that the wiki is configured to use. You -have to have [[CGI]] set up for this feature to be enabled. +[[recentchanges pages="*" num=100 template=change]] +[[inline pages="recentchanges/change_* and !*/Discussion" +template=recentchanges show=0]] diff --git a/doc/todo/recentchanges.mdwn b/doc/todo/recentchanges.mdwn index bdd7948e4..75334659a 100644 --- a/doc/todo/recentchanges.mdwn +++ b/doc/todo/recentchanges.mdwn @@ -107,11 +107,8 @@ Here's a full design for redoing recentchanges, based on Ethan's ideas: aggregator, or they can set up their own page that uses the recentchanges directive for only the pages they want. * The `rcs_notify` functions will be removed. -* `rcs_getchange` is passed a change id (as returned from rcs_recentchanges) - and a partially filled out HTML::Template and fills out the remainer of the - template. So if a template is used that includes diffs, it will need to run - some expensive diffing operation, wikis with less resources can use a - template that doesn't include diffs and avoid that overhead. +* To add diffs, another plugin can add a pagetemplate hook that calls + a `rcs_diff`. (optional) * So to update the changes files, just call `rcs_recentchanges`, create files for each new id, and delete files for each id that is no longer included. diff --git a/doc/wikitemplates.mdwn b/doc/wikitemplates.mdwn index 4588b948e..8a579e183 100644 --- a/doc/wikitemplates.mdwn +++ b/doc/wikitemplates.mdwn @@ -10,11 +10,12 @@ located in /usr/share/ikiwiki/templates by default. * `page.tmpl` - Used for displaying all regular wiki pages. * `misc.tmpl` - Generic template used for any page that doesn't have a custom template. -* `recentchanges.tmpl` - Used for the RecentChanges page. * `editpage.tmpl` - Create/edit page. * `notifymail.tmpl` - Not a html template, this is used to generate change notification mails for users who have subscribed to changes to a page. +* `recentchanges.tmpl` - Used to generate a RecentChanges table with inline. +* `change.tmpl` - Used to create a page describing a change made to the wiki. * `passwordmail.tmpl` - Not a html template, this is used to generate the mail with the user's password in it. * `rsspage.tmpl` - Used for generating rss feeds for [blogs|[ikiwiki/blog]]. diff --git a/templates/change.tmpl b/templates/change.tmpl index af257a7ce..9dbc97ec2 100644 --- a/templates/change.tmpl +++ b/templates/change.tmpl @@ -1,15 +1,27 @@ -[[meta title=""" -
-"""]] -[[meta author=""]] - - - - "> - diff - - - - - - + + + + + + + + "> + diff + + + + + + + + + + + + + +
+
+
+ + diff --git a/templates/recentchanges.tmpl b/templates/recentchanges.tmpl index e03482f43..2e33b79f9 100644 --- a/templates/recentchanges.tmpl +++ b/templates/recentchanges.tmpl @@ -1,26 +1,4 @@ - - - - - -<TMPL_VAR TITLE> - - - - - - - - -
- -/ - -
- -
-
+ @@ -30,42 +8,9 @@ - - - - - - - - - - - - + + +
- - - "> - diff - - - - - - -
- - -
-
-
-
-
- - - - - + -- cgit v1.2.3 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.pm | 2 - IkiWiki/CGI.pm | 13 +--- IkiWiki/Rcs/Stub.pm | 7 -- IkiWiki/Rcs/git.pm | 41 ---------- IkiWiki/Rcs/mercurial.pm | 4 - IkiWiki/Rcs/monotone.pm | 48 ------------ IkiWiki/Rcs/svn.pm | 38 ---------- IkiWiki/Rcs/tla.pm | 45 ----------- IkiWiki/UserInfo.pm | 87 ---------------------- IkiWiki/Wrapper.pm | 16 ---- debian/changelog | 3 + doc/bugs/git_mail_notification_race.mdwn | 2 + doc/features.mdwn | 7 +- doc/ikiwiki.setup | 3 - doc/index/discussion.mdwn | 3 + doc/rcs/monotone.mdwn | 1 - doc/setup.mdwn | 3 +- ...e_to_this_page__34___checkbox_on_edit_form.mdwn | 6 +- doc/todo/bzr.mdwn | 2 + doc/todo/mercurial.mdwn | 2 +- doc/usage.mdwn | 10 --- doc/wikitemplates.mdwn | 3 - docwiki.setup | 7 +- ikiwiki.in | 8 +- t/svn.t | 9 ++- templates/notifymail.tmpl | 4 - 26 files changed, 33 insertions(+), 341 deletions(-) delete mode 100644 templates/notifymail.tmpl (limited to 'doc/todo') diff --git a/IkiWiki.pm b/IkiWiki.pm index b326dbdb8..2c3ddac23 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -62,7 +62,6 @@ sub defaultconfig () { #{{{ cgi => 0, post_commit => 0, rcs => '', - notify => 0, url => '', cgiurl => '', historyurl => '', @@ -76,7 +75,6 @@ sub defaultconfig () { #{{{ w3mmode => 0, wrapper => undef, wrappermode => undef, - svnrepo => undef, svnpath => "trunk", gitorigin_branch => "origin", gitmaster_branch => "master", diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index 5062a448f..55ee5d86a 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -242,9 +242,6 @@ sub cgi_prefs ($$) { #{{{ $form->field(name => "do", type => "hidden"); $form->field(name => "email", size => 50, fieldset => "preferences"); - $form->field(name => "subscriptions", size => 50, - fieldset => "preferences", - comment => "(".htmllink("", "", "ikiwiki/PageSpec", noimageinline => 1).")"); $form->field(name => "banned_users", size => 50, fieldset => "admin"); @@ -256,8 +253,6 @@ sub cgi_prefs ($$) { #{{{ if (! $form->submitted) { $form->field(name => "email", force => 1, value => userinfo_get($user_name, "email")); - $form->field(name => "subscriptions", force => 1, - value => userinfo_get($user_name, "subscriptions")); if (is_admin($user_name)) { $form->field(name => "banned_users", force => 1, value => join(" ", get_banned_users())); @@ -274,11 +269,9 @@ sub cgi_prefs ($$) { #{{{ return; } elsif ($form->submitted eq 'Save Preferences' && $form->validate) { - foreach my $field (qw(email subscriptions)) { - if (defined $form->field($field)) { - userinfo_set($user_name, $field, $form->field($field)) || - error("failed to set $field"); - } + if (defined $form->field('email')) { + userinfo_set($user_name, 'email', $form->field('email')) || + error("failed to set email"); } if (is_admin($user_name)) { set_banned_users(grep { ! is_admin($_) } diff --git a/IkiWiki/Rcs/Stub.pm b/IkiWiki/Rcs/Stub.pm index ab80a9a47..df347f6a9 100644 --- a/IkiWiki/Rcs/Stub.pm +++ b/IkiWiki/Rcs/Stub.pm @@ -57,13 +57,6 @@ sub rcs_recentchanges ($) { # } } -sub rcs_notify () { - # This function is called when a change is committed to the wiki, - # and ikiwiki is running as a post-commit hook from the RCS. - # It should examine the repository to somehow determine what pages - # changed, and then send emails to users subscribed to those pages. -} - sub rcs_getctime ($) { # Optional, used to get the page creation time from the RCS. error gettext("getctime not implemented"); diff --git a/IkiWiki/Rcs/git.pm b/IkiWiki/Rcs/git.pm index f70582136..26a6f4266 100644 --- a/IkiWiki/Rcs/git.pm +++ b/IkiWiki/Rcs/git.pm @@ -419,47 +419,6 @@ sub rcs_recentchanges ($) { #{{{ return @rets; } #}}} -sub rcs_notify () { #{{{ - # Send notification mail to subscribed users. - # - # In usual Git usage, hooks/update script is presumed to send - # notification mails (see git-receive-pack(1)). But we prefer - # hooks/post-update to support IkiWiki commits coming from a - # cloned repository (through command line) because post-update - # is called _after_ each ref in repository is updated (update - # hook is called _before_ the repository is updated). - # - # Here, we rely on a simple fact: we can extract all parts of the - # notification content by parsing the "HEAD" commit. - - my $ci = git_commit_info('HEAD'); - return if !defined $ci; - - my @changed_pages = map { $_->{'file'} } @{ $ci->{'details'} }; - - my ($user, $message); - if (@{ $ci->{'comment'} }[0] =~ m/$config{web_commit_regexp}/) { - $user = defined $2 ? $2 : $3; - $message = $4; - } - else { - $user = $ci->{'author_username'}; - $message = join "\n", @{ $ci->{'comment'} }; - } - - my $sha1 = $ci->{'sha1'}; - - require IkiWiki::UserInfo; - send_commit_mails( - sub { - $message; - }, - sub { - join "\n", run_or_die('git', 'diff', "${sha1}^", $sha1); - }, $user, @changed_pages - ); -} #}}} - sub rcs_getctime ($) { #{{{ my $file=shift; # Remove srcdir prefix diff --git a/IkiWiki/Rcs/mercurial.pm b/IkiWiki/Rcs/mercurial.pm index 13a88379c..db6a396ac 100644 --- a/IkiWiki/Rcs/mercurial.pm +++ b/IkiWiki/Rcs/mercurial.pm @@ -151,10 +151,6 @@ sub rcs_recentchanges ($) { #{{{ return @ret; } #}}} -sub rcs_notify () { #{{{ - # TODO -} #}}} - sub rcs_getctime ($) { #{{{ my ($file) = @_; diff --git a/IkiWiki/Rcs/monotone.pm b/IkiWiki/Rcs/monotone.pm index b48ac92db..0ae2c1a32 100644 --- a/IkiWiki/Rcs/monotone.pm +++ b/IkiWiki/Rcs/monotone.pm @@ -452,54 +452,6 @@ sub rcs_recentchanges ($) { #{{{ return @ret; } #}}} -sub rcs_notify () { #{{{ - debug("The monotone rcs_notify function is currently untested. Use at own risk!"); - - if (! exists $ENV{REV}) { - error(gettext("REV is not set, not running from mtn post-commit hook, cannot send notifications")); - } - if ($ENV{REV} !~ m/($sha1_pattern)/) { # sha1 is untainted now - error(gettext("REV is not a valid revision identifier, cannot send notifications")); - } - my $rev = $1; - - check_config(); - - my $automator = Monotone->new(); - $automator->open(undef, $config{mtnrootdir}); - - my $certs = [read_certs($automator, $rev)]; - my $user; - my $message; - my $when; - - foreach my $cert (@$certs) { - if ($cert->{signature} eq "ok" && $cert->{trust} eq "trusted") { - if ($cert->{name} eq "author") { - $user = $cert->{value}; - } elsif ($cert->{name} eq "date") { - $when = $cert->{value}; - } elsif ($cert->{name} eq "changelog") { - $message = $cert->{value}; - } - } - } - - my @changed_pages = get_changed_files($automator, $rev); - - $automator->close(); - - require IkiWiki::UserInfo; - send_commit_mails( - sub { - return $message; - }, - sub { - `mtn --root=$config{mtnrootdir} au content_diff -r $rev`; - }, - $user, @changed_pages); -} #}}} - sub rcs_getctime ($) { #{{{ my $file=shift; diff --git a/IkiWiki/Rcs/svn.pm b/IkiWiki/Rcs/svn.pm index 075f8da5a..f7d2242f0 100644 --- a/IkiWiki/Rcs/svn.pm +++ b/IkiWiki/Rcs/svn.pm @@ -217,44 +217,6 @@ sub rcs_recentchanges ($) { #{{{ return @ret; } #}}} -sub rcs_notify () { #{{{ - if (! exists $ENV{REV}) { - error(gettext("REV is not set, not running from svn post-commit hook, cannot send notifications")); - } - my $rev=int(possibly_foolish_untaint($ENV{REV})); - - my $user=`svnlook author $config{svnrepo} -r $rev`; - chomp $user; - - my $message=`svnlook log $config{svnrepo} -r $rev`; - if ($message=~/$config{web_commit_regexp}/) { - $user=defined $2 ? "$2" : "$3"; - $message=$4; - } - - my @changed_pages; - foreach my $change (`svnlook changed $config{svnrepo} -r $rev`) { - chomp $change; - if (length $config{svnpath}) { - if ($change =~ /^[A-Z]+\s+\Q$config{svnpath}\E\/(.*)/) { - push @changed_pages, $1; - } - } - else { - push @changed_pages, $change; - } - } - - require IkiWiki::UserInfo; - send_commit_mails( - sub { - return $message; - }, - sub { - `svnlook diff $config{svnrepo} -r $rev --no-diff-deleted`; - }, $user, @changed_pages); -} #}}} - sub rcs_getctime ($) { #{{{ my $file=shift; diff --git a/IkiWiki/Rcs/tla.pm b/IkiWiki/Rcs/tla.pm index 15824ffaf..ecc561bde 100644 --- a/IkiWiki/Rcs/tla.pm +++ b/IkiWiki/Rcs/tla.pm @@ -160,51 +160,6 @@ sub rcs_recentchanges ($) { return @ret; } -sub rcs_notify () { #{{{ - # FIXME: Not set - if (! exists $ENV{ARCH_VERSION}) { - error("ARCH_VERSION is not set, not running from tla post-commit hook, cannot send notifications"); - } - my $rev=int(possibly_foolish_untaint($ENV{REV})); - - eval q{use Mail::Header}; - error($@) if $@; - open(LOG, $ENV{"ARCH_LOG"}); - my $head = Mail::Header->new(\*LOG); - close(LOG); - - my $user = $head->get("Creator"); - - my $newfiles = $head->get("New-files"); - my $modfiles = $head->get("Modified-files"); - my $remfiles = $head->get("Removed-files"); - - my @changed_pages = grep { !/(^.*\/)?\.arch-ids\/.*\.id$/ } - split(/ /, "$newfiles $modfiles $remfiles .arch-ids/fake.id"); - - require IkiWiki::UserInfo; - send_commit_mails( - sub { - my $message = $head->get("Summary"); - if ($message =~ /$config{web_commit_regexp}/) { - $user=defined $2 ? "$2" : "$3"; - $message=$4; - } - }, - sub { - my $logs = `tla logs -d $config{srcdir}`; - my @changesets = reverse split(/\n/, $logs); - my $i; - - for($i=0;$i<$#changesets;$i++) { - last if $changesets[$i] eq $rev; - } - - my $revminusone = $changesets[$i+1]; - `tla diff -d $ENV{ARCH_TREE_ROOT} $revminusone`; - }, $user, @changed_pages); -} #}}} - sub rcs_getctime ($) { #{{{ my $file=shift; eval q{use Date::Parse}; diff --git a/IkiWiki/UserInfo.pm b/IkiWiki/UserInfo.pm index cfc27609d..2ffc51c55 100644 --- a/IkiWiki/UserInfo.pm +++ b/IkiWiki/UserInfo.pm @@ -92,91 +92,4 @@ sub set_banned_users (@) { #{{{ return userinfo_store($userinfo); } #}}} -sub commit_notify_list ($@) { #{{{ - my $committer=shift; - my @pages = map pagename($_), @_; - - my @ret; - my $userinfo=userinfo_retrieve(); - foreach my $user (keys %{$userinfo}) { - next if $user eq $committer; - if (exists $userinfo->{$user}->{subscriptions} && - length $userinfo->{$user}->{subscriptions} && - exists $userinfo->{$user}->{email} && - length $userinfo->{$user}->{email} && - grep { pagespec_match($_, - $userinfo->{$user}->{subscriptions}, - user => $committer) } - map pagename($_), @_) { - push @ret, $userinfo->{$user}->{email}; - } - } - return @ret; -} #}}} - -sub send_commit_mails ($$$@) { #{{{ - my $messagesub=shift; - my $diffsub=shift; - my $user=shift; - my @changed_pages=@_; - - return unless @changed_pages; - - my @email_recipients=commit_notify_list($user, @changed_pages); - if (@email_recipients) { - # TODO: if a commit spans multiple pages, this will send - # subscribers a diff that might contain pages they did not - # sign up for. Should separate the diff per page and - # reassemble into one mail with just the pages subscribed to. - my $diff=$diffsub->(); - my $message=$messagesub->(); - - my $pagelist; - if (@changed_pages > 2) { - $pagelist="$changed_pages[0] $changed_pages[1] ..."; - } - else { - $pagelist.=join(" ", @changed_pages); - } - #translators: The three variables are the name of the wiki, - #translators: A list of one or more pages that were changed, - #translators: And the name of the user making the change. - #translators: This is used as the subject of a commit email. - my $subject=sprintf(gettext("update of %s's %s by %s"), - $config{wikiname}, $pagelist, $user); - - my $template=template("notifymail.tmpl"); - $template->param( - wikiname => $config{wikiname}, - diff => $diff, - user => $user, - message => $message, - ); - - # Daemonize, in case the mail sending takes a while. - defined(my $pid = fork) or error("Can't fork: $!"); - return if $pid; - setsid() or error("Can't start a new session: $!"); - chdir '/'; - open STDIN, '/dev/null'; - open STDOUT, '>/dev/null'; - open STDERR, '>&STDOUT' or error("Can't dup stdout: $!"); - - unlockwiki(); # don't need to keep a lock on the wiki - - eval q{use Mail::Sendmail}; - error($@) if $@; - foreach my $email (@email_recipients) { - sendmail( - To => $email, - From => "$config{wikiname} <$config{adminemail}>", - Subject => $subject, - Message => $template->output, - ); - } - - exit 0; # daemon process done - } -} #}}} - 1 diff --git a/IkiWiki/Wrapper.pm b/IkiWiki/Wrapper.pm index 2103ea53a..90a4c46c7 100644 --- a/IkiWiki/Wrapper.pm +++ b/IkiWiki/Wrapper.pm @@ -36,22 +36,6 @@ sub gen_wrapper () { #{{{ addenv("$var", s); EOF } - if ($config{rcs} eq "svn" && $config{notify}) { - # Support running directly as hooks/post-commit by passing - # $2 in REV in the environment. - $envsave.=<<"EOF" - if (argc == 3) - addenv("REV", argv[2]); - else if ((s=getenv("REV"))) - addenv("REV", s); -EOF - } - if ($config{rcs} eq "tla" && $config{notify}) { - $envsave.=<<"EOF" - if ((s=getenv("ARCH_VERSION"))) - addenv("ARCH_VERSION", s); -EOF - } $Data::Dumper::Indent=0; # no newlines my $configstring=Data::Dumper->Dump([\%config], ['*config']); diff --git a/debian/changelog b/debian/changelog index b57ef1178..47273ea94 100644 --- a/debian/changelog +++ b/debian/changelog @@ -23,6 +23,9 @@ ikiwiki (2.21) UNRELEASED; urgency=low function. * Pages with extensions starting with "_" are internal-use, and will not be rendered or web-edited. + * 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. -- Joey Hess Fri, 11 Jan 2008 15:09:37 -0500 diff --git a/doc/bugs/git_mail_notification_race.mdwn b/doc/bugs/git_mail_notification_race.mdwn index 3538b0764..58bd82325 100644 --- a/doc/bugs/git_mail_notification_race.mdwn +++ b/doc/bugs/git_mail_notification_race.mdwn @@ -1,3 +1,5 @@ +[[done]] (in this branch); fixed removing email notification support! + I was suprised to receive two mails from ikiwiki about one web edit: 1 F Oct 30 To joey+ikiwiki update of ikiwiki's plugins/contrib/gallery.mdwn by http://arpitjain11.myopenid.com/ diff --git a/doc/features.mdwn b/doc/features.mdwn index a7b5c19ab..42eede916 100644 --- a/doc/features.mdwn +++ b/doc/features.mdwn @@ -127,7 +127,7 @@ with that there's no new commit marker syntax to learn. Nearly the definition of a wiki, although perhaps ikiwiki challenges how much of that web gunk a wiki really needs. These features are optional -and can be enabled by enabling [[CGI]]. +and can be enabled by enabling [[CGI]] and a [[Revision_Control_Systems|rcs]]. ### User registration @@ -161,11 +161,6 @@ Well, sorta. Rather than implementing YA history browser, it can link to ikiwiki can use the [[HyperEstraier]] search engine to add powerful full text search capabilities to your wiki. -### Commit mails - -ikiwiki can be configured to send you commit mails with diffs of changes -to selected pages. - ### [[w3mmode]] Can be set up so that w3m can be used to browse a wiki and edit pages diff --git a/doc/ikiwiki.setup b/doc/ikiwiki.setup index 44cb35425..c9616e849 100644 --- a/doc/ikiwiki.setup +++ b/doc/ikiwiki.setup @@ -23,7 +23,6 @@ use IkiWiki::Setup::Standard { #rcs => "svn", #historyurl => "http://svn.example.org/trunk/[[file]]", #diffurl => "http://svn.example.org/trunk/[[file]]?root=wiki&r1=[[r1]]&r2=[[r2]]", - #svnrepo => "/svn/wiki", #svnpath => "trunk", # Git stuff. @@ -72,8 +71,6 @@ use IkiWiki::Setup::Standard { # # what you want. # wrapper => "/svn/wikirepo/hooks/post-commit", # wrappermode => "04755", - # # Enable mail notifications of commits. - # notify => 1, # # Log to syslog since svn post-commit hooks # # hide output and errors. # syslog => 1, diff --git a/doc/index/discussion.mdwn b/doc/index/discussion.mdwn index d5a48f282..4cf38e9cb 100644 --- a/doc/index/discussion.mdwn +++ b/doc/index/discussion.mdwn @@ -405,6 +405,9 @@ I'm playing around with various ways that I can use subversion with ikiwiki. > away without running the post-commit wrapper on commit, and all you lose > is the ability to send commit notification emails. +> (And now that [[recentchanges]] includes rss, you can just subscribe to +> that, no need to worry about commit notification emails anymore.) + * Is it possible / sensible to have ikiwiki share a subversion repository with other data (either completely unrelated files or another ikiwiki instance)? This works in part but again the post-commit hook seems problematic. --[[AdamShand]] diff --git a/doc/rcs/monotone.mdwn b/doc/rcs/monotone.mdwn index d79381571..1d3cd2bc4 100644 --- a/doc/rcs/monotone.mdwn +++ b/doc/rcs/monotone.mdwn @@ -10,7 +10,6 @@ The module is available from the monotone source repository at: Monotone support works, but there are still a few minor missing bits (listed here so they are not forgotten): * At the moment there are no links to display diffs between revisions. It shouldn't be hard to add links to a [ViewMTN](http://grahame.angrygoats.net/moinmoin/ViewMTN) instance, but it hasn't been done yet. -* The [[post-commit]] hook support, so that Ikiwiki sends change notifications when people commit using Monotone rather than the web interface, is partially implemented and untested. * Documentation (this page) could be improved. There is also a mismatch between the way Ikiwiki handles conflicts and the way Monotone handles conflicts. At present, if there is a conflict, then Ikiwiki will commit a revision with conflict markers before presenting it to the user. This is ugly, but there is no clean way to fix it at present. diff --git a/doc/setup.mdwn b/doc/setup.mdwn index af1adc235..9bf7f7c7b 100644 --- a/doc/setup.mdwn +++ b/doc/setup.mdwn @@ -180,8 +180,7 @@ about using the git repositories. Once your wiki is checked in to the revision control system, you should configure ikiwiki to use revision control. Edit your ikiwiki.setup, and uncomment the lines for the revision control system -you chose to use. Be sure to set `svnrepo` to $REPOSITORY, if using -subversion. Uncomment the block for the wrapper for your revision +you chose to use. Uncomment the block for the wrapper for your revision control system, and configure the wrapper path in that block appropriately (for Git, it should be `$REPOSITORY/hooks/post-update`). diff --git a/doc/todo/__34__subscribe_to_this_page__34___checkbox_on_edit_form.mdwn b/doc/todo/__34__subscribe_to_this_page__34___checkbox_on_edit_form.mdwn index 70970c6cc..dc456bbbf 100644 --- a/doc/todo/__34__subscribe_to_this_page__34___checkbox_on_edit_form.mdwn +++ b/doc/todo/__34__subscribe_to_this_page__34___checkbox_on_edit_form.mdwn @@ -3,4 +3,8 @@ user to add a page to their subscribed list while editing. This would prove particularly useful for [[todo]] and [bug](bugs) items, to allow users to receive notifications for activity on their reports. ---[[JoshTriplett]] \ No newline at end of file +--[[JoshTriplett]] + +I went and removed commit notification mails entirely, the idea is that you +subscribe using the [[RecentChanges]] rss feed, and filter it on your end. +Good enough? --[[Joey]] diff --git a/doc/todo/bzr.mdwn b/doc/todo/bzr.mdwn index 9650b9da8..51ae08146 100644 --- a/doc/todo/bzr.mdwn +++ b/doc/todo/bzr.mdwn @@ -4,6 +4,8 @@ rcs_commit was only changed to work around bzr's lack of a switch to set the username). bzr_log could probably be written better by someone better at perl, and rcs_getctime and rcs_notify aren't written at all. --[[bma]] +(rcs_notify is not needed in this branch --[[Joey]]) + #!/usr/bin/perl use warnings; diff --git a/doc/todo/mercurial.mdwn b/doc/todo/mercurial.mdwn index e5de93521..608c7d681 100644 --- a/doc/todo/mercurial.mdwn +++ b/doc/todo/mercurial.mdwn @@ -1,6 +1,6 @@ * Need to get post commit hook working (or an example of how to use it.) * See below. --[[bma]] -* rcs_notify is not implemented +* rcs_notify is not implemented (not needed in this branch --[[Joey]]) * Is the code sufficiently robust? It just warns when mercurial fails. * When rcs_commit is called with a $user that is an openid, it will be passed through to mercurial -u. Will mercurial choke on this? diff --git a/doc/usage.mdwn b/doc/usage.mdwn index 136e969c2..354e266f1 100644 --- a/doc/usage.mdwn +++ b/doc/usage.mdwn @@ -133,11 +133,6 @@ configuration options of their own. access controlled by a group, it makes sense for the ikiwiki wrappers to run setgid to that group. -* --notify, --no-notify - - Enable email notification of commits. This should be used when running - ikiwiki as a [[post-commit]] hook. - * --rcs=svn|git|.., --no-rcs Enable or disable use of a [[revision_control_system|rcs]]. @@ -151,11 +146,6 @@ configuration options of their own. No revision control is enabled by default. -* --svnrepo /svn/wiki - - Specify the location of the svn repository for the wiki. This is required - for using --notify with [[Subversion|rcs/svn]]. - * --svnpath trunk Specify the path inside your svn repository where the wiki is located. diff --git a/doc/wikitemplates.mdwn b/doc/wikitemplates.mdwn index 8a579e183..b8341b637 100644 --- a/doc/wikitemplates.mdwn +++ b/doc/wikitemplates.mdwn @@ -11,9 +11,6 @@ located in /usr/share/ikiwiki/templates by default. * `misc.tmpl` - Generic template used for any page that doesn't have a custom template. * `editpage.tmpl` - Create/edit page. -* `notifymail.tmpl` - Not a html template, this is used to - generate change notification mails for users who have subscribed to - changes to a page. * `recentchanges.tmpl` - Used to generate a RecentChanges table with inline. * `change.tmpl` - Used to create a page describing a change made to the wiki. * `passwordmail.tmpl` - Not a html template, this is used to diff --git a/docwiki.setup b/docwiki.setup index 0a6a86678..5793d87bf 100644 --- a/docwiki.setup +++ b/docwiki.setup @@ -15,5 +15,10 @@ use IkiWiki::Setup::Standard { syslog => 0, userdir => "users", usedirs => 0, - add_plugins => [qw{goodstuff version haiku polygen fortune}], + rcs => 'git', + rss => 1, + cgiurl => "http://ikiwiki.info/ikiwiki.cgi", + url => "http://ikiwiki.info", + add_plugins => [qw{goodstuff version haiku polygen fortune + recentchanges }], } 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(); } } #}}} diff --git a/t/svn.t b/t/svn.t index a1878a73d..8a8282c73 100755 --- a/t/svn.t +++ b/t/svn.t @@ -21,13 +21,14 @@ BEGIN { use_ok("IkiWiki"); } %config=IkiWiki::defaultconfig(); $config{rcs} = "svn"; $config{srcdir} = "$dir/src"; -$config{svnrepo} = "$dir/repo"; $config{svnpath} = "trunk"; IkiWiki::checkconfig(); -system "svnadmin create $config{svnrepo} >/dev/null"; -system "svn mkdir file://$config{svnrepo}/trunk -m add >/dev/null"; -system "svn co file://$config{svnrepo}/trunk $config{srcdir} >/dev/null"; +my $svnrepo = "$dir/repo"; + +system "svnadmin create $svnrepo >/dev/null"; +system "svn mkdir file://$svnrepo/trunk -m add >/dev/null"; +system "svn co file://$svnrepo/trunk $config{srcdir} >/dev/null"; # Web commit my $test1 = readfile("t/test1.mdwn"); diff --git a/templates/notifymail.tmpl b/templates/notifymail.tmpl deleted file mode 100644 index e3a1dd330..000000000 --- a/templates/notifymail.tmpl +++ /dev/null @@ -1,4 +0,0 @@ -The following change was made by : - - - -- cgit v1.2.3 From d72753e100b018dfa82feb06e06fc2ad2c61f4ed Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 29 Jan 2008 01:03:44 -0500 Subject: updates --- debian/changelog | 3 +++ doc/todo/recentchanges.mdwn | 2 ++ underlays/basewiki/recentchanges.mdwn | 1 + 3 files changed, 6 insertions(+) create mode 120000 underlays/basewiki/recentchanges.mdwn (limited to 'doc/todo') diff --git a/debian/changelog b/debian/changelog index 47273ea94..8530bdd7e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -23,6 +23,9 @@ ikiwiki (2.21) UNRELEASED; urgency=low function. * Pages with extensions starting with "_" are internal-use, and will not be rendered or web-edited. + * RecentChanges is now a static html page, that's updated whenever a commit + is made to the wiki. It's built as a blog using inline, so it can have + an rss feed that users can subscribe to. * 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. diff --git a/doc/todo/recentchanges.mdwn b/doc/todo/recentchanges.mdwn index 75334659a..91128a860 100644 --- a/doc/todo/recentchanges.mdwn +++ b/doc/todo/recentchanges.mdwn @@ -140,3 +140,5 @@ page later gets deleted. I think that's acceptable. It could link to `ikiwiki.cgi?do=redir&page=foo`, but that's probably overkill. --[[Joey]] + +[[done]] !! (in this branch at least :-) diff --git a/underlays/basewiki/recentchanges.mdwn b/underlays/basewiki/recentchanges.mdwn new file mode 120000 index 000000000..7bd039623 --- /dev/null +++ b/underlays/basewiki/recentchanges.mdwn @@ -0,0 +1 @@ +../../doc/recentchanges.mdwn \ No newline at end of file -- cgit v1.2.3 From fbfbda614dfeb01d1f7156f97125d17d99b4f113 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 29 Jan 2008 16:11:47 -0500 Subject: misc recentchanges doc updates --- doc/todo/httpauth_example.mdwn | 3 +++ doc/todo/plugin.mdwn | 16 +--------------- 2 files changed, 4 insertions(+), 15 deletions(-) (limited to 'doc/todo') diff --git a/doc/todo/httpauth_example.mdwn b/doc/todo/httpauth_example.mdwn index f67f67371..0c6268aa1 100644 --- a/doc/todo/httpauth_example.mdwn +++ b/doc/todo/httpauth_example.mdwn @@ -3,3 +3,6 @@ authentication (perhaps as a [[tip|tips]]), showing how to authenticate the user for edits without requiring authentication for the entire wiki. (Ideally, recentchanges should work without authentication as well, even though it goes through the CGI.) --[[JoshTriplett]] + +> (Now that recentchanges is a static page, it auths the same as other wiki +> pages.) --[[Joey]] diff --git a/doc/todo/plugin.mdwn b/doc/todo/plugin.mdwn index 0d702975f..89dbb04a2 100644 --- a/doc/todo/plugin.mdwn +++ b/doc/todo/plugin.mdwn @@ -6,20 +6,6 @@ Suggestions of ideas for plugins: > web-server-specific code to list all users, and openid can't feasibly do so > at all. --[[JoshTriplett]] -* Support [[RecentChanges]] as a regular page containing a plugin that - updates each time there is a change, and statically builds the recent - changes list. (Would this be too expensive/inflexible? There might be - other ways to do it as a plugin, like making all links to RecentChanges - link to the cgi and have the cgi render it on demand.) - - Or using an iframe - to inline the cgi, although firefox seems to render that nastily with - nested scroll bars. :-( -> Or just link to the equivalent in the version control system, if available; -> gitweb's shortlog or summary view would work nicely as a -> RecentChanges. --[[JoshTriplett]] ->>Why not fork the process? We wouldn't have to wait around for a response since we would assume the recent changes page was being generated correctly. - * It would be nice to be able to have a button to show "Differences" (or "Show Diff") when editing a page. Is that an option that can be enabled? Using a plugin? @@ -58,4 +44,4 @@ Suggestions of ideas for plugins: * As I couldn't find another place to ask, I'll try here. I would like to install some contributed plugins, but can not find anywhere to downlod them. - > Not sure what you mean, the [[plugins/contrib]] page lists contributed plugins, and each of their pages tells where to download the plugin from.. --[[Joey]] \ No newline at end of file + > Not sure what you mean, the [[plugins/contrib]] page lists contributed plugins, and each of their pages tells where to download the plugin from.. --[[Joey]] -- cgit v1.2.3 From 1d31f3405a7aa0577b746d2bd44cf7dc9993cb20 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 29 Jan 2008 17:27:01 -0500 Subject: doc updates, add NEWS item --- debian/NEWS | 16 ++++++++++++++++ doc/todo/Commit_emails:_ones_own_changes.mdwn | 3 +++ doc/todo/passwordauth:_sendmail_interface.mdwn | 1 - 3 files changed, 19 insertions(+), 1 deletion(-) (limited to 'doc/todo') diff --git a/debian/NEWS b/debian/NEWS index 5515bbd7d..43c8b3ca2 100644 --- a/debian/NEWS +++ b/debian/NEWS @@ -1,3 +1,19 @@ +ikiwiki (2.30) unstable; urgency=low + + Ever feel that ikiwiki's handling of RecentChanges wasn't truely in the + spirit of a wiki compiler? Well, that's changed. The RecentChanges page is + now a static page, not a CGI. Users can subscribe to its rss/atom feeds. + Custom RecentChanges pages can be easily set up that display only changes + to a subset of pages, or only changes by a subset of users. + + With this excellent new RecentChanges support, the mail notification system + is showing its age (and known to be variously buggy and underimplemented for + various VCSes), and so ikiwiki's support for sending commit mails is REMOVED + from this version. If you were subscribed to commit mails, you should be + able to accomplish the same thing by subscribing to a RecentChanges feed. + + -- Joey Hess Tue, 29 Jan 2008 17:18:31 -0500 + ikiwiki (2.20) unstable; urgency=low The template plugin has begin to htmlize the variables passed to templates. diff --git a/doc/todo/Commit_emails:_ones_own_changes.mdwn b/doc/todo/Commit_emails:_ones_own_changes.mdwn index d577c454f..862a85071 100644 --- a/doc/todo/Commit_emails:_ones_own_changes.mdwn +++ b/doc/todo/Commit_emails:_ones_own_changes.mdwn @@ -4,3 +4,6 @@ What's the rationale behind excluding ones own changes from the commit emails se > Well, commit mails are intended to keep you informed of changes in the > wiki, and I assumed you'd know about changes you made yourself. > --[[Joey]] + +> [[done]] -- commit mails removed; recentchanges feeds can be configured +> for whatever you like. diff --git a/doc/todo/passwordauth:_sendmail_interface.mdwn b/doc/todo/passwordauth:_sendmail_interface.mdwn index 4714a7a09..4bbda6565 100644 --- a/doc/todo/passwordauth:_sendmail_interface.mdwn +++ b/doc/todo/passwordauth:_sendmail_interface.mdwn @@ -44,7 +44,6 @@ Remaining TODOs: just for this bit of functionality? * Debian news file. * ikiwiki news file. - * Are commit emails still working? --[[tschwinge]] -- cgit v1.2.3 From a357abc0f9f652012e45a4dfc868e57dd17b56ee Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 29 Jan 2008 17:31:49 -0500 Subject: todo item --- doc/todo/aggregate_to_internal_pages.mdwn | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 doc/todo/aggregate_to_internal_pages.mdwn (limited to 'doc/todo') diff --git a/doc/todo/aggregate_to_internal_pages.mdwn b/doc/todo/aggregate_to_internal_pages.mdwn new file mode 100644 index 000000000..a4164fa25 --- /dev/null +++ b/doc/todo/aggregate_to_internal_pages.mdwn @@ -0,0 +1,5 @@ +The new internal page feature is designed for something like +[[plugins/aggregate]]. + +How to transition to it though? inlines of aggregated content would need to +change their pagespecs to use `internal()`. -- cgit v1.2.3 From e050f35261fe453b70294b58bc6c87bfe57cf231 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 29 Jan 2008 19:56:19 -0500 Subject: doc updates for bzr --- doc/ikiwiki.setup | 5 +++++ doc/rcs/bzr.mdwn | 8 ++++++++ doc/rcs/details.mdwn | 2 ++ doc/setup.mdwn | 7 +++++++ doc/todo/bzr.mdwn | 2 ++ 5 files changed, 24 insertions(+) create mode 100644 doc/rcs/bzr.mdwn (limited to 'doc/todo') diff --git a/doc/ikiwiki.setup b/doc/ikiwiki.setup index 9bf542981..e2974cfd5 100644 --- a/doc/ikiwiki.setup +++ b/doc/ikiwiki.setup @@ -42,6 +42,11 @@ use IkiWiki::Setup::Standard { #historyurl => "http://localhost:8000/log/tip/[[file]]", # hg serve'd local repository #diffurl => "http://localhost:8000/?fd=[[r2]];file=[[file]]", + # Bazaar stuff. + #rcs => "bzr", + #historyurl => ??, + #diffurl => ??, + # Monotone stuff #rcs => "monotone", #mtnkey => "web\@machine.company.com", diff --git a/doc/rcs/bzr.mdwn b/doc/rcs/bzr.mdwn new file mode 100644 index 000000000..19a7ae395 --- /dev/null +++ b/doc/rcs/bzr.mdwn @@ -0,0 +1,8 @@ +[Bazaar](http://bazaar-vcs.org/) is a distributed revison control +system developed by Canonical Ltd. Ikiwiki supports storing a wiki in a +bzr repository. + +Ikiwiki can run as a post-update hook to update a wiki whenever commits +come in. When running as a [[cgi]] with bzr, ikiwiki automatically +commits edited pages, and uses the bzr history to generate the +[[RecentChanges]] page. diff --git a/doc/rcs/details.mdwn b/doc/rcs/details.mdwn index 6b9ffb91f..449e129bd 100644 --- a/doc/rcs/details.mdwn +++ b/doc/rcs/details.mdwn @@ -352,3 +352,5 @@ merge again with a merger that inserts conflict markers. It commits this new revision with conflict markers to the repository. It then returns the text to the user for cleanup. This is less neat than it could be, in that a conflict marked revision gets committed to the repository. + +## [[bzr]] diff --git a/doc/setup.mdwn b/doc/setup.mdwn index 9bf7f7c7b..857a9dbae 100644 --- a/doc/setup.mdwn +++ b/doc/setup.mdwn @@ -135,6 +135,13 @@ about using the git repositories. ikiwiki-makerepo mercurial $SRCDIR """]] +[[toggle id=mercurial text="Bazaar"]] +[[toggleable id=bazaar text=""" + REPOSITORY=$SRCDIR + # FIXME: doesn't work yet with bzr + ikiwiki-makerepo bzr $SRCDIR +"""]] + [[toggle id=tla text="TLA"]] [[toggleable id=tla text=""" REPOSITORY=~/wikirepo diff --git a/doc/todo/bzr.mdwn b/doc/todo/bzr.mdwn index 51ae08146..179ea2f24 100644 --- a/doc/todo/bzr.mdwn +++ b/doc/todo/bzr.mdwn @@ -190,3 +190,5 @@ and rcs_getctime and rcs_notify aren't written at all. --[[bma]] > I've just posted another patch with support for bzr, including support for > --author and a testsuite to git://git.samba.org/jelmer/ikiwiki.git. I hadn't > seen this page earlier. --[[jelmer]] + +> I used jelmer's patch --[[done]]! --[[Joey]] -- cgit v1.2.3 From d758d326042ee3f2b44d899dc78158c99f901c3f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 29 Jan 2008 21:57:50 -0500 Subject: web commit by http://subvert.org.uk/~bma/ --- doc/todo/multiple_output_formats.mdwn | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'doc/todo') diff --git a/doc/todo/multiple_output_formats.mdwn b/doc/todo/multiple_output_formats.mdwn index 76fd39303..00623be39 100644 --- a/doc/todo/multiple_output_formats.mdwn +++ b/doc/todo/multiple_output_formats.mdwn @@ -5,4 +5,13 @@ This would provide true "printable versions" of the wiki pages supporting it. --[[JeremieKoenig]] +Could this be done by making the output format a plugin, similar to the way +pyblosxom works? Atom and RSS could then possibly be moved into plugins. + +Presumably they'd have to work by converting HTML into some other format, as +trying to force all input languages to generate more than one output language +would be impractical to say the least. + +--[[bma]] + [[tag wishlist]] -- cgit v1.2.3 From 2275a3ab4e1bce25eb645b32466a20395011150e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 30 Jan 2008 15:37:12 -0500 Subject: possible implementation --- .../Inline_plugin_option_to_show_full_page_path.mdwn | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'doc/todo') diff --git a/doc/todo/Inline_plugin_option_to_show_full_page_path.mdwn b/doc/todo/Inline_plugin_option_to_show_full_page_path.mdwn index 4eb1f8a05..ab9cd61e4 100644 --- a/doc/todo/Inline_plugin_option_to_show_full_page_path.mdwn +++ b/doc/todo/Inline_plugin_option_to_show_full_page_path.mdwn @@ -10,3 +10,19 @@ The only other way I can think of making this work would be to set the title of Cheers, [[AdamShand]] + +> One way to approach it would be to add a field to the template +> that contains the full page name. Then you just use a modified +> `inlinepage.tmpl`, that uses that instead of the title. --[[Joey]] + +diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm +index 59eabb6..82913ba 100644 +--- a/IkiWiki/Plugin/inline.pm ++++ b/IkiWiki/Plugin/inline.pm +@@ -229,6 +229,7 @@ sub preprocess_inline (@) { #{{{ + $template->param(content => $content); + } + $template->param(pageurl => urlto(bestlink($params{page}, $page), $params{destpage})); ++ $template->param(page => $page); + $template->param(title => pagetitle(basename($page))); + $template->param(ctime => displaytime($pagectime{$page}, $params{timeformat})); -- cgit v1.2.3 From d40b2751151397344ed1a55a3e97ecdc0cecd56d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 30 Jan 2008 15:33:13 -0500 Subject: comment --- doc/todo/fortune:_select_options_via_environment.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/todo') diff --git a/doc/todo/fortune:_select_options_via_environment.mdwn b/doc/todo/fortune:_select_options_via_environment.mdwn index 75b48cd9c..f906312fe 100644 --- a/doc/todo/fortune:_select_options_via_environment.mdwn +++ b/doc/todo/fortune:_select_options_via_environment.mdwn @@ -29,3 +29,6 @@ if ($?) { return "[[".gettext("fortune failed")."]]"; + +> An environment variable is not the right approach. Ikiwiki has a setup +> file, and plugins can use configuration from there. --[[Joey]] -- cgit v1.2.3 From 2952288db44d5cdea9e19fd2254ab2fdff1c6352 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 30 Jan 2008 15:31:07 -0500 Subject: move suggestion to a todo item --- doc/plugins/toggle/discussion.mdwn | 4 ---- doc/todo/toggle_initial_state.mdwn | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 doc/todo/toggle_initial_state.mdwn (limited to 'doc/todo') diff --git a/doc/plugins/toggle/discussion.mdwn b/doc/plugins/toggle/discussion.mdwn index 08ccddea8..22a09685d 100644 --- a/doc/plugins/toggle/discussion.mdwn +++ b/doc/plugins/toggle/discussion.mdwn @@ -15,7 +15,3 @@ but no success. How can I do it? # [[bugs/Bug_when_toggling_in_a_preview_page]] - -# Initial State - -It would be nice if one could set the initial state of the toggleable area. diff --git a/doc/todo/toggle_initial_state.mdwn b/doc/todo/toggle_initial_state.mdwn new file mode 100644 index 000000000..f54d33c04 --- /dev/null +++ b/doc/todo/toggle_initial_state.mdwn @@ -0,0 +1,4 @@ +It would be nice if one could set the initial state of the toggleable area. +--[[[rdennis]] + +[[tag plugins/toggle]] -- cgit v1.2.3 From 6e639dccd146da329ff7f40c1b3de8f2d4a4b144 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 31 Jan 2008 17:04:45 -0500 Subject: web commit by http://users.itk.ppke.hu/~cstamas/: add unaccent todo and link to patch --- doc/todo/unaccent_url_instead_of_encoding.mdwn | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 doc/todo/unaccent_url_instead_of_encoding.mdwn (limited to 'doc/todo') diff --git a/doc/todo/unaccent_url_instead_of_encoding.mdwn b/doc/todo/unaccent_url_instead_of_encoding.mdwn new file mode 100644 index 000000000..04163fa9c --- /dev/null +++ b/doc/todo/unaccent_url_instead_of_encoding.mdwn @@ -0,0 +1,9 @@ +If one puts localized chars in wikilinks ikiwiki will escape it. +This works right from a technical point of view, but the URLs will become ugly. + +So I made a patch which unaccent chars: +This is a one liner change, but requires a bit of reordering in the code. + +[[cstamas]] + +[[tag whishlist patch]] -- cgit v1.2.3 From a9da9fcd251e7b86212d6cc9cceafa76372f0dcc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 31 Jan 2008 17:05:29 -0500 Subject: web commit by http://users.itk.ppke.hu/~cstamas/: typo --- doc/todo/unaccent_url_instead_of_encoding.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/todo') diff --git a/doc/todo/unaccent_url_instead_of_encoding.mdwn b/doc/todo/unaccent_url_instead_of_encoding.mdwn index 04163fa9c..fbba893c5 100644 --- a/doc/todo/unaccent_url_instead_of_encoding.mdwn +++ b/doc/todo/unaccent_url_instead_of_encoding.mdwn @@ -6,4 +6,4 @@ This is a one liner change, but requires a bit of reordering in the code. [[cstamas]] -[[tag whishlist patch]] +[[tag wishlist patch]] -- cgit v1.2.3 From bc119adc11e2ae871d238f807691717d40010a25 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 1 Feb 2008 18:42:06 -0500 Subject: web commit by http://willu.myopenid.com/: doxygen support wishlist entry --- doc/todo/doxygen_support.mdwn | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 doc/todo/doxygen_support.mdwn (limited to 'doc/todo') diff --git a/doc/todo/doxygen_support.mdwn b/doc/todo/doxygen_support.mdwn new file mode 100644 index 000000000..ae31c1603 --- /dev/null +++ b/doc/todo/doxygen_support.mdwn @@ -0,0 +1,7 @@ +[[tag wishlist]] + +Given that ikiwiki has a suggested use as a tool for developers, I was thinking it might be cool if ikiwiki had [Doxygen](http://www.doxygen.org/) support. I'm not exactly sure how the integration would work. Something along the lines of a plugin to support .dox files would be my first thought. I'd leave generating the documentation from any source files for a separate run of Doxygen - it'd be easier and you probably don't want the source being edited over the web. + +#### Background #### + +I have been involved with one project that uses Doxygen to generate their web pages and user docs, as well as their 'in code' documentation: . This makes the whole system somewhat like ikiwiki, but without the cgi for public editing. I was thinking of trying to convince that project to move to ikiwiki, but they're not going to want to re-write all their documentation. -- cgit v1.2.3 From 1ef7d6de125a6e49af3f2493a29d11a63b7b2164 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 3 Feb 2008 00:02:49 -0500 Subject: thoughts on mtime setting --- doc/todo/mtime.mdwn | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 doc/todo/mtime.mdwn (limited to 'doc/todo') diff --git a/doc/todo/mtime.mdwn b/doc/todo/mtime.mdwn new file mode 100644 index 000000000..92cbe84ff --- /dev/null +++ b/doc/todo/mtime.mdwn @@ -0,0 +1,14 @@ +It'd be nice if the mtime of the files ikiwiki renders matched the mtime of +the source files. + +However, this turns out to be more complex than just calling utime() a few +times. If a page inlines other, younger pages, then having an older mtime +means that an old version of it will be kept in web caches, forcing +annoying shift-reloads to see the changed content (for example). + +And it's not just inline. The template plugin means that a change to a +template can result in changes to how a page gets rendered. The version +plugin changes page content without any younger page being involved. And +editing one of the html templates and rebuilding the wiki can change every +page. All of these need to be reflected in the file mtime to avoid caching +problems. -- cgit v1.2.3 From 6afbd9939ac8cd171e7cf8376f0d0c0a4bf3d516 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 3 Feb 2008 13:56:10 -0500 Subject: late night thoughts on fixing aggregation locking (still seem to make sense this morning) --- doc/todo/aggregate_locking.mdwn | 66 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 doc/todo/aggregate_locking.mdwn (limited to 'doc/todo') diff --git a/doc/todo/aggregate_locking.mdwn b/doc/todo/aggregate_locking.mdwn new file mode 100644 index 000000000..91df662a7 --- /dev/null +++ b/doc/todo/aggregate_locking.mdwn @@ -0,0 +1,66 @@ +The [[plugin/aggregate]] plugin's locking is a suboptimal. + +There should be no need to lock the wiki while aggregating -- it's annoying +that long aggregate runs can block edits from happening. However, not +locking would present problems. One is, if an aggregate run is happening, +and the feed is removed, it could continue adding pages for that feed. +Those pages would then become orphaned, and stick around, since the feed +that had created them is gone, and thus there's no indication that they +should be removed. + +To fix that, garbage collect any pages that were created by +aggregation once their feed is gone. + +Are there other things that could happen while it's aggregating that it +should check for? + +Well, things like the feed url etc could change, and it +would have to merge in such changes before saving the aggregation state. +New feeds could also be added, feeds could be moved from one source page to +another. + +Merging that feed info seems doable, just re-load the aggregation state +from disk, and set the `message`, `lastupdate`, `numposts`, and `error` +fields to their new values if the feed still exists. + +---- + +Another part of the mess is that it needs to avoid stacking multiple +aggregate processes up if aggregation is very slow. Currently this is done +by taking the lock in nonblocking mode, and not aggregating if it's locked. +This has various problems, for example a page edit at the right time can +prevent aggregation from happening. + +Adding another lock just for aggregation could solve this. Check that lock +(in checkconfig) and exit if another aggregator holds it. + +---- + +The other part of the mess is that it currently does aggregation in +checkconfig, locking the wiki for that, and loading state, and then +dropping the lock, unloading state, and letting the render happen. Which +reloads state. That state reloading is tricky to do just right. + +A simple fix: Move the aggregation to the new 'render' hook. Then state +would be loaded, and there would be no reason to worry about aggregating. + +Or aggregation could be kept in checkconfig, like so: + +* lock wiki +* load aggregation state +* unlock wiki +* get list of feeds needing aggregation +* exit if none +* attempt to take aggregation lock, exit if another aggregation is happening +* fork a child process to do the aggregation + * lock wiki + * load wiki state (needed for aggregation to run) + * unlock wiki + * aggregate + * lock wiki + * reload aggregation state + * merge in aggregation state changes + * unlock wiki +* drop aggregation lock +* force rebuild of sourcepages of feeds that were aggregated +* exit checkconfig and continue with usual refresh process -- cgit v1.2.3 From 9d54cc4659248f9820f47a021b694405d75404a8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 3 Feb 2008 16:48:26 -0500 Subject: implement aggregate_locking design Now aggregation will not lock the wiki. Any changes made during aggregaton are merged in with the changed state accumulated while aggregating. A separate lock file prevents multiple concurrent aggregators. Garbage collection of orphaned guids is much improved. loadstate() is only called once per process, so tricky support for reloading wiki state is not needed. (Tested fairly thuroughly.) --- IkiWiki/Plugin/aggregate.pm | 181 +++++++++++++++++++++++++++------------- debian/changelog | 7 +- doc/todo/aggregate_locking.mdwn | 6 +- po/ikiwiki.pot | 30 +++---- 4 files changed, 146 insertions(+), 78 deletions(-) (limited to 'doc/todo') diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm index cfc4ec955..ba40ee6bc 100644 --- a/IkiWiki/Plugin/aggregate.pm +++ b/IkiWiki/Plugin/aggregate.pm @@ -33,33 +33,62 @@ sub getopt () { #{{{ sub checkconfig () { #{{{ if ($config{aggregate} && ! ($config{post_commit} && IkiWiki::commit_hook_enabled())) { - if (! IkiWiki::lockwiki(0)) { - debug("wiki is locked by another process, not aggregating"); - exit 1; - } - + # See if any feeds need aggregation. loadstate(); - IkiWiki::loadindex(); - aggregate(); - expire(); - savestate(); - clearstate(); + my @feeds=needsaggregate(); + return unless @feeds; + if (! lockaggregate()) { + debug("an aggregation process is already running"); + return; + } + # force a later rebuild of source pages + $IkiWiki::forcerebuild{$_->{sourcepage}}=1 + foreach @feeds; + + # Fork a child process to handle the aggregation. + # The parent process will then handle building the + # result. This avoids messy code to clear state + # accumulated while aggregating. + defined(my $pid = fork) or error("Can't fork: $!"); + if (! $pid) { + IkiWiki::loadindex(); + + # Aggregation happens without the main wiki lock + # being held. This allows editing pages etc while + # aggregation is running. + aggregate(@feeds); + + IkiWiki::lockwiki; + # Merge changes, since aggregation state may have + # changed on disk while the aggregation was happening. + mergestate(); + expire(); + savestate(); + IkiWiki::unlockwiki; + exit 0; + } + waitpid($pid,0); + if ($?) { + error "aggregation failed with code $?"; + } - IkiWiki::unlockwiki(); + clearstate(); + unlockaggregate(); } } #}}} sub needsbuild (@) { #{{{ my $needsbuild=shift; - loadstate(); # if not already loaded + loadstate(); foreach my $feed (values %feeds) { if (exists $pagesources{$feed->{sourcepage}} && grep { $_ eq $pagesources{$feed->{sourcepage}} } @$needsbuild) { - # Mark all feeds originating on this page as removable; - # preprocess will unmark those that still exist. - remove_feeds($feed->{sourcepage}); + # Mark all feeds originating on this page as + # not yet seen; preprocess will unmark those that + # still exist. + markunseen($feed->{sourcepage}); } } } # }}} @@ -92,8 +121,7 @@ sub preprocess (@) { #{{{ $feed->{updateinterval}=defined $params{updateinterval} ? $params{updateinterval} * 60 : 15 * 60; $feed->{expireage}=defined $params{expireage} ? $params{expireage} : 0; $feed->{expirecount}=defined $params{expirecount} ? $params{expirecount} : 0; - delete $feed->{remove}; - delete $feed->{expired}; + delete $feed->{unseen}; $feed->{lastupdate}=0 unless defined $feed->{lastupdate}; $feed->{numposts}=0 unless defined $feed->{numposts}; $feed->{newposts}=0 unless defined $feed->{newposts}; @@ -123,16 +151,27 @@ sub delete (@) { #{{{ # Remove feed data for removed pages. foreach my $file (@files) { my $page=pagename($file); - remove_feeds($page); + markunseen($page); + } +} #}}} + +sub markunseen ($) { #{{{ + my $page=shift; + + foreach my $id (keys %feeds) { + if ($feeds{$id}->{sourcepage} eq $page) { + $feeds{$id}->{unseen}=1; + } } } #}}} my $state_loaded=0; + sub loadstate () { #{{{ return if $state_loaded; $state_loaded=1; if (-e "$config{wikistatedir}/aggregate") { - open(IN, "<", "$config{wikistatedir}/aggregate") || + open(IN, "$config{wikistatedir}/aggregate") || die "$config{wikistatedir}/aggregate: $!"; while () { $_=IkiWiki::possibly_foolish_untaint($_); @@ -166,32 +205,13 @@ sub loadstate () { #{{{ sub savestate () { #{{{ return unless $state_loaded; + garbage_collect(); eval q{use HTML::Entities}; error($@) if $@; my $newfile="$config{wikistatedir}/aggregate.new"; my $cleanup = sub { unlink($newfile) }; - open (OUT, ">", $newfile) || error("open $newfile: $!", $cleanup); + open (OUT, ">$newfile") || error("open $newfile: $!", $cleanup); foreach my $data (values %feeds, values %guids) { - if ($data->{remove}) { - if ($data->{name}) { - foreach my $guid (values %guids) { - if ($guid->{feed} eq $data->{name}) { - $guid->{remove}=1; - } - } - } - else { - unlink pagefile($data->{page}) - if exists $data->{page}; - } - next; - } - elsif ($data->{expired} && exists $data->{page}) { - unlink pagefile($data->{page}); - delete $data->{page}; - delete $data->{md5}; - } - my @line; foreach my $field (keys %$data) { if ($field eq "name" || $field eq "feed" || @@ -212,6 +232,63 @@ sub savestate () { #{{{ error("rename $newfile: $!", $cleanup); } #}}} +sub garbage_collect () { #{{{ + foreach my $name (keys %feeds) { + # remove any feeds that were not seen while building the pages + # that used to contain them + if ($feeds{$name}->{unseen}) { + delete $feeds{$name}; + } + } + + foreach my $guid (values %guids) { + # any guid whose feed is gone should be removed + if (! exists $feeds{$guid->{feed}}) { + unlink pagefile($guid->{page}) + if exists $guid->{page}; + delete $guids{$guid->{guid}}; + } + # handle expired guids + elsif ($guid->{expired} && exists $guid->{page}) { + unlink pagefile($guid->{page}); + delete $guid->{page}; + delete $guid->{md5}; + } + } +} #}}} + +sub mergestate () { #{{{ + # Load the current state in from disk, and merge into it + # values from the state in memory that might have changed + # during aggregation. + my %myfeeds=%feeds; + my %myguids=%guids; + clearstate(); + loadstate(); + + # All that can change in feed state during aggregation is a few + # fields. + foreach my $name (keys %myfeeds) { + if (exists $feeds{$name}) { + foreach my $field (qw{message lastupdate numposts + newposts error}) { + $feeds{$name}->{$field}=$myfeeds{$name}->{$field}; + } + } + } + + # New guids can be created during aggregation. + # It's also possible that guids were removed from the on-disk state + # while the aggregation was in process. That would only happen if + # their feed was also removed, so any removed guids added back here + # will be garbage collected later. + foreach my $guid (keys %myguids) { + if (! exists $guids{$guid}) { + $guids{$guid}=$myguids{$guid}; + } + } +} #}}} + sub clearstate () { #{{{ %feeds=(); %guids=(); @@ -249,7 +326,12 @@ sub expire () { #{{{ } } #}}} -sub aggregate () { #{{{ +sub needsaggregate () { #{{{ + return values %feeds if $config{rebuild}; + return grep { time - $_->{lastupdate} >= $_->{updateinterval} } values %feeds; +} #}}} + +sub aggregate (@) { #{{{ eval q{use XML::Feed}; error($@) if $@; eval q{use URI::Fetch}; @@ -257,15 +339,12 @@ sub aggregate () { #{{{ eval q{use HTML::Entities}; error($@) if $@; - foreach my $feed (values %feeds) { - next unless $config{rebuild} || - time - $feed->{lastupdate} >= $feed->{updateinterval}; + foreach my $feed (@_) { $feed->{lastupdate}=time; $feed->{newposts}=0; $feed->{message}=sprintf(gettext("processed ok at %s"), displaytime($feed->{lastupdate})); $feed->{error}=0; - $IkiWiki::forcerebuild{$feed->{sourcepage}}=1; debug(sprintf(gettext("checking feed %s ..."), $feed->{name})); @@ -473,18 +552,6 @@ sub htmlabs ($$) { #{{{ return $ret; } #}}} -sub remove_feeds () { #{{{ - my $page=shift; - - my %removed; - foreach my $id (keys %feeds) { - if ($feeds{$id}->{sourcepage} eq $page) { - $feeds{$id}->{remove}=1; - $removed{$id}=1; - } - } -} #}}} - sub pagefile ($) { #{{{ my $page=shift; diff --git a/debian/changelog b/debian/changelog index 99ee5cdc2..1266666e3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,19 +6,22 @@ ikiwiki (2.31) UNRELEASED; urgency=low that contributes to a page's content and using the youngest of them all, as well as special cases for things like the version plugin, and it's just 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. * poll: This plugin turns out to have edited pages w/o doing any locking. Oops. Convert it from a cgi to a sessioncgi hook, which will work much better. - * aggregate: Revert use of forking to not save state, that was not the right - approach. * recentchanges: Improve handling of links on the very static changes pages by thunking to the CGI, which can redirect to the page, or allow it to be created if it doesn't exist. * recentchanges: Exipre all *._change pages, even if the directory they're in has changed. + * aggregate: Lots of changes; aggregation can now run without locking the + wiki, and there is a separate aggregatelock to prevent multiple concurrent + aggregation runs. -- Joey Hess Sat, 02 Feb 2008 23:36:31 -0500 diff --git a/doc/todo/aggregate_locking.mdwn b/doc/todo/aggregate_locking.mdwn index 91df662a7..b6c82e923 100644 --- a/doc/todo/aggregate_locking.mdwn +++ b/doc/todo/aggregate_locking.mdwn @@ -46,16 +46,12 @@ would be loaded, and there would be no reason to worry about aggregating. Or aggregation could be kept in checkconfig, like so: -* lock wiki * load aggregation state -* unlock wiki * get list of feeds needing aggregation * exit if none * attempt to take aggregation lock, exit if another aggregation is happening * fork a child process to do the aggregation - * lock wiki * load wiki state (needed for aggregation to run) - * unlock wiki * aggregate * lock wiki * reload aggregation state @@ -64,3 +60,5 @@ Or aggregation could be kept in checkconfig, like so: * drop aggregation lock * force rebuild of sourcepages of feeds that were aggregated * exit checkconfig and continue with usual refresh process + +[[done]] diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot index 69e231ada..62810a687 100644 --- a/po/ikiwiki.pot +++ b/po/ikiwiki.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-02-03 14:52-0500\n" +"POT-Creation-Date: 2008-02-03 16:05-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -67,67 +67,67 @@ msgstr "" msgid "You are banned." msgstr "" -#: ../IkiWiki/Plugin/aggregate.pm:72 +#: ../IkiWiki/Plugin/aggregate.pm:100 #, perl-format msgid "missing %s parameter" msgstr "" -#: ../IkiWiki/Plugin/aggregate.pm:100 +#: ../IkiWiki/Plugin/aggregate.pm:127 msgid "new feed" msgstr "" -#: ../IkiWiki/Plugin/aggregate.pm:114 +#: ../IkiWiki/Plugin/aggregate.pm:141 msgid "posts" msgstr "" -#: ../IkiWiki/Plugin/aggregate.pm:116 +#: ../IkiWiki/Plugin/aggregate.pm:143 msgid "new" msgstr "" -#: ../IkiWiki/Plugin/aggregate.pm:232 +#: ../IkiWiki/Plugin/aggregate.pm:307 #, perl-format msgid "expiring %s (%s days old)" msgstr "" -#: ../IkiWiki/Plugin/aggregate.pm:239 +#: ../IkiWiki/Plugin/aggregate.pm:314 #, perl-format msgid "expiring %s" msgstr "" -#: ../IkiWiki/Plugin/aggregate.pm:265 +#: ../IkiWiki/Plugin/aggregate.pm:343 #, perl-format msgid "processed ok at %s" msgstr "" -#: ../IkiWiki/Plugin/aggregate.pm:270 +#: ../IkiWiki/Plugin/aggregate.pm:347 #, perl-format msgid "checking feed %s ..." msgstr "" -#: ../IkiWiki/Plugin/aggregate.pm:275 +#: ../IkiWiki/Plugin/aggregate.pm:352 #, perl-format msgid "could not find feed at %s" msgstr "" -#: ../IkiWiki/Plugin/aggregate.pm:290 +#: ../IkiWiki/Plugin/aggregate.pm:367 msgid "feed not found" msgstr "" -#: ../IkiWiki/Plugin/aggregate.pm:301 +#: ../IkiWiki/Plugin/aggregate.pm:378 #, perl-format msgid "(invalid UTF-8 stripped from feed)" msgstr "" -#: ../IkiWiki/Plugin/aggregate.pm:307 +#: ../IkiWiki/Plugin/aggregate.pm:384 #, perl-format msgid "(feed entities escaped)" msgstr "" -#: ../IkiWiki/Plugin/aggregate.pm:313 +#: ../IkiWiki/Plugin/aggregate.pm:390 msgid "feed crashed XML::Feed!" msgstr "" -#: ../IkiWiki/Plugin/aggregate.pm:387 +#: ../IkiWiki/Plugin/aggregate.pm:464 #, perl-format msgid "creating new page %s" msgstr "" -- cgit v1.2.3 From 4f75dccb71e64e3b5ca0cd4cb04c601adc7360aa Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 4 Feb 2008 06:11:50 -0500 Subject: web commit by http://edward.myopenid.com/: prefix diff with a tab on each line so markdown treats it as code --- ...nline_plugin_option_to_show_full_page_path.mdwn | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'doc/todo') diff --git a/doc/todo/Inline_plugin_option_to_show_full_page_path.mdwn b/doc/todo/Inline_plugin_option_to_show_full_page_path.mdwn index ab9cd61e4..30490e9d3 100644 --- a/doc/todo/Inline_plugin_option_to_show_full_page_path.mdwn +++ b/doc/todo/Inline_plugin_option_to_show_full_page_path.mdwn @@ -15,14 +15,14 @@ Cheers, > that contains the full page name. Then you just use a modified > `inlinepage.tmpl`, that uses that instead of the title. --[[Joey]] -diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm -index 59eabb6..82913ba 100644 ---- a/IkiWiki/Plugin/inline.pm -+++ b/IkiWiki/Plugin/inline.pm -@@ -229,6 +229,7 @@ sub preprocess_inline (@) { #{{{ - $template->param(content => $content); - } - $template->param(pageurl => urlto(bestlink($params{page}, $page), $params{destpage})); -+ $template->param(page => $page); - $template->param(title => pagetitle(basename($page))); - $template->param(ctime => displaytime($pagectime{$page}, $params{timeformat})); + diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm + index 59eabb6..82913ba 100644 + --- a/IkiWiki/Plugin/inline.pm + +++ b/IkiWiki/Plugin/inline.pm + @@ -229,6 +229,7 @@ sub preprocess_inline (@) { #{{{ + $template->param(content => $content); + } + $template->param(pageurl => urlto(bestlink($params{page}, $page), $params{destpage})); + + $template->param(page => $page); + $template->param(title => pagetitle(basename($page))); + $template->param(ctime => displaytime($pagectime{$page}, $params{timeformat})); -- cgit v1.2.3 From 6fba45bb563aad612c48d90f1f744f91f5b79dd3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 4 Feb 2008 18:03:15 -0500 Subject: further comments --- doc/todo/allow_wiki_syntax_in_commit_messages.mdwn | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'doc/todo') diff --git a/doc/todo/allow_wiki_syntax_in_commit_messages.mdwn b/doc/todo/allow_wiki_syntax_in_commit_messages.mdwn index 01c5d397b..97691bdc3 100644 --- a/doc/todo/allow_wiki_syntax_in_commit_messages.mdwn +++ b/doc/todo/allow_wiki_syntax_in_commit_messages.mdwn @@ -9,4 +9,13 @@ a whole page into RecentChanges. Of course, it could only use _one_ of the available markups, ie the default markdown. --[[Joey]] To go along with this, the preview should show the formatted commit message. ---[[JoshTriplett]] \ No newline at end of file +--[[JoshTriplett]] + +This is really easy to do now, but it would have to be limited to applying +markdown formatting (or whatever formatter is default I suppose) to the +content, and *not* to expanding any WikiLinks or preprocessor directives. +Especially with the new static RecentChanges, expanding even wikilinks +would be pretty tricky to do. Applying markdown formatting seems like a +reasonable thing; it would make commit messages that have the form of a +bulletted list be marked up nicely, and would also handle _emphasised_ +words etc, and even http links. --[[Joey]] -- cgit v1.2.3 From 3414a01e4769c52c9193b17e09eff64ea6d2187a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 4 Feb 2008 19:12:38 -0500 Subject: web commit by http://edward.myopenid.com/: It would be nice if blog post pages could include the ctime. --- doc/todo/ctime_on_blog_post_pages_.mdwn | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 doc/todo/ctime_on_blog_post_pages_.mdwn (limited to 'doc/todo') diff --git a/doc/todo/ctime_on_blog_post_pages_.mdwn b/doc/todo/ctime_on_blog_post_pages_.mdwn new file mode 100644 index 000000000..4fd099d9d --- /dev/null +++ b/doc/todo/ctime_on_blog_post_pages_.mdwn @@ -0,0 +1,5 @@ +[[Blog|ikiwiki/blog]] feeds and index pages show the posted time (ctime), the actual blog entry pages only show the modified time. + +The user has to look at the history link to find when a blog item was posted. + +It would be nice if blog entry post pages could include the ctime. -- [[Edward_Betts]] -- cgit v1.2.3 From 5464285c04a41964cd21e80847107a77ad3f5fc0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 5 Feb 2008 03:54:23 -0500 Subject: web commit by http://edward.myopenid.com/: add links --- doc/todo/multiple_templates.mdwn | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'doc/todo') diff --git a/doc/todo/multiple_templates.mdwn b/doc/todo/multiple_templates.mdwn index 361270bb9..1d6180a77 100644 --- a/doc/todo/multiple_templates.mdwn +++ b/doc/todo/multiple_templates.mdwn @@ -1,11 +1,11 @@ -> Another useful feature might be to be able to choose a different template -> file for some pages; blog pages would use a template different from the +> Another useful feature might be to be able to choose a different [[template|wikitemplates]] +> file for some pages; [[blog|ikiwiki/blog]] pages would use a template different from the > home page, even if both are managed in the same repository, etc. -Well, that would probably be fairly easy to add if it used pagespecs to +Well, that would probably be fairly easy to add if it used [[pagespec]]s to specify which pages use the non-default template. -Hmm, I think the pagetemplate hook should allow one to get close enough to +Hmm, I think the [[pagetemplate|plugins/pagetemplate]] hook should allow one to get close enough to this in a plugin now. See also: [[Allow_per-page_template_selection]] -- same thing, really. -- cgit v1.2.3 From c73c11f81393b87d7e5cb063107cb5a2ff4da158 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 5 Feb 2008 03:55:24 -0500 Subject: web commit by http://edward.myopenid.com/: fix pagespec link --- doc/todo/multiple_templates.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/todo') diff --git a/doc/todo/multiple_templates.mdwn b/doc/todo/multiple_templates.mdwn index 1d6180a77..d165eebaf 100644 --- a/doc/todo/multiple_templates.mdwn +++ b/doc/todo/multiple_templates.mdwn @@ -2,7 +2,7 @@ > file for some pages; [[blog|ikiwiki/blog]] pages would use a template different from the > home page, even if both are managed in the same repository, etc. -Well, that would probably be fairly easy to add if it used [[pagespec]]s to +Well, that would probably be fairly easy to add if it used [[pagespecs|ikiwiki/pagespec]] to specify which pages use the non-default template. Hmm, I think the [[pagetemplate|plugins/pagetemplate]] hook should allow one to get close enough to -- cgit v1.2.3