diff options
author | Joey Hess <joey@gnu.kitenet.net> | 2009-10-05 15:14:18 -0400 |
---|---|---|
committer | Joey Hess <joey@gnu.kitenet.net> | 2009-10-05 15:14:18 -0400 |
commit | 7123178732674268a1dce09277536dcdc68825f5 (patch) | |
tree | b767860bd7e00f9a53ae73c8fcd15d92ca791dae /IkiWiki/Plugin | |
parent | f41caf57eabdaa2345eba1718450af686dca3971 (diff) |
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.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r-- | IkiWiki/Plugin/orphans.pm | 10 |
1 files changed, 7 insertions, 3 deletions
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( |