]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
Merge commit 'upstream/master' into pub/po
authorintrigeri <intrigeri@boum.org>
Sat, 6 Jun 2009 12:03:40 +0000 (14:03 +0200)
committerintrigeri <intrigeri@boum.org>
Sat, 6 Jun 2009 12:03:40 +0000 (14:03 +0200)
Conflicts:

debian/changelog
debian/control

Signed-off-by: intrigeri <intrigeri@boum.org>
1  2 
IkiWiki.pm
IkiWiki/Plugin/rename.pm
debian/changelog
debian/control
t/syntax.t

diff --combined IkiWiki.pm
index 0e59b1b5503e829984b1bc1a3bf1a7ccb77ff97f,d7c827c89b240d8d1b178be76934ce3c868ba4f8..67c1c661055f3afaac79d23663908283bd08c11c
@@@ -1253,7 -1253,7 +1253,7 @@@ sub preprocess ($$$;$$) 
                                                |
                                                "[^"]+"         # single-quoted value
                                                |
-                                               [^\s\]]+        # unquoted value
+                                               [^"\s\]]+       # unquoted value
                                        )
                                        \s*                     # whitespace or end
                                                                # of directive
                                                |
                                                "[^"]+"         # 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 8dad92be3e8794c2ef09ed4a518f814fb49be2a5,0b6e74705b29e86330395344140d7b6390db7cf2..d0e5894dcac9e135f83794493c00cd75cea17527
@@@ -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 ($$$) {
                # 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;
                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 4e1aa854598fba25d699eca391e0463f39d54e79,7f82578130ff93b632f4a2a4ca3b6f94097f6ff8..d72efe455c1bc0071d8f9a5b4817b345c13a2c62
@@@ -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 <joeyh@debian.org>  Mon, 20 Apr 2009 19:40:25 -0400
+  -- Joey Hess <joeyh@debian.org>  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 <joeyh@debian.org>  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.
      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 <joeyh@debian.org>  Wed, 06 May 2009 20:45:44 -0400
+  -- Joey Hess <joeyh@debian.org>  Fri, 22 May 2009 14:10:56 -0400
  
  ikiwiki (3.12) unstable; urgency=low
  
diff --combined debian/control
index 05ccd0df332d2bc1347c4e862c3e1d95bcb2f1d3,233de8f7c52e525c6c53cda47c526a4ceff39b85..5205ed74951c2cbcdf4f5f8d3e666555c1532f12
@@@ -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 8c96d1d848014e9145739515e974f0b5aac271ac,05d955f33c1f36a26bd5beb4ed99b28f376ed865..a3760a2b2aa956b48bc1764dbff141335b0247ff
@@@ -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);