From: Joey Hess Date: Thu, 22 Apr 2010 04:34:03 +0000 (-0400) Subject: Merge branch 'autotag' X-Git-Tag: 3.20100427~62 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/3ee571390e3697a3b738ea6791ac7f07052a709c?hp=-c Merge branch 'autotag' --- 3ee571390e3697a3b738ea6791ac7f07052a709c diff --combined IkiWiki.pm index 509f9ba2e,dbf50feb4..19ed69d75 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@@ -12,19 -12,20 +12,20 @@@ use Storable use open qw{:utf8 :std}; use vars qw{%config %links %oldlinks %pagemtime %pagectime %pagecase - %pagestate %wikistate %renderedfiles %oldrenderedfiles - %pagesources %destsources %depends %depends_simple %hooks - %forcerebuild %loaded_plugins %typedlinks %oldtypedlinks}; + %pagestate %wikistate %renderedfiles %oldrenderedfiles + %pagesources %destsources %depends %depends_simple %hooks + %forcerebuild %loaded_plugins %typedlinks %oldtypedlinks + %autofiles}; use Exporter q{import}; our @EXPORT = qw(hook debug error template htmlpage deptype - add_depends pagespec_match pagespec_match_list bestlink - htmllink readfile writefile pagetype srcfile pagename - displaytime will_render gettext ngettext urlto targetpage - add_underlay pagetitle titlepage linkpage newpagefile - inject add_link - %config %links %pagestate %wikistate %renderedfiles - %pagesources %destsources %typedlinks); + add_depends pagespec_match pagespec_match_list bestlink + htmllink readfile writefile pagetype srcfile pagename + displaytime will_render gettext ngettext urlto targetpage + add_underlay pagetitle titlepage linkpage newpagefile + inject add_link add_autofile + %config %links %pagestate %wikistate %renderedfiles + %pagesources %destsources %typedlinks); our $VERSION = 3.00; # plugin interface version, next is ikiwiki version our $version='unknown'; # VERSION_AUTOREPLACE done by Makefile, DNE our $installdir='/usr'; # INSTALLDIR_AUTOREPLACE done by Makefile, DNE @@@ -1818,12 -1819,10 +1819,12 @@@ sub add_depends ($$;$) foreach my $p (keys %pagesources) { my $r=$sub->($p, location => $page); my $i=$r->influences; + my $static=$r->influences_static; foreach my $k (keys %$i) { + next unless $r || $static || $k eq $page; $depends_simple{$page}{lc $k} |= $i->{$k}; } - last if $r->influences_static; + last if $static; } $depends{$page}{$pagespec} |= $deptype; @@@ -1887,7 -1886,7 +1888,7 @@@ sub define_gettext () return shift; } }; - *ngettext=sub { + *ngettext=sub { $getobj->() if $getobj; if ($gettext_obj) { $gettext_obj->nget(@_); @@@ -1952,6 -1951,15 +1953,15 @@@ sub add_link ($$;$) } } + sub add_autofile ($$$) { + my $file=shift; + my $plugin=shift; + my $generator=shift; + + $autofiles{$file}{plugin}=$plugin; + $autofiles{$file}{generator}=$generator; + } + sub sortspec_translate ($$) { my $spec = shift; my $reverse = shift; @@@ -2138,9 -2146,6 +2148,9 @@@ sub pagespec_match_list ($$;@) my $r=$sub->($p, %params, location => $page); error(sprintf(gettext("cannot match pages: %s"), $r)) if $r->isa("IkiWiki::ErrorReason"); + unless ($r) { + $r->remove_influence($p); + } $accum |= $r; if ($r) { push @matches, $p; @@@ -2226,7 -2231,7 +2236,7 @@@ sub merge_influences my $anded=shift; if (! $anded || (($this || %{$this->[1]}) && - ($other || %{$other->[1]}))) { + ($other || %{$other->[1]}))) { foreach my $influence (keys %{$other->[1]}) { $this->[1]{$influence} |= $other->[1]{$influence}; } @@@ -2237,13 -2242,6 +2247,13 @@@ } } +sub remove_influence { + my $this=shift; + my $torm=shift; + + delete $this->[1]{$torm}; +} + package IkiWiki::ErrorReason; our @ISA = 'IkiWiki::FailReason'; diff --combined debian/NEWS index 2fbe0ea7b,8b87bc601..433fc845c --- a/debian/NEWS +++ b/debian/NEWS @@@ -1,4 -1,4 +1,4 @@@ -ikiwiki (3.20100406) unstable; urgency=low +ikiwiki (3.20100422) unstable; urgency=low This version of ikiwiki has a lot of changes that you need to know about. @@@ -11,6 -11,10 +11,10 @@@ not regular wikilinks. If your wiki accidentially relied on the old, buggy behavior, you might need to change pagespecs to use `link()`. + Tag pages can automatically be created as new tags are used. This + feature is enabled by default if you have configured a tagbase. It + can be turned on or off using the `tag_autocreate` setting. + The title_natural sort method (as used by the inline directive, etc) have been moved to the new sortnaturally plugin, which is not enabled by default since it requires the Sort::Naturally perl module. diff --combined debian/changelog index 647124b8a,a63860088..0ab04f522 --- a/debian/changelog +++ b/debian/changelog @@@ -1,6 -1,8 +1,8 @@@ -ikiwiki (3.20100415) UNRELEASED; urgency=low +ikiwiki (3.20100422) UNRELEASED; urgency=low [ Joey Hess ] + * tag: Automatic creation of tag pages can now be enabled using + the tag_autocreate setting. (David Riebenbauer) * bzr: Fix bzr log parsing to work with bzr 2.0. (liw) * comments: Fix missing entity encoding in title. * txt: Add a special case for robots.txt. @@@ -62,8 -64,6 +64,8 @@@ $pagestate{index}. * bzr: Support rcs_getmtime, and fix rcs_getctime implementation (Jelmer Vernooij) + * Quite a lot of new optimisations, and one major fix to a recent + performance regression. -- Joey Hess Sun, 04 Apr 2010 12:17:11 -0400 diff --combined doc/todo/auto-create_tag_pages_according_to_a_template.mdwn index b05e1db3d,1e0a910f4..f6d444890 --- a/doc/todo/auto-create_tag_pages_according_to_a_template.mdwn +++ b/doc/todo/auto-create_tag_pages_according_to_a_template.mdwn @@@ -239,7 -239,7 +239,7 @@@ wrong direction. (fixed --[[Joey]] [[!template id=gitbranch branch=origin/autotag author="[[Joey]]"]] I've pushed an autotag branch of my own, which refactors things a bit and fixes bugs around deletion/recreation. -I've tested it somewhat. --[[Joey]] +I've tested it fairly thouroughly. --[[Joey]] [f3abeac919c4736429bd3362af6edf51ede8e7fe]: http://git.liegesta.at/?p=ikiwiki.git;a=commitdiff;h=f3abeac919c4736429bd3362af6edf51ede8e7fe (commitdiff for f3abeac919c4736429bd3362af6edf51ede8e7fe) [4af4d26582f0c2b915d7102fb4a604b176385748]: http://git.liegesta.at/?p=ikiwiki.git;a=commitdiff;h=4af4d26582f0c2b915d7102fb4a604b176385748 (commitdiff for 4af4d26582f0c2b915d7102fb4a604b176385748) @@@ -247,3 -247,5 +247,5 @@@ [da5d29f95f6e693e8c14be1b896cf25cf4fdb3c0]: http://git.liegesta.at/?p=ikiwiki.git;a=commitdiff;h=da5d29f95f6e693e8c14be1b896cf25cf4fdb3c0 (commitdiff for da5d29f95f6e693e8c14be1b896cf25cf4fdb3c0) [a358d74bef51dae31332ff27e897fe04834571e6]: http://git.liegesta.at/?p=ikiwiki.git;a=commitdiff;h=a358d74bef51dae31332ff27e897fe04834571e6 (commitdiff for a358d74bef51dae31332ff27e897fe04834571e6) [981400177d68a279f485727be3f013e68f0bf691]: http://git.liegesta.at/?p=ikiwiki.git;a=commitdiff;h=981400177d68a279f485727be3f013e68f0bf691 (commitdiff for 981400177d68a279f485727be3f013e68f0bf691) + + [[!tag done]]