]> sipb.mit.edu Git - ikiwiki.git/blob - doc/todo/tracking_bugs_with_dependencies.mdwn
464f68363eb35ab4c11d2ef6f0076cbdf0c3a711
[ikiwiki.git] / doc / todo / tracking_bugs_with_dependencies.mdwn
1 I like the idea of [[tips/integrated_issue_tracking_with_ikiwiki]], and I do so on several wikis.  However, as far as I can tell, ikiwiki has no functionality which can represent dependencies between bugs and allow pagespecs to select based on dependencies.  For instance, I can't write a pagespec which selects all bugs with no dependencies on bugs not marked as done.  --[[JoshTriplett]]
2
3 > I started having a think about this.  I'm going to start with the idea that expanding
4 > the pagespec syntax is the way to attack this.  It seems that any pagespec that is going
5 > to represent "all bugs with no dependencies on bugs not marked as done" is going to
6 > need some way to represent "bugs not marked as done" as a collection of pages, and
7 > then represent "bugs which do not link to pages in the previous collection".
8 >
9 > One way to do this would be to introduce variables into the pagespec, along with
10 > universal and/or existential [[!wikipedia Quantification]].  That looks quite complex.
11 >
12 >> I thought about this briefly, and got about that far.. glad you got
13 >> further. :-) --[[Joey]]
14
15 >> Or, one [[!taglink could_also_refer|pagespec_in_DL_style]] to the language of [[!wikipedia description logics]]: their formulas actually define classes of objects through quantified relations to other classes. --Ivan Z.
16
17 > Another option would be go with a more functional syntax.  The concept here would
18 > be to allow a pagespec to appear in a 'pagespec function' anywhere a page can.  e.g.
19 > I could pass a pagespec to `link()` and that would return true if there is a link to any
20 > page matching the pagespec.  This makes the variables and existential quantification
21 > implicit.  It would allow the example requested above:
22 >
23 >> `bugs/* and !*/Discussion and !link(bugs/* and !*/Discussion and !link(done))`
24 >
25 > Unfortunately, this is also going to make the pagespec parsing more complex because
26 > we now need to parse nested sets of parentheses to know when the nested pagespec
27 > ends, and that isn't a regular language (we can't use regular expression matching for
28 > easy parsing).
29 >
30 >> Also, it may cause ambiguities with page names that contain parens
31 >> (though some such ambigutities already exist with the pagespec syntax).
32 >
33 > One simplification of that would be to introduce some pagespec [[shortcuts]].  We could
34 > then allow pagespec functions to take either pages, or named pagespec shortcuts.  The
35 > pagespec shortcuts would just be listed on a special page, like current [[shortcuts]].
36 > (It would probably be a good idea to require that shortcuts on that page can only refer
37 > to named pagespecs higher up that page than themselves.  That would stop some
38 > looping issues...)  These shortcuts would be used as follows: when trying to match
39 > a page (without globs) you look to see if the page exists.  If it does then you have a
40 > match.  If it doesn't, then you look to see if a similarly named pagespec shortcut
41 > exists.  If it does, then you check that pagespec recursively to see if you have a match.
42 > The ordering requirement on named pagespecs stops infinite recursion.
43 >
44 > Does that seem like a reasonable first approach?
45 >
46 > -- [[Will]]
47
48 >> Having a separate page for the shortcuts feels unwieldly.. perhaps
49 >> instead the shortcut could be defined earlier in the scope of the same
50 >> pagespec that uses it?
51 >> 
52 >> Example: `define(~bugs, bugs/* and !*/Discussion) and define(~openbugs, ~bugs and !link(done)) and ~openbugs and !link(~openbugs)`
53
54 >>> That could work.  parens are only ever nested 1 deep in that grammar so it is regular and the current parsing would be ok.
55
56 >> Note that I made the "~" explicit, not implicit, so it could be left out. In the case of ambiguity between
57 >> a definition and a page name, the definition would win.
58
59 >>> That was my initial thought too :), but when implementing it I decided that requiring the ~ made things easier.  I'll probably require the ~ for the first pass at least.
60
61 >> So, equivilant example: `define(bugs, bugs/* and !*/Discussion) and define(openbugs, bugs and !link(done)) and openbugs and !link(openbugs)`
62 >> 
63
64 >> Re recursion, it is avoided.. but building a pagespec that is O(N^X) where N is the
65 >> number of pages in the wiki is not avoided. Probably need to add DOS prevention.
66 >>  --[[Joey]]
67
68 >>> If you memoize the outcomes of the named pagespecs you can make in O(N.X), no?
69 >>> -- [[Will]]
70
71 >>>> Yeah, guess that'd work. :-)
72
73 > <a id="another_kind_of_links" />One quick further thought.  All the above discussion assumes that 'dependency' is the
74 > same as 'links to', which is not really true.  For example, you'd like to be able to say
75 > "This bug does not depend upon [ [ link to other bug ] ]" and not have a dependency.
76 > Without having different types of links, I don't see how this would be possible.
77 >
78 > -- [[Will]]
79
80 >> I saw that this issue is targeted at by the work on [[structured page data#another_kind_of_links]]. --Ivan Z.
81
82 Okie - I've had a quick attempt at this.  Initial patch attached.  This one doesn't quite work.
83 And there is still a lot of debugging stuff in there.
84
85 At the moment I've added a new preprocessor plugin, `definepagespec`, which is like
86 shortcut for pagespecs.  To reference a named pagespec, use `~` like this:
87
88     [ [!definepagespec name="bugs" spec="bugs/* and !*/Discussion"]]
89     [ [!definepagespec name="openbugs" spec="~bugs and !link(done)"]]
90     [ [!definepagespec name="readybugs" spec="~openbugs and !link(~openbugs)"]]
91
92 At the moment the problem is in `match_link()` when we're trying to find a sub-page that
93 matches the appropriate page spec.  There is no good list of pages available to iterate over.
94
95     foreach my $nextpage (keys %IkiWiki::pagesources)
96
97 does not give me a good list of pages.  I found the same thing when I was working on
98 this todo [[todo/Add_a_plugin_to_list_available_pre-processor_commands]].
99
100 > I'm not sure why iterating over `%pagesources` wouldn't work here, it's the same method
101 > used by anything that needs to match a pagespec against all pages..? --[[Joey]]
102
103 >> My uchecked hypothesis is that %pagesources is created after the refresh hook.
104 >> I've also been concerned about how globally defined pagespec shortcuts would interact with
105 >> the page dependancy system.  Your idea of internally defined shortcuts should fix that. -- [[Will]]
106
107 >>> You're correct, the refresh hook is run very early, before pagesources
108 >>> is populated. (It will be partially populated on a refresh, but will
109 >>> not be updated to reflect new pages.) Agree that internally defined
110 >>> seems the way to go. --[[Joey]]
111
112 Immediately below is a patch which seems to basically work.  Lots of debugging code is still there
113 and it needs a cleanup, but I thought it worth posting at this point.  (I was having problems
114 with old style glob lists, so i just switched them off for the moment.)
115
116 The following three inlines work for me with this patch:
117
118     Bugs:
119     
120     [ [!inline pages="define(~bugs, bugs/* and ! */Discussion) and ~bugs" archive="yes"]]
121     
122     OpenBugs:
123     
124     [ [!inline pages="define(~bugs, bugs/* and ! */Discussion) and define(~openbugs,~bugs and !link(done)) and ~openbugs" archive="yes"]]
125     
126     ReadyBugs:
127     
128     [ [!inline pages="define(~bugs, bugs/* and ! */Discussion) and define(~openbugs,~bugs and !link(done)) and define(~readybugs,~openbugs and !link(~openbugs)) and ~readybugs" archive="yes"]]
129
130 > Nice! Could the specfuncsref be passed in %params? I'd like to avoid
131 > needing to change the prototype of every pagespec function, since several
132 > plugins define them too. --[[Joey]]
133
134 >> Maybe - it needs more thought.  I also considered it when I was going though changing all those plugins :).
135 >> My concern was that `%params` can contain other user-defined parameters,
136 >> e.g. `link(target, otherparameter)`, and that means that the specFuncs could be clobbered by a user (or other
137 >> weird security hole).  I thought it better to separate it, but I didn't think about it too hard.  I might move it to
138 >> the first parameter rather than the second.  Ikiwiki is my first real perl hacking and I'm still discovering
139 >> good ways to write things in perl.
140 >>
141 >>>> `%params` contains the parameters passed to `pagespec_match`, not
142 >>>> user-supplied parameters. The user-supplied parameter to a function
143 >>>> like `match_glob()` or `match_link()` is passed in the second positional parameter. --[[Joey]]
144
145 >>>>> OK.  That seems reasonable then.  The only problem is that my PERLfu is not strong enough to make it
146 >>>>> work.  I really have to wonder what substance was influencing the designers of PERL...
147 >>>>> I can't figure out how to use the %params.  And I'm pissed off enough with PERL that I'm not going
148 >>>>> to try and figure it out any more.  There are two patches below now.  The first one uses an extra
149 >>>>> argument and works.  The second one tries to use %params and doesn't - take your pick :-). -- [[Will]]
150
151 >> What do you think is best to do about `is_globlist()`?  At the moment it requires that the 'second word', as
152 >> delimited by a space and ignoring parens, is 'and' or 'or'.  This doesn't hold in the above example pagespecs (so I just hard wired it to 0 to test my patch).
153 >> My thought was just to search for 'and' or 'or' as words anywhere in the pagespec.  Thoughts?
154
155 >>> Dunno, we could just finish deprecating it. Or change the regexp to
156 >>> skip over spaces in parens. (`/[^\s]+\s+([^)]+)/`) --[[Joey]]
157
158 >>>> I think I have a working regexp now.
159
160 >> Oh, one more thing.  In pagespec_translate (now pagespec_makeperl), there is a part of the regular expression for `# any other text`.
161 >> This contained `()`, which has no effect.  I replaced that with `\(\)`, but that is a change in the definition of pagespecs unrelated to the
162 >> rest of this patch. In a related change, commands were not able to contain `)` in their parameters.  I've extended that so the cannot
163 >> contain `(` or `)`.  -- [[Will]]
164
165 >>> `[^\s()]+` is a character class matching all characters not spaces or
166 >>> parens. Since the pervious terminals in the regexp consume most
167 >>> occurances of an open paren or close paren, it's unlikely for one to
168 >>> get through to that part of the regexp. For example, "foo()" will be
169 >>> matched by the command matcher; "(foo)" will be matched by the open
170 >>> paren literal terminal. "foo(" and "foo)" can get through to the
171 >>> end, and would be matched as a page name, if it didn't exclude parens.
172 >>>
173 >>> So why exclude them? Well, consider "foo and(bar and baz)". We don't
174 >>> want it to match "and(" as a page name!
175 >>> 
176 >>> Escaping the parens in the character class actually changes nothing; the
177 >>> changed character class still matches all characters not spaces or
178 >>> parens. (Try it!).
179 >>> 
180 >>> Re commands containing '(', I don't really see any reason not to
181 >>> allow that, unless it breaks something. --[[Joey]]
182
183 >>>> Oh, I didn't realise you didn't need to escape parens inside [].  All else I
184 >>>> I understood.  I have stopped commands from containing parens because
185 >>>> once you allow that then you might have a extra level of depth in the parsing
186 >>>> of define() statements. -- [[Will]]
187
188 >>> Updated patch.  Moved the specFuncsRef to the front of the arg list.  Still haven't thought through the security implications of
189 >>> having it in `%params`.  I've also removed all the debugging `print` statements.  And I've updated the `is_globlist()` function.
190 >>> I think this is ready for people other than me to have a play.  It is not well enough tested to commit just yet.
191 >>> -- [[Will]]
192
193 I've lost track of the indent level, so I'm going back to not indented - I think this is a working [[patch]] taking into
194 account all comments above (which doesn't mean it is above reproach :) ).  --[[Will]]
195
196 > Very belated code review of last version of the patch:
197
198 > * `is_globlist` is no longer needed
199
200 >> Good :)
201
202 > * I don't understand why the pagespec match regexp is changed
203 >   from having flags `igx` to `ixgs`. Don't see why you
204 >   want `.` to match '\n` in it, and don't see any `.` in the regexp 
205 >   anyway?
206
207 >> Because you have to define all the named pagespecs in the pagespec, you sometimes end up with very long pagespecs.  I found it useful to split them over multiple lines.  That didn't work at one point and I added the 's' to make it work.  I may have further altered the regex since then to make the 's' redundant.  Remove it and see if multi-line pagespecs still work. :)
208
209 > * Some changes of `@_` to `%params` in `pagespec_makeperl` do not
210 >   make sense to me. I don't see where \%params is defined and populated,
211 >   except with `\$params{specFunc}`.
212
213 >> I'm not a perl hacker.  This was a mighty battle for me to get going.  There is probably some battlefield carnage from my early struggles learning perl left here.
214 >> Part of this is that @_ / @params already existed as a way of passing in extra parameters.  I didn't want to pollute that top level namespace - just at my own parameter (a hash) which contained the data I needed.
215
216 > * Seems that the only reason `match_glob` has to check for `~` is
217 >   because when a named spec appears in a pagespec, it is translated
218 >   to `match_glob("~foo")`. If, instead, `pagespec_makeperl` checked
219 >   for named specs, it could convert them into `check_named_spec("foo")`
220 >   and avoid that ugliness.
221
222 >> Yeah - I wanted to make named specs syntactically different on my first pass.  You are right in that this could be made a fallback - named specs always override pagenames.
223
224 > * The changes to `match_link` seem either unecessary, or incomplete.
225 >   Shouldn't it check for named specs and call
226 >   `check_named_spec_existential`?
227
228 >>  An earlier version did.  Then I realised it wasn't actually needed in that case - match_link() already included a loop that was like a type of existential matching.  Each time through the loop it would
229 >> call match_glob().  match_glob() in turn will handle the named spec.  I tested this version briefly and it seemed to work.  I remember looking at this again later and wondering if I had mis-understood
230 >> some of the logic in match_link(), which might mean there are cases where you would need an explicit call to check_named_spec_existential() - I never checked it properly after having that thought.
231
232 > * Generally, the need to modify `match_*` functions so that they
233 >   check for and handle named pagespecs seems suboptimal, if
234 >   only because there might be others people may want to use named
235 >   pagespecs with. It would be possible to move this check
236 >   to `pagespec_makeperl`, by having it check if the parameter
237 >   passed to a pagespec function looked like a named pagespec.
238 >   The only issue is that some pagespec functions take a parameter
239 >   that is not a page name at all, and it could be weird
240 >   if such a parameter were accidentially interpreted as a named
241 >   pagespec. (But, that seems unlikely to happen.)
242
243 >> Possibly.  I'm not sure which I prefer between the current solution and that one.  Each have advantages and disadvantages.
244 >> It really isn't much code for the match functions to add a call to check_named_spec_existential().
245
246 > * I need to check if your trick to avoid infinite recursion
247 >   works if there are two named specs that recursively
248 >   call one-another. I suspect it does, but will test this
249 >   myself..
250
251 >> It worked for me. :)
252
253 > --[[Joey]] 
254
255 >>  There is one issue that I've been thinking about that I haven't raised anywhere (or checked myself), and that is how this all interacts with page dependencies.
256 >>  Firstly, I'm not sure anymore that the `pagespec_merge` function will continue to work in all cases.  Secondly, it seems that there are two types of dependency, and ikiwiki
257 >> currently only handles one of them.  The first type is "Rebuild this page when any of these other pages changes" - ikiwiki handles this.  The second type is "rebuild this page when
258 >> set of pages referred to by this pagespec changes" - ikiwiki doesn't seem to handle this.  I suspect that named pagespecs would make that second type of dependency more
259 >> important.  I'll try to come up with a good example. -- [[Will]]
260
261 >>> Hrm, I was going to build an example of this with backlinks, but it looks like that is handled as a special case at the moment (line 458 of render.pm).  I'll see if I can break
262 >>> things another way.  Fixing this properly would allow removal of that special case. -- [[Will]]
263
264 ----
265
266     diff --git a/IkiWiki.pm b/IkiWiki.pm
267     index 4e4da11..8b3cdfe 100644
268     --- a/IkiWiki.pm
269     +++ b/IkiWiki.pm
270     @@ -1550,7 +1550,16 @@ sub globlist_to_pagespec ($) {
271      
272      sub is_globlist ($) {
273         my $s=shift;
274     -   return ( $s =~ /[^\s]+\s+([^\s]+)/ && $1 ne "and" && $1 ne "or" );
275     +   return ! ($s =~ /
276     +                   (^\s*
277     +                           [^\s(]+         # single item
278     +                                   (\(                     # possibly with parens after it
279     +                                           ([^)]*  # with stuff inside those parens
280     +                                           (\([^)]*\))*)*  # maybe even nested parens
281     +                                   \))?\s*$
282     +                   ) |
283     +                           (\s and \s) | (\s or \s)        # or we find 'and' or 'or' somewhere
284     +                   /xs);
285      }
286      
287      sub safequote ($) {
288     @@ -1631,7 +1640,7 @@ sub pagespec_merge ($$) {
289         return "($a) or ($b)";
290      }
291      
292     -sub pagespec_translate ($) {
293     +sub pagespec_makeperl ($) {
294         my $spec=shift;
295      
296         # Support for old-style GlobLists.
297     @@ -1650,12 +1659,14 @@ sub pagespec_translate ($) {
298                 |
299                         \)              # )
300                 |
301     -                   \w+\([^\)]*\)   # command(params)
302     +                   define\(\s*~\w+\s*,((\([^()]*\)) | ([^()]+))+\) # define(~specName, spec) - spec can contain parens 1 deep
303     +           |
304     +                   \w+\([^()]*\)   # command(params) - params cannot contain parens
305                 |
306                         [^\s()]+        # any other text
307                 )
308                 \s*             # ignore whitespace
309     -   }igx) {
310     +   }igxs) {
311                 my $word=$1;
312                 if (lc $word eq 'and') {
313                         $code.=' &&';
314     @@ -1666,16 +1677,23 @@ sub pagespec_translate ($) {
315                 elsif ($word eq "(" || $word eq ")" || $word eq "!") {
316                         $code.=' '.$word;
317                 }
318     -           elsif ($word =~ /^(\w+)\((.*)\)$/) {
319     +           elsif ($word =~ /^define\(\s*~(\w+)\s*,(.*)\)$/s) {
320     +                   $code .= " (\$params{specFuncs}->{$1}=";        # (exists \$params{specFuncs}) && 
321     +                   $code .= "memoize(";
322     +                   $code .= &pagespec_makeperl($2);
323     +                   $code .= ")";
324     +                   $code .= ") ";
325     +           }
326     +           elsif ($word =~ /^(\w+)\((.*)\)$/s) {
327                         if (exists $IkiWiki::PageSpec::{"match_$1"}) {
328     -                           $code.="IkiWiki::PageSpec::match_$1(\$page, ".safequote($2).", \@_)";
329     +                           $code.="IkiWiki::PageSpec::match_$1(\$page, ".safequote($2).", \%params)";
330                         }
331                         else {
332                                 $code.=' 0';
333                         }
334                 }
335                 else {
336     -                   $code.=" IkiWiki::PageSpec::match_glob(\$page, ".safequote($word).", \@_)";
337     +                   $code.=" IkiWiki::PageSpec::match_glob(\$page, ".safequote($word).", \%params)";
338                 }
339         }
340      
341     @@ -1683,8 +1701,18 @@ sub pagespec_translate ($) {
342                 $code=0;
343         }
344      
345     +   return 'sub { my $page=shift; my %params = @_; '.$code.' }';
346     +}
347     +
348     +sub pagespec_translate ($) {
349     +   my $spec=shift;
350     +
351     +   my $code = pagespec_makeperl($spec);
352     +
353     +   # print STDERR "Spec '$spec' generated code '$code'\n";
354     +
355         no warnings;
356     -   return eval 'sub { my $page=shift; '.$code.' }';
357     +   return eval $code;
358      }
359      
360      sub pagespec_match ($$;@) {
361     @@ -1699,7 +1727,7 @@ sub pagespec_match ($$;@) {
362      
363         my $sub=pagespec_translate($spec);
364         return IkiWiki::FailReason->new("syntax error in pagespec \"$spec\"") if $@;
365     -   return $sub->($page, @params);
366     +   return $sub->($page, @params, specFuncs => {});
367      }
368      
369      sub pagespec_valid ($) {
370     @@ -1748,11 +1776,78 @@ sub new {
371      
372      package IkiWiki::PageSpec;
373      
374     +sub check_named_spec($$;@) {
375     +   my $page=shift;
376     +   my $specName=shift;
377     +   my %params=@_;
378     +   
379     +   error("Unable to find specFuncs in params to check_named_spec()!") unless exists $params{specFuncs};
380     +
381     +   my $specFuncsRef=$params{specFuncs};
382     +   
383     +   return IkiWiki::FailReason->new("Named page spec '$specName' is not valid")
384     +           unless (substr($specName, 0, 1) eq '~');
385     +   
386     +   $specName = substr($specName, 1);
387     +
388     +   if (exists $specFuncsRef->{$specName}) {
389     +           # remove the named spec from the spec refs
390     +           # when we recurse to avoid infinite recursion
391     +           my $sub = $specFuncsRef->{$specName};
392     +           delete $specFuncsRef->{$specName};
393     +           my $result = $sub->($page, %params);
394     +           $specFuncsRef->{$specName} = $sub;
395     +           return $result;
396     +   } else {
397     +           return IkiWiki::FailReason->new("Page spec '$specName' does not exist");
398     +   }
399     +}
400     +
401     +sub check_named_spec_existential($$$;@) {
402     +   my $page=shift;
403     +   my $specName=shift;
404     +   my $funcref=shift;
405     +   my %params=@_;
406     +   
407     +   error("Unable to find specFuncs in params to check_named_spec_existential()!") unless exists $params{specFuncs};
408     +   my $specFuncsRef=$params{specFuncs};
409     +   
410     +   return IkiWiki::FailReason->new("Named page spec '$specName' is not valid")
411     +           unless (substr($specName, 0, 1) eq '~');
412     +   $specName = substr($specName, 1);
413     +   
414     +   if (exists $specFuncsRef->{$specName}) {
415     +           # remove the named spec from the spec refs
416     +           # when we recurse to avoid infinite recursion
417     +           my $sub = $specFuncsRef->{$specName};
418     +           delete $specFuncsRef->{$specName};
419     +           
420     +           foreach my $nextpage (keys %IkiWiki::pagesources) {
421     +                   if ($sub->($nextpage, %params)) {
422     +                           my $tempResult = $funcref->($page, $nextpage, %params);
423     +                           if ($tempResult) {
424     +                                   $specFuncsRef->{$specName} = $sub;
425     +                                   return $tempResult;
426     +                           }
427     +                   }
428     +           }
429     +           
430     +           $specFuncsRef->{$specName} = $sub;
431     +           return IkiWiki::FailReason->new("No page in spec '$specName' was successfully matched");
432     +   } else {
433     +           return IkiWiki::FailReason->new("Named page spec '$specName' does not exist");
434     +   }
435     +}
436     +
437      sub match_glob ($$;@) {
438         my $page=shift;
439         my $glob=shift;
440         my %params=@_;
441         
442     +   if (substr($glob, 0, 1) eq '~') {
443     +           return check_named_spec($page, $glob, %params);
444     +   }
445     +
446         my $from=exists $params{location} ? $params{location} : '';
447         
448         # relative matching
449     @@ -1782,11 +1877,12 @@ sub match_internal ($$;@) {
450      
451      sub match_link ($$;@) {
452         my $page=shift;
453     -   my $link=lc(shift);
454     +   my $fulllink=shift;
455         my %params=@_;
456     +   my $link=lc($fulllink);
457      
458         my $from=exists $params{location} ? $params{location} : '';
459     -
460     +   
461         # relative matching
462         if ($link =~ m!^\.! && defined $from) {
463                 $from=~s#/?[^/]+$##;
464     @@ -1804,19 +1900,32 @@ sub match_link ($$;@) {
465                 }
466                 else {
467                         return IkiWiki::SuccessReason->new("$page links to page $p matching $link")
468     -                           if match_glob($p, $link, %params);
469     +                           if match_glob($p, $fulllink, %params);
470                 }
471         }
472         return IkiWiki::FailReason->new("$page does not link to $link");
473      }
474      
475      sub match_backlink ($$;@) {
476     -   return match_link($_[1], $_[0], @_);
477     +   my $page=shift;
478     +   my $backlink=shift;
479     +   my @params=@_;
480     +
481     +   if (substr($backlink, 0, 1) eq '~') {
482     +           return check_named_spec_existential($page, $backlink, \&match_backlink, @params);
483     +   }
484     +
485     +   return match_link($backlink, $page, @params);
486      }
487      
488      sub match_created_before ($$;@) {
489         my $page=shift;
490         my $testpage=shift;
491     +   my @params=@_;
492     +
493     +   if (substr($testpage, 0, 1) eq '~') {
494     +           return check_named_spec_existential($page, $testpage, \&match_created_before, @params);
495     +   }
496      
497         if (exists $IkiWiki::pagectime{$testpage}) {
498                 if ($IkiWiki::pagectime{$page} < $IkiWiki::pagectime{$testpage}) {
499     @@ -1834,6 +1943,11 @@ sub match_created_before ($$;@) {
500      sub match_created_after ($$;@) {
501         my $page=shift;
502         my $testpage=shift;
503     +   my @params=@_;
504     +
505     +   if (substr($testpage, 0, 1) eq '~') {
506     +           return check_named_spec_existential($page, $testpage, \&match_created_after, @params);
507     +   }
508      
509         if (exists $IkiWiki::pagectime{$testpage}) {
510                 if ($IkiWiki::pagectime{$page} > $IkiWiki::pagectime{$testpage}) {