From: intrigeri Date: Sat, 6 Jun 2009 12:03:40 +0000 (+0200) Subject: Merge commit 'upstream/master' into pub/po X-Git-Tag: 3.15~183 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/86edd73d169600875a10a635ef8df4a644545b0d?ds=inline;hp=-c Merge commit 'upstream/master' into pub/po Conflicts: debian/changelog debian/control Signed-off-by: intrigeri --- 86edd73d169600875a10a635ef8df4a644545b0d diff --combined IkiWiki.pm index 0e59b1b55,d7c827c89..67c1c6610 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@@ -1253,7 -1253,7 +1253,7 @@@ sub preprocess ($$$;$$) | "[^"]+" # single-quoted value | - [^\s\]]+ # unquoted value + [^"\s\]]+ # unquoted value ) \s* # whitespace or end # of directive @@@ -1276,7 -1276,7 +1276,7 @@@ | "[^"]+" # single-quoted value | - [^\s\]]+ # unquoted value + [^"\s\]]+ # unquoted value ) \s* # whitespace or end # of directive @@@ -1346,7 -1346,7 +1346,7 @@@ sub check_content (@) foreach my $line (split("\n", $params{content})) { push @diff, $line if ! exists $old{$_}; } - $params{content}=join("\n", @diff); + $params{diff}=join("\n", @diff); } my $ok; diff --combined IkiWiki/Plugin/rename.pm index 8dad92be3,0b6e74705..d0e5894dc --- a/IkiWiki/Plugin/rename.pm +++ b/IkiWiki/Plugin/rename.pm @@@ -10,7 -10,7 +10,7 @@@ sub import hook(type => "formbuilder_setup", id => "rename", call => \&formbuilder_setup); hook(type => "formbuilder", id => "rename", call => \&formbuilder); hook(type => "sessioncgi", id => "rename", call => \&sessioncgi); - + hook(type => "rename", id => "rename", call => \&rename_subpages); } sub getsetup () { @@@ -87,27 -87,6 +87,27 @@@ sub check_canrename ($$$$$$) IkiWiki::Plugin::attachment::check_canattach($session, $dest, $srcfile); } } + + my $canrename; + IkiWiki::run_hooks(canrename => sub { + return if defined $canrename; + my $ret=shift->(cgi => $q, session => $session, + src => $src, srcfile => $srcfile, + dest => $dest, destfile => $destfile); + if (defined $ret) { + if ($ret eq "") { + $canrename=1; + } + elsif (ref $ret eq 'CODE') { + $ret->(); + $canrename=0; + } + elsif (defined $ret) { + error($ret); + $canrename=0; + } + } + }); } sub rename_form ($$$) { @@@ -137,14 -116,16 +137,16 @@@ # insert the standard extensions my @page_types; if (exists $IkiWiki::hooks{htmlize}) { - @page_types=grep { !/^_/ } - keys %{$IkiWiki::hooks{htmlize}}; + foreach my $key (grep { !/^_/ } keys %{$IkiWiki::hooks{htmlize}}) { + push @page_types, [$key, $IkiWiki::hooks{htmlize}{$key}{longname} || $key]; + } } + @page_types=sort @page_types; # make sure the current extension is in the list my ($ext) = $pagesources{$page}=~/\.([^.]+)$/; if (! $IkiWiki::hooks{htmlize}{$ext}) { - unshift(@page_types, $ext); + unshift(@page_types, [$ext, $ext]); } $f->field(name => "type", type => 'select', @@@ -312,13 -293,27 +314,13 @@@ sub sessioncgi ($$) required => 1, }; - # See if any subpages need to be renamed. - if ($q->param("subpages") && $src ne $dest) { - foreach my $p (keys %pagesources) { - next unless $pagesources{$p}=~m/^\Q$src\E\//; - # If indexpages is enabled, the - # srcfile should not be confused - # with a subpage. - next if $pagesources{$p} eq $srcfile; - - my $d=$pagesources{$p}; - $d=~s/^\Q$src\E\//$dest\//; - push @torename, { - src => $p, - srcfile => $pagesources{$p}, - dest => pagename($d), - destfile => $d, - required => 0, - }; - } - } - + @torename=rename_hook( + torename => \@torename, + done => {}, + cgi => $q, + session => $session, + ); + require IkiWiki::Render; IkiWiki::disable_commit_hook() if $config{rcs}; my %origpagesources=%pagesources; @@@ -412,40 -407,7 +414,40 @@@ exit 0; } } - + +# Add subpages to the list of pages to be renamed, if needed. +sub rename_subpages (@) { + my %params = @_; + + my %torename = %{$params{torename}}; + my $q = $params{cgi}; + my $src = $torename{src}; + my $srcfile = $torename{src}; + my $dest = $torename{dest}; + my $destfile = $torename{dest}; + + return () unless ($q->param("subpages") && $src ne $dest); + + my @ret; + foreach my $p (keys %pagesources) { + next unless $pagesources{$p}=~m/^\Q$src\E\//; + # If indexpages is enabled, the srcfile should not be confused + # with a subpage. + next if $pagesources{$p} eq $srcfile; + + my $d=$pagesources{$p}; + $d=~s/^\Q$src\E\//$dest\//; + push @ret, { + src => $p, + srcfile => $pagesources{$p}, + dest => pagename($d), + destfile => $d, + required => 0, + }; + } + return @ret; +} + sub linklist { # generates a list of links in a form suitable for FormBuilder my $dest=shift; @@@ -477,43 -439,7 +479,43 @@@ sub renamepage_hook ($$$$) return $content; } - + +sub rename_hook (@) { + my %params = @_; + + my @torename=@{$params{torename}}; + my %done=%{$params{done}}; + my $q=$params{cgi}; + my $session=$params{session}; + + return () unless @torename; + + my @nextset; + foreach my $torename (@torename) { + unless (exists $done{$torename->{src}} && $done{$torename->{src}}) { + IkiWiki::run_hooks(rename => sub { + push @nextset, shift->( + torename => $torename, + cgi => $q, + session => $session, + ); + }); + $done{$torename->{src}}=1; + } + } + + push @torename, rename_hook( + torename => \@nextset, + done => \%done, + cgi => $q, + session => $session, + ); + + # dedup + my %seen; + return grep { ! $seen{$_->{src}}++ } @torename; +} + sub do_rename ($$$) { my $rename=shift; my $q=shift; diff --combined debian/changelog index 4e1aa8545,7f8257813..d72efe455 --- a/debian/changelog +++ b/debian/changelog @@@ -1,13 -1,43 +1,47 @@@ - ikiwiki (3.14) UNRELEASED; urgency=low + ikiwiki (3.15) UNRELEASED; urgency=low + * comment: Make comment directives no longer use the internal "_comment" + form, and document the comment directive syntax. + * Avoid relying on translators preserving the case when translating + "discussion", which caused Discussion pages to get unwanted Discussion + links. + * Tighten up matching of bare words inside directives; do not + allow an unterminated """ string to be treated as a series + of bare words. Fixes runaway regexp recursion/backtracking + in strange situations. + * Setup automator: Check that each plugin added to the generated + setup file can be loaded and that its config is ok. If a plugin + fails for any reason, disable it in the generated file. + Closes: 532001 + * pagecount: Fix broken optimisation for * pagespec. + * goto: Support being passed a page title that is not a valid page + name, to support several cases including mercurial's long user + names on the RecentChanges page, and urls with spaces being handled + by the 404 plugin. + * Add new hooks: canremove, canrename, rename. (intrigeri) + * rename: Refactor subpage rename handling code into rename hook. (intrigeri) + * po: New plugin, suporting translation of wiki pages using po files. + (intrigeri) - -- Joey Hess Mon, 20 Apr 2009 19:40:25 -0400 + -- Joey Hess Tue, 02 Jun 2009 17:03:41 -0400 - ikiwiki (3.13) UNRELEASED; urgency=low + ikiwiki (3.14) unstable; urgency=low + + * highlight: New plugin supporting syntax highlighting of pretty much + anything. + * debian/control: Add suggests for libhighlight-perl, although + that package is not yet created by Debian's highlight source package. + (See #529869) + * format: Provide a htmlizefallback hook that other plugins + can use to handle formats that are not suitable for general-purpose + htmlize hooks. Used by highlight. + * Fix test suite to not rely on an installed copy of ikiwiki after + underlaydir change. Closes: #530502 + * Danish translation update. Closes: #530877 + + -- Joey Hess Mon, 01 Jun 2009 13:05:34 -0400 + + ikiwiki (3.13) unstable; urgency=low * ikiwiki-transition: If passed a nonexistant srcdir, or one not containing .ikiwiki, abort with an error rather than creating it. @@@ -20,8 -50,12 +54,12 @@@ interpolation on user-supplied data when translating pagespecs. * ikiwiki-transition: Allow setup files to be passed to all subcommands that need a srcdir. + * ikiwiki-transition: deduplinks was broken and threw away all + metadata stored by plugins in the index. Fix this bug. + * listdirectives: Avoid listing _comment directives and generally + assume any directive starting with _ is likewise internal. - -- Joey Hess Wed, 06 May 2009 20:45:44 -0400 + -- Joey Hess Fri, 22 May 2009 14:10:56 -0400 ikiwiki (3.12) unstable; urgency=low diff --combined debian/control index 05ccd0df3,233de8f7c..5205ed749 --- a/debian/control +++ b/debian/control @@@ -35,7 -35,7 +35,8 @@@ Suggests: viewvc | gitweb | viewcvs, li liblocale-gettext-perl (>= 1.05-1), libtext-typography-perl, libtext-csv-perl, libdigest-sha1-perl, graphviz, libnet-amazon-s3-perl, sparkline-php, texlive, dvipng, libtext-wikicreole-perl, - libsort-naturally-perl, libtext-textile-perl, po4a (>= 0.35-1), gettext - libsort-naturally-perl, libtext-textile-perl, libhighlight-perl ++ libsort-naturally-perl, libtext-textile-perl, libhighlight-perl, ++ po4a (>= 0.35-1), gettext Conflicts: ikiwiki-plugin-table Replaces: ikiwiki-plugin-table Provides: ikiwiki-plugin-table diff --combined t/syntax.t index 8c96d1d84,05d955f33..a3760a2b2 --- a/t/syntax.t +++ b/t/syntax.t @@@ -6,13 -6,13 +6,13 @@@ use Test::More my @progs="ikiwiki.in"; my @libs="IkiWiki.pm"; # monotone, external, amazon_s3 skipped since they need perl modules -push @libs, map { chomp; $_ } `find IkiWiki -type f -name \\*.pm | grep -v monotone.pm | grep -v external.pm | grep -v amazon_s3.pm`; +push @libs, map { chomp; $_ } `find IkiWiki -type f -name \\*.pm | grep -v monotone.pm | grep -v external.pm | grep -v amazon_s3.pm | grep -v po.pm`; push @libs, 'IkiWiki/Plugin/skeleton.pm.example'; plan(tests => (@progs + @libs)); foreach my $file (@progs) { - ok(system("perl -T -c $file >/dev/null 2>&1") eq 0, $file); + ok(system("perl -c $file >/dev/null 2>&1") eq 0, $file); } foreach my $file (@libs) { ok(system("perl -c $file >/dev/null 2>&1") eq 0, $file);