]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
trail: Converted all dependencies to presence dependencies.
authorJoey Hess <joey@kitenet.net>
Fri, 28 Dec 2012 02:29:51 +0000 (22:29 -0400)
committerJoey Hess <joey@kitenet.net>
Fri, 28 Dec 2012 02:29:51 +0000 (22:29 -0400)
smcv please note this introduces another bug, which I've opened

IkiWiki/Plugin/trail.pm
debian/changelog
doc/bugs/trail_excess_dependencies.mdwn [new file with mode: 0644]

index 7d2338f9b9c7bd0dee446b1f0d7b60b80417fb90..cf0f0a15e874aa672ba5a9eff09859e3e6b1343a 100644 (file)
@@ -318,7 +318,7 @@ sub prerender {
                        $prev = $members->[$i - 1] if $i > 0;
                        my $next = $members->[$i + 1];
 
-                       add_depends($member, $trail);
+                       add_depends($member, $trail, deptype("presence"));
 
                        $member_to_trails{$member}{$trail} = [$prev, $next];
                }
@@ -406,13 +406,13 @@ sub pagetemplate (@) {
                        my ($prevurl, $nexturl, $prevtitle, $nexttitle);
 
                        if (defined $prev) {
-                               add_depends($params{destpage}, $prev);
+                               add_depends($params{destpage}, $prev, deptype("presence"));
                                $prevurl = urlto($prev, $page);
                                $prevtitle = title_of($prev);
                        }
 
                        if (defined $next) {
-                               add_depends($params{destpage}, $next);
+                               add_depends($params{destpage}, $next, deptype("presence"));
                                $nexturl = urlto($next, $page);
                                $nexttitle = title_of($next);
                        }
index 6f13b2dd564e9c4a37591dc77383e259ee7ee905..948fdcc8445c48734dd6adaeb0050c46dbd7ce5b 100644 (file)
@@ -3,6 +3,7 @@ ikiwiki (3.20121213) UNRELEASED; urgency=low
   * htmlscrubber: Allow the bitcoin URI scheme.
   * aggregate: When run with --aggregate, if an aggregation is already
     running, don't go on and --refresh.
+  * trail: Converted all dependencies to presence dependencies.
 
  -- Joey Hess <joeyh@debian.org>  Sat, 22 Dec 2012 16:15:24 -0400
 
diff --git a/doc/bugs/trail_excess_dependencies.mdwn b/doc/bugs/trail_excess_dependencies.mdwn
new file mode 100644 (file)
index 0000000..d5dcd54
--- /dev/null
@@ -0,0 +1,26 @@
+I've just modified the trail plugin to use only presence, and not
+content dependencies. Using content dependencies, particularly to the page
+that defines the trail, meant that every time that page changed, *every*
+page in the trail gets rebuilt. This leads to users setting up sites that
+have horrible performance, if the trail is defined in, for example, the top
+page of a blog.
+
+Unfortunatly, this change to presence dependencies has
+introduced a bug. Now when an existing trail is removed, the pages in the
+trail don't get rebuilt to remove the trail (both html display and state).
+
+I think that to fix this bug, the plugin should use a hook to 
+force rebuilding of all the pages that were in the trail, when
+the trail is removed (or changed).
+
+There's a difficulty in doing that: The needsbuild hook runs before the scan
+hook, so before it has a chance to see if the trail directive is still there.
+It'd need some changes to ikiwiki's hooks.
+
+(An improvement in this area would probably simplify other plugins, which
+currently abuse the needsbuild hook to unset state, to handle the case
+where the directive that resulted in that state is removed.)
+
+I apologise for introducing a known bug, but the dependency mess was too
+bad to leave as-is. And I have very little time (and regrettably, even less
+power) to deal with it right now. :( --[[Joey]]