1 Preliminary patch for a feature wishlist item: [[bugs/pruning_is_too_strict]].
3 diff --git a/IkiWiki.pm b/IkiWiki.pm
4 index 1a00f2d..7381ae7 100644
7 @@ -20,6 +20,7 @@ our $VERSION = 1.00;
12 memoize("pagespec_translate");
14 my $installdir=''; # INSTALLDIR_AUTOREPLACE done by Makefile, DNE
15 @@ -331,6 +332,14 @@ sub abs2rel ($$) { #{{{
19 +sub is_prune ($;$) { #{{{
21 + my $base=shift || $config{srcdir};
23 + my $rel=abs2rel($file, $base);
24 + return $rel eq '.' ? 0 : $rel=~m/$config{wiki_file_prune_regexp}/;
27 sub displaytime ($) { #{{{
30 diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm
31 index f550b67..5d1991d 100644
34 @@ -386,7 +386,7 @@ sub cgi_editpage ($$) { #{{{
35 my ($page)=$form->field('page');
36 $page=titlepage(possibly_foolish_untaint($page));
37 if (! defined $page || ! length $page ||
38 - $page=~/$config{wiki_file_prune_regexp}/ || $page=~/^\//) {
39 + is_prune($page) || $page=~/^\//) {
40 error("bad page name");
43 @@ -476,8 +476,7 @@ sub cgi_editpage ($$) { #{{{
45 if (! defined $from || ! length $from ||
46 $from ne $form->field('from') ||
47 - $from=~/$config{wiki_file_prune_regexp}/ ||
49 + is_prune($from) || $from=~/^\// ||
50 $form->submitted eq "Preview") {
51 @page_locs=$best_loc=$page;
53 diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm
54 index 48a25be..a083d3f 100644
55 --- a/IkiWiki/Render.pm
56 +++ b/IkiWiki/Render.pm
57 @@ -202,7 +202,7 @@ sub refresh () { #{{{
61 - if (/$config{wiki_file_prune_regexp}/) {
65 elsif (! -d $_ && ! -l $_) {
66 @@ -222,7 +222,7 @@ sub refresh () { #{{{
70 - if (/$config{wiki_file_prune_regexp}/) {
71 + if (is_prune($_, $config{underlaydir})) {
74 elsif (! -d $_ && ! -l $_) {