From 7123178732674268a1dce09277536dcdc68825f5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 5 Oct 2009 15:14:18 -0400 Subject: oprhans: Use a combination of precense and link dependencies. This makes it more efficient. It also fixes a longstanding bug, where if only a small set of pages were considered by orphans, changes to links on other pages failed to cause an update. --- IkiWiki/Plugin/orphans.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'IkiWiki/Plugin') diff --git a/IkiWiki/Plugin/orphans.pm b/IkiWiki/Plugin/orphans.pm index d981670e7..ae330b23b 100644 --- a/IkiWiki/Plugin/orphans.pm +++ b/IkiWiki/Plugin/orphans.pm @@ -23,9 +23,13 @@ sub preprocess (@) { my %params=@_; $params{pages}="*" unless defined $params{pages}; - # Needs to update whenever a page is changed, added, or removed, - # in order to see the link changes. - add_depends($params{page}, $params{pages}); + # Needs to update whenever a link changes, on any page + # since any page could link to one of the pages we're + # considering as orphans. + add_depends($params{page}, "*", links => 1); + # Also needs to update whenever potential orphans are added or + # removed. + add_depends($params{page}, $params{pages}, presence => 1); my @orphans; foreach my $page (pagespec_match_list( -- cgit v1.2.3