]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
Merge branch 'master' of ssh://git.ikiwiki.info/srv/git/ikiwiki.info
authorJoey Hess <joey@gnu.kitenet.net>
Sat, 15 Aug 2009 17:59:34 +0000 (13:59 -0400)
committerJoey Hess <joey@gnu.kitenet.net>
Sat, 15 Aug 2009 17:59:34 +0000 (13:59 -0400)
IkiWiki/Plugin/calendar.pm
IkiWiki/Plugin/img.pm
IkiWiki/Plugin/meta.pm
debian/changelog
doc/todo/should_optimise_pagespecs.mdwn

index fe4b16072131eea5571a86d75c65a7a117bb3efc..c25893f726ca96870bdb34389b9ab736c3dee745 100644 (file)
@@ -211,8 +211,8 @@ EOF
        # matching the pagespec are added or removed.
        add_depends($params{page}, $params{pages});
        # Explicitly add all currently linked pages as dependencies, so
-        # that if they are removed, the calendar will be sure to be updated.
-        add_depends($params{page}, join(" or ", @list));
+       # that if they are removed, the calendar will be sure to be updated.
+       add_depends($params{page}, join(" or ", @list));
 
        return $calendar;
 }
index 68b001671653000b4907ababf1d63782d834381c..5f97e38108ad22cfb9cde8dd9500d298201752be 100644 (file)
@@ -135,11 +135,15 @@ sub preprocess (@) {
        elsif ($params{link} =~ /^\w+:\/\//) {
                $imgtag='<a href="'.$params{link}.'">'.$imgtag.'</a>';
        }
-       elsif (length bestlink($params{page}, $params{link})) {
-               add_depends($params{page}, $params{link});
-               $imgtag=htmllink($params{page}, $params{destpage},
-                       $params{link}, linktext => $imgtag,
-                       noimageinline => 1);
+       else {
+               my $b = bestlink($params{page}, $params{link});
+       
+               if (length $b) {
+                       add_depends($params{page}, $b);
+                       $imgtag=htmllink($params{page}, $params{destpage},
+                               $params{link}, linktext => $imgtag,
+                               noimageinline => 1);
+               }
        }
 
        if (exists $params{caption}) {
index b2295923e31d94ed8d393a09d1ebeb2f05604878..514b0936907ce58edabcbafcb44d5559a154eec9 100644 (file)
@@ -191,11 +191,11 @@ sub preprocess (@) {
                if ($value !~ /^\w+:\/\//) {
                        my ($redir_page, $redir_anchor) = split /\#/, $value;
 
-                       add_depends($page, $redir_page);
                        my $link=bestlink($page, $redir_page);
                        if (! length $link) {
                                error gettext("redir page not found")
                        }
+                       add_depends($page, $link);
 
                        $value=urlto($link, $page);
                        $value.='#'.$redir_anchor if defined $redir_anchor;
index 147d279bb091c269866c66f1adc881646464759e..5bef06aec3b663a9f662d20d72a7a2696b69db27 100644 (file)
@@ -7,6 +7,7 @@ ikiwiki (3.141593) UNRELEASED; urgency=low
   * Add discussionpage configuration setting.
   * Several optimisations, including speedups to orphans and brokenlinks
     calculation.
+  * meta, img: Fix bugs in dependency code. (smcv)
 
  -- Joey Hess <joeyh@debian.org>  Wed, 12 Aug 2009 12:25:30 -0400
 
index 3ccef62fe57542e3603f64ac479c0cbf1e63d759..1919e3584ccb27db8d0181968c0ed137747e5f51 100644 (file)
@@ -105,4 +105,33 @@ I can think about reducung the size of my wiki source and making it available on
 >>>>> ikiwiki-transition, but that copy doesn't have to be optimal or support
 >>>>> future features like [[tracking_bugs_with_dependencies]]). --[[smcv]]
 
+---
+
+Some questions on your optimize-depends branch. --[[Joey]]
+
+In saveindex it still or'd together the depends list, but the `{depends}`
+field seems only useful for backwards compatability (ie, ikiwiki-transition
+uses it still), and otherwise just bloats the index.
+
+Is an array the right data structure? `add_depends` has to loop through the
+array to avoid dups, it would be better if a hash were used there. Since
+inline (and other plugins) explicitly add all linked pages, each as a
+separate item, the list can get rather long, and that single add_depends
+loop has suddenly become O(N^2) to the number of pages, which is something
+to avoid..
+
+Also, since a lot of places are calling add_depends in a loop, it probably
+makes sense to just make it accept a list of dependencies to add. It'll be
+marginally faster, probably, and should allow for better optimisation
+when adding a lot of depends at once.
+
+In Render.pm, we now have a triply nested loop, which is a bit
+scary for efficiency. It seems there should be a way to
+rework this code so it can use the optimised `pagespec_match_list`,
+and/or hoist some of the inner loop calculations (like the `pagename`)
+out.
+
+Very good catch on img/meta using the wrong dependency; verified in the wild!
+(I've cherry-picked those bug fixes.)
+
 [[!tag wishlist patch patch/core]]