aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2009-01-10 14:36:03 -0500
committerJoey Hess <joey@gnu.kitenet.net>2009-01-10 14:36:03 -0500
commit7a8ea68fc0bba9f75ba81a9547d359f42e31caa4 (patch)
tree1cab907cc9231351e934177854f876bec65bc999
parent8fd086cb8ac49dad2b14f9d85e58e42348b6c102 (diff)
downloadikiwiki-7a8ea68fc0bba9f75ba81a9547d359f42e31caa4.tar
ikiwiki-7a8ea68fc0bba9f75ba81a9547d359f42e31caa4.tar.gz
Consistently allow use of relative paths in all PageSpecs that take a page name parameter. Previously, match_created_before(), match_created_after(), match_sourcepage(), and match_destpage() did not support that, and the docs were not clear.
-rw-r--r--IkiWiki.pm6
-rw-r--r--IkiWiki/Plugin/conditional.pm4
-rw-r--r--debian/changelog4
-rw-r--r--doc/todo/relative_pagespec_deficiency.mdwn2
4 files changed, 16 insertions, 0 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index 892b5b5a8..4601d8590 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -1880,6 +1880,9 @@ sub match_backlink ($$;@) {
sub match_created_before ($$;@) {
my $page=shift;
my $testpage=shift;
+ my %params=@_;
+
+ $testpage=derel($testpage, $params{location});
if (exists $IkiWiki::pagectime{$testpage}) {
if ($IkiWiki::pagectime{$page} < $IkiWiki::pagectime{$testpage}) {
@@ -1897,6 +1900,9 @@ sub match_created_before ($$;@) {
sub match_created_after ($$;@) {
my $page=shift;
my $testpage=shift;
+ my %params=@_;
+
+ $testpage=derel($testpage, $params{location});
if (exists $IkiWiki::pagectime{$testpage}) {
if ($IkiWiki::pagectime{$page} > $IkiWiki::pagectime{$testpage}) {
diff --git a/IkiWiki/Plugin/conditional.pm b/IkiWiki/Plugin/conditional.pm
index 4f3577b34..7445dbdad 100644
--- a/IkiWiki/Plugin/conditional.pm
+++ b/IkiWiki/Plugin/conditional.pm
@@ -87,6 +87,8 @@ sub match_sourcepage ($$;@) {
shift;
my $glob=shift;
my %params=@_;
+
+ $glob=derel($glob, $params{location});
return IkiWiki::FailReason->new("cannot match sourcepage") unless exists $params{sourcepage};
if (match_glob($params{sourcepage}, $glob, @_)) {
@@ -102,6 +104,8 @@ sub match_destpage ($$;@) {
my $glob=shift;
my %params=@_;
+ $glob=derel($glob, $params{location});
+
return IkiWiki::FailReason->new("cannot match destpage") unless exists $params{destpage};
if (match_glob($params{destpage}, $glob, @_)) {
return IkiWiki::SuccessReason->new("destpage matches $glob");
diff --git a/debian/changelog b/debian/changelog
index 61aee299d..13ef9afed 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,10 @@ ikiwiki (3.02) UNRELEASED; urgency=low
* goodstuff: Include repolist by default. (But it does nothing until
configured with the repository locations.)
* comments: Add support for removing comments via web interface. (smcv)
+ * Consistently allow use of relative paths in all PageSpecs
+ that take a page name parameter. Previously, match_created_before(),
+ match_created_after(), match_sourcepage(), and match_destpage()
+ did not support that, and the docs were not clear.
-- Joey Hess <joeyh@debian.org> Tue, 06 Jan 2009 15:02:52 -0500
diff --git a/doc/todo/relative_pagespec_deficiency.mdwn b/doc/todo/relative_pagespec_deficiency.mdwn
index 9fdfe74b1..4500581c7 100644
--- a/doc/todo/relative_pagespec_deficiency.mdwn
+++ b/doc/todo/relative_pagespec_deficiency.mdwn
@@ -4,3 +4,5 @@ such as `bdale/blog`, you cannot do
references.
The other pagespec functions should too, where appropriate.
+
+[[done]]