Commit Graph

510 Commits (d83ce25e3f1ac6600b76b938c309a061a4d8da3a)

Author SHA1 Message Date
Amitai Schlair c3b17740ae Document that last enclosure wins. 2013-02-19 20:22:47 -05:00
Amitai Schlair 0e278c4a84 Make enclosure follow WikiLink LinkingRules. 2013-02-19 20:22:46 -05:00
Amitai Schlair 45d58983d2 Rename some posts and fix wrong assumptions. 2013-02-19 20:22:46 -05:00
Amitai Schlair 546da9bac7 Make [[!meta enclosure=foo.mp3]] "work" for HTML. 2013-02-19 20:22:46 -05:00
Amitai Schlair 86df150fb0 Document that podcasts are text XOR enclosure. 2013-02-19 20:22:46 -05:00
Amitai Schlair 10b6cb6ee5 Wrap a long line. 2013-02-19 20:22:46 -05:00
Amitai Schlair c9c00b7c25 Add tests for existing podcast behavior. 2013-02-19 20:22:45 -05:00
Amitai Schlair a5fb27acb8 Bump test count for previous. 2013-02-02 14:19:50 -05:00
Amitai Schlair 91b477c087 Fix diffurl links (cvsweb expects unescaped '/'). 2013-02-02 14:11:15 -05:00
Amitai Schlair b30cacdf8d Fix longstanding bug (chdir to nonexistent dirs).
In test, set up the post-commit hook for more realism (and bugs!).
To make wrappers work in test, set PERL5LIB, and allow the wrappee's
path to be overridden. Meta-test that post-commit is really hooked
up by verifying that content is getting generated in destdir.

About the longstanding bug, which as far as I know was harmless:
CVS can't operate outside a srcdir, so we're always setting $CWD.
"local $CWD" restores the previous value when we go out of scope.
Usually that's correct. But if we're removing the last file from a
directory, the post-commit hook will exec in a working directory
that's about to not exist (CVS will prune it).

The fix: chdir() manually in cvs_runcvs(), so we can selectively
not chdir() back.
2013-01-27 22:09:57 -05:00
Amitai Schlair 64370885cc Merge branch 'master' into cvs 2013-01-25 08:47:17 -05:00
Simon McVittie 7b06a65221 If the title of a trail or trail-member changes, rebuild affected pages
If the title of a trail changes, each member of that trail must be
rebuilt, for its prev/up/next box to reflect the new title.

If the title of a member changes, its next and previous items (if any)
must be rebuilt, for their prev/up/next boxes to reflect the new title.
2013-01-02 19:19:32 +00:00
Simon McVittie 94a5130963 Add more trail regression tests
Some of these untested bits have in fact regressed, and as such, are
marked as TODO.
2013-01-02 19:19:32 +00:00
Joey Hess b485dbd891 avoid syntax checking cvs, since it needs File::Chdir, which
is not a build dep
2012-04-27 13:59:36 -04:00
Joey Hess fc5c938b19 Merge remote-tracking branch 'smcv/ready/literal-pagenames' 2012-04-08 16:02:03 -04:00
Simon McVittie 5674e7fc12 prune: do not prune beyond an optional base directory, and add a test
Previously, prune("wiki/srcdir/sandbox/test.mdwn") could delete srcdir
or even wiki, if they happened to be empty. This is rarely what you
want: there's usually some base directory (destdir, srcdir, transientdir
or another subdirectory of wikistatedir) beyond which you do not want to
delete.
2012-04-07 17:52:29 +01:00
Simon McVittie 258ee1bc3b trail, inline: treat pagenames as a list of literal names, not links 2012-04-06 17:05:26 +01:00
Joey Hess 2ad42bef5f add some seatbelts to toad's jalopy
This does not change the number of failing tests I see, but it does
make it show the expected result, which makes analysis easier.
2012-04-04 20:23:01 -04:00
Simon McVittie c7bc11f26f Use utime to make initial files in trail test come from the past
This ensures that when we do the second phase of the test (edit some
files and refresh), the changes get a different mtime and are picked up,
even if the entire test happened between two 1-second "clock ticks".
2012-03-19 09:49:31 +00:00
Simon McVittie 63bb8b42f7 Replace [[!trailinline]] directive with [[!inline trail=yes]] 2012-03-18 17:11:05 +00:00
Simon McVittie 4e54fa1144 tagging version 3.20120202
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIVAwUATytJp8kQ2SIlEuPHAQgKeg/+MPL9KcL13f1DQUwu9TXEr7hSocn3NTa/
 LMvLJvrzqI5BGRP+jBGFG/Kn9yFt6S4gdCvpOwi1INxAanLQnaVoSLoie1teUbU3
 dxi8f3wGMBtEX+BiOi9gbjxF2v98D+Fh73O9H7newsEJiRDRor7U4EE1dWC8uidc
 d/9vhWkaDy1BlEahaU85v7RY94h5EnEzgD0Rm7wkSSr1aquQsr89OijC6SY0dEJe
 b6AunkRqsOGDrm6elSRFi6E5eStPhIu2t6GmyhpulWn5vr4PyqdWZ7jcWvDGYr+r
 v2iuses1fH8qWE1CQ6Y2XadK7Cj2IbGhaiLXp3TdbPgKnB7BS89cSWRKQ5SlvTlJ
 sUUPauhLDMqp1Cux6oUgs5T9ADTO922p1FzR3JuTkgwNLWH7UXTRuwVvtPz4aKqN
 QBmQeknTTQAxqi+DhgBK+CXM7LIt3d2TaoUFt6gl4kKt3FYzGfyh9ohhDSQniAa8
 C52InJ2X5bamz8/fIcELChg+wBT+naQrDW7V74kFKvWzIwnqfvseaF3zVqDgYLQy
 e12vL6GAdnO66VhzULU1NyH/XNvfyKEpwiKHPwCEK5wPTLweWBqjU0952GDBlUov
 PDDoQgwijnSCSxJOcEsAnnpkT16pw0VWHTSLrqkYYZBg7WGkZbhwk4cRVkqcsMK7
 JjKUdA9rK0E=
 =KLr6
 -----END PGP SIGNATURE-----

Merge tag '3.20120202' into trail3-integrated
2012-03-18 15:31:41 +00:00
Amitai Schlair 37bf6114d5 Notes. 2012-02-05 16:35:29 -05:00
Amitai Schlair e45175d545 More testings and fixings:
* Test that adding a text file under a name formerly tracked as
  binary (and vice versa) gets the right keyword-substitution
  behavior.
* Explicitly set -kkv for text files to make the tests pass.
* CVS warns in these cases about "changing keyword expansion mode",
  but this is correct behavior, so filter it from stderr. Filter
  stdout the same way in case we ever want to keep any of it.
* In rcs_add(), replace comments with obviousness.
2012-02-05 16:33:49 -05:00
Amitai Schlair 414ccfb1e2 Remember to run all the tests before committing! 2012-02-05 03:33:20 -05:00
Amitai Schlair 4e7b7a1788 Test checkconfig(). 2012-02-05 03:29:14 -05:00
Amitai Schlair 4b596ea5c6 Test RCS Id keyword expansion on typical commit. 2012-02-05 01:34:58 -05:00
Amitai Schlair 0a05ac9205 Notes from an evening's debugging. 2012-02-05 01:24:09 -05:00
Amitai Schlair 6753235d98 Write rcs_diff() tests according to the API spec, then make them pass. 2012-02-05 01:20:52 -05:00
Amitai Schlair a65512ad18 Update test plan, missed in previous. 2012-02-01 22:08:21 -05:00
Amitai Schlair fc316b9da1 Express rcs_recentchanges() tests via utility functions, in preparation
for writing more thorough tests, in order to safely extract the
cvsps output-parsing routine for reuse by an upcoming rcs_revert().
2012-02-01 15:17:57 -05:00
Amitai Schlair b0d97cd20e Fail a test if an rcs_receive() hook is ever defined for CVS. 2012-02-01 11:04:37 -05:00
Amitai Schlair 1d176f23d2 Extract add_and_commit(), a common test action. 2012-02-01 11:04:15 -05:00
Amitai Schlair ac8eab29e8 Uncomment the CVS keyword substitution mode tests, and make them pass:
Extract cvs_keyword_subst_args() and ensure it runs in $config{srcdir}.
Using Perl's -T operator appears to work equally well, perhaps switch?
2012-01-26 16:57:00 -05:00
Amitai Schlair 1b73015251 Move tests that simulate web commits into test_rcs_add(), then add
a bunch more tests (that wind up exercising rcs_commit(),
rcs_commit_staged(), and rcs_recentchanges()). Extract some support
routines for brevity. Most is_in_keyword_substitution_mode() tests
are commented out because there's a bug -- non-binary files are
being added with "cvs add -kb".

Move tests that inspect recentchanges after direct CVS operations
into test_rcs_recentchanges().
2012-01-24 05:58:41 -05:00
Amitai Schlair ad0e56cdca Define required programs and modules at top for easy spotting. 2012-01-22 11:07:58 -05:00
Amitai Schlair 8e99750545 No functional change: sort sub definitions.
In the code:
* general plugin API calls (in plugins/write order),
* VCS plugin API calls (in plugins/write order), then
* internal support routines (in alphabetical order).

In the tests:
* general meta-behavior (in no particular order, yet),
* general plugin API calls (in plugins/write order),
* VCS plugin API calls (in plugins/write order), then
* internal support routines (in semi-logical order).
2012-01-22 10:44:50 -05:00
Amitai Schlair ea04eb4102 Test::Class runs test subs in alphabetical order, so we do too. 2012-01-22 10:44:50 -05:00
Amitai Schlair 88b08b5835 Ape xUnit more closely to remove ordering constraints on test subs:
* Add setup and teardown methods, called before and after every test sub.
* In setup, make a fresh repo; in teardown, throw it out.
* Extract runtests method and define default test methods at top.
* Move reflection routines near the xUnit-style subs they support.

Adapt existing test subs to run independently:
* In test_manual_add_and_commit(), assume a fresh repo.

While here, plan a bit better:
* Check for all modules used by cvs.pm.
* Check for program existence more generally.
* Check that we can rmdir after mkdir.
2012-01-22 10:44:50 -05:00
Amitai Schlair 1ea4949257 Describe the needed test cases, and implement a couple Test::Class features.
* Run all subs matching /^test_*/ (for which we can plan)...
* Unless TEST_METHOD is set, in which case run matching subs (sans plan).
* Define total number of tests very near 'use Test::More', where expected.
* Define test tempdir where it's declared, no longer any reason why not.
* Move most comments from TODO.cvs into t/cvs.t.
* Add a whole bunch more comments describing the needed test cases.

XXX existing tests are order-dependent, but currently happen to pass
2012-01-22 10:44:49 -05:00
Amitai Schlair 3497f49f35 Fix regression: failing to make the temp dir should nix the test plan.
While here, nitpick style and wrap long lines.
2012-01-22 10:44:49 -05:00
Amitai Schlair 0b7d5aeeb6 Use config parameters directly and shorten long lines. 2012-01-22 10:44:49 -05:00
Amitai Schlair d760df3821 * Define expected number of tests near the top.
* Call readfile() directly from writefile().
* Parameterize commit message for the web-commit case.
* Describe intent of test cases.
* Rename test subs to match what they actually do.
* To prove extra path slashes don't cause trouble, instead of running
  the same tests a second time, just assert that checkconfig()
  strips the slashes.
2012-01-22 10:44:49 -05:00
Amitai Schlair b77da0bb3b Fix a typo in the web commit test. 2012-01-22 10:44:49 -05:00
Amitai Schlair f18160b95d Simplify startup: use Test::More unconditionally, then determine
the test plan at runtime. Use IkiWiki unconditionally too (as that's
not what I'm testing here) to avoid the TAP error of printing a
test result before having printed the plan.
2012-01-22 10:44:49 -05:00
Amitai Schlair f98c4c5b72 Extract subs: startup/shutdown, and tests for web and manual commits.
No functional change intended.
2012-01-22 10:44:49 -05:00
Joey Hess 37f7f125f9 fix test suite to work with discount
In the first test, discount returns the html attributes in a different
order, which broke the test. Test only for the important text, not the
exact html output.

In the second test, discount does some encoding of its own of the partially
encoded url, again resulting in different output.
2012-01-01 17:28:31 -04:00
Simon McVittie ea313b8133 Add path and path_natural sort orders
These correspond to title and title_natural, but compare the entire
path: a < a/b < a/z < ab < b.
(cherry picked from commit 903a5a314f)
2011-12-06 14:26:34 -04:00
Simon McVittie d70ba7cff3 Split trail directive into trailitems, trailoptions 2011-11-12 21:37:28 +00:00
Simon McVittie e0bfd0cafd trail: improve and test sorting 2011-11-12 16:57:54 +00:00
Simon McVittie 903a5a314f Add path and path_natural sort orders
These correspond to title and title_natural, but compare the entire
path: a < a/b < a/z < ab < b.
2011-11-12 16:02:20 +00:00
Simon McVittie 156f709122 trail: new plugin (3rd attempt) 2011-11-09 22:49:37 +00:00
Simon McVittie bc6bef9c56 Add a trivial test for the rst plugin
Signed-off-by: Simon McVittie <smcv@debian.org>
2011-10-22 19:46:42 +01:00
Joey Hess f774f20913 Fix comments testsuite to not rely on Date::Parse's ability to parse the date Columbus discovered America. Closes: #640350
This is such a pity. smcv had these great dates, but squeeze's Date::Parse
cannot parse them.

Oh well, at least it makes for a great bug closure title.
2011-09-05 13:17:36 -04:00
Simon McVittie 94268a46cd comments: add regression test for sorting by date 2011-06-04 16:55:24 +01:00
Joey Hess 70e7bee1a0 Merge remote-tracking branch 'intrigeri/po-long-language-codes' 2011-06-03 12:32:37 -04:00
Joey Hess dac4f405b2 the underlying perl bug that this test case checks a workaround for has now been fixed
hurrah! Thanks especially to Niko Tyni for tracking it down in the perl
internals.
2011-05-31 16:21:58 -04:00
intrigeri 3cd0c1f91a po: support language codes in the form of 'es_AR', and 'arn'.
... additionally to the previously supported two-letters codes.
2011-05-26 09:39:50 +02:00
Timo Paulssen 8e120bf718 added test cases for heredoc and triple-single. 2011-05-13 11:24:16 -04:00
Timo Paulssen 505439cc0a simple tests for heredoc. 2011-05-13 11:24:16 -04:00
Ludwig Nussel 9ef5139918 get rid of diag explain again 2011-03-04 11:23:10 -04:00
Joey Hess 9d548239a9 turn off verbose
Want to avoid debug messages during tests
2011-02-09 14:11:29 -04:00
Joey Hess a68c191f9f fix test count 2011-02-09 14:11:14 -04:00
Joey Hess 8e8311718a Merge remote branch 'smcv/ready/transient-tag'
Conflicts:
	t/tag.t
2011-02-09 14:11:06 -04:00
Joey Hess b522d8cdda Merge remote branch 'smcv/ready/transient-autoindex' 2011-02-09 14:00:59 -04:00
Joey Hess db9f2b1b2b Merge remote branch 'smcv/ready/tag-test' 2011-02-09 13:47:39 -04:00
Joey Hess b4d2910dda clean up t/tmp 2011-01-24 19:58:51 -04:00
Joey Hess 6e96b5921a remove more test diag stuff that needs a newer Test::More than debian stable's 2011-01-24 17:23:58 -04:00
Simon McVittie 5a73ed82cf autoindex test: write autoindex pages into the transient underlay 2011-01-22 22:39:45 +00:00
Simon McVittie 059259ecd1 Allow autoindex files to be written into the transient underlay
As with the tag plugin, for the moment keep the old behaviour in the test.
2011-01-22 22:36:41 +00:00
Simon McVittie 8ee9eabb1c autoindex: stop tracking deletions, use generic autofile tracking instead
- Migrate the set of deletions to the {autofile} set, since it has
  more or less the same effect. This affects the "deleted" case in the
  test.
- If a page has just been deleted, add it as an autofile anyway: by
  the time gen_autofile is called, it'll be in the list of deleted files,
  so it'll just be added to {autofile}. This affects the "gone" case
  in the test.
- Behaviour change: we don't forget that a page with no reason to be
  re-created was deleted. This affects the 'expunged' and 'reinstated'
  cases in the test.
2011-01-22 22:28:50 +00:00
Simon McVittie db029393f6 autoindex.t: check that none of the files that shouldn't be generated are autofiles 2011-01-22 22:27:04 +00:00
Simon McVittie dca6679a54 autoindex: use add_autofile
This does cause a minor regression: index pages are now committed
individually rather than being a single commit per rebuild.

This also means the autoindex regression test needs to trigger the
autofile generation pass.
2011-01-22 22:25:48 +00:00
Simon McVittie 0118479c9a autoindex.t: check that attachments cause indexing 2011-01-22 22:23:50 +00:00
Simon McVittie e15e6cce6c autoindex test: check that an internal page doesn't cause indexing 2011-01-22 22:22:48 +00:00
Joey Hess 0e224058e7 Adapt autoindex test suite to work with old Test::More. 2011-01-22 11:00:57 -04:00
Simon McVittie f695bdd843 tag test: write tag pages into the transient underlay 2011-01-07 20:11:19 +00:00
Simon McVittie 2a60cda172 tag: optionally write autocreated tags to the transient underlay
For the moment, have the tag test keep the old behaviour.
2011-01-07 20:09:52 +00:00
Simon McVittie eeb0ec1862 tag test: assert that the only autofiles are the ones we want 2010-12-28 13:41:59 +00:00
Simon McVittie be6ca4c4e9 po test: add more cases, including (semi-)absolute URLs
Three cases are sub-optimal, but having fixed urlto(''), they all
basically work.
2010-12-25 22:54:54 +00:00
Simon McVittie f328a2eab2 po: test beautify_urlpath with po_link_to=current
Same behaviour as 'default'.
2010-12-25 22:54:54 +00:00
Simon McVittie fbb354d70e urlto.t: test urlto('', undef, ?) 2010-12-25 22:54:54 +00:00
Simon McVittie 524a78eaca urlto.t: test more cases, including the special case for to='' 2010-12-25 22:54:54 +00:00
Simon McVittie 44cc8ca420 Add a test for autoindex's current functionality 2010-12-25 22:54:54 +00:00
Simon McVittie 4ca0eb2743 extend the 'tag' test to cover auto-creation of tag pages 2010-12-25 22:54:54 +00:00
Joey Hess 340ac56729 test w/o second parameter 2010-11-29 15:01:35 -04:00
Simon McVittie 70bdd57899 Add a regression test for urlto, baseurl and cgiurl in relative/local/absolute modes 2010-11-22 23:47:05 +00:00
Joey Hess fcf0ee574a add test case for RSS url munging 2010-11-16 16:48:42 -04:00
Joey Hess 2df92a956a Fix test suite failure on other side of date line. 2010-09-29 11:58:45 -04:00
Joey Hess 78e89acf37 update test 2010-09-15 15:38:06 -04:00
Joey Hess 82f9be0960 add test case for link(.) with omitted location 2010-08-30 15:27:06 -04:00
Joey Hess 2ec5efcd6c t/bazaar.t: Work around bzr 2.2.0's new requirement to configure bzr whoami before committing. 2010-08-30 15:23:22 -04:00
Joey Hess 931036eb5c Merge remote branch 'intrigeri/po' 2010-08-30 14:47:57 -04:00
Joey Hess 7d1cc3a020 add test for link(.) 2010-08-30 13:35:50 -04:00
intrigeri e85c15e75b Merge remote branch 'upstream/master' into prv/po 2010-08-22 11:09:37 +02:00
intrigeri 474b6524e0 Merge remote branch 'upstream/master' into prv/po 2010-08-22 11:05:03 +02:00
Joey Hess 7d29ba2fc7 add htmlscrubber colon in url cases to test suite 2010-08-19 14:04:55 -04:00
Joey Hess 5664401fbc Fix po test suite to not assume ikiwiki's underlay is already installed. Closes: #593047 2010-08-15 11:38:39 -04:00
intrigeri 38460076e1 po.t: added a bunch of tests for recent code changes 2010-08-02 15:11:44 +02:00
Joey Hess 52f09a63a1 Merge remote branch 'intrigeri/po' 2010-07-24 05:22:33 -04:00
Joey Hess 855fad15e5 whitespace 2010-07-23 14:30:15 -04:00
intrigeri d98296d1db po.t: fix expected results
As index.{es,fr} don't exist, po::refreshpofiles copies them from the basewiki
underlay before running msgmerge. msgmerge marks as obsolete the translation
strings that came from the basewiki po files, but the link plugin
does not make the difference between obsolete and up-to-date links.

$links{'index.fr'} and $links{'index.es'} are therefore expected to contain
SandBox and ikiwiki.
2010-07-20 13:41:53 +02:00
intrigeri c66fae8b16 Added tests for po::pofiles. 2010-07-20 13:39:47 +02:00
intrigeri 38014f0cad Run checkconfig after loading the po plugin, else state is not populated.
The pofiles function relies on @slavelanguages to have been populated by po's
checkconfig hook.
2010-07-20 13:27:17 +02:00
Joey Hess 1dbb2632ef another class of conflicts: subdir/file conflicts 2010-07-18 17:16:39 -04:00
Joey Hess d6cb4436bd 2 more cases 2010-07-18 16:45:44 -04:00
Joey Hess 773db5a35e avoid error if two source files render the same destination file
There are two sub-caces. If both source files still exist, the winner that
renders the destination file is undefined. If one source file is deleted
and the other added, in a refresh, the new file will take over the
destination file.
2010-07-18 16:28:39 -04:00
Joey Hess a291f24be6 some other (similar) failure cases 2010-07-18 13:50:06 -04:00
Joey Hess bfa4660df7 update 2010-07-17 13:30:08 -04:00
Joey Hess 4142308429 turning into complete source file conflict test suite 2010-07-17 13:24:40 -04:00
Joey Hess fd842e03e6 add 2 failing test cases 2010-07-16 16:11:24 -04:00
Joey Hess 936dc6fc8e add test of file replace 2010-07-16 16:07:51 -04:00
Joey Hess 1f6ea9a626 clean up messages about unavailable vcs programs 2010-06-25 00:30:12 -04:00
Joey Hess ecdfd1b864 rcs_commit and rcs_commit_staged api changes
Using named parameters for these is overdue. Passing the session in a
parameter instead of passing username and IP separately will later allow
storing other session info, like username or part of the email.

Note that these functions are not part of the exported API,
and the prototype change will catch (most) skew, so I am not changing
API versions. Any third-party plugins that call them will need updated
though.
2010-06-23 19:04:36 -04:00
Joey Hess f8c2a67b3c pretty openid login
* openid: Incorporated a fancy openid-selector signin form.
  (http://code.google.com/p/openid-selector/)
* openid: Use "openid_identifier" as the form field, as required
  by OpenID Authentication v2.0 spec.
2010-05-07 20:14:25 -04:00
Joey Hess 81948abda7 remove bogus test for empty page 2010-05-05 22:47:37 -04:00
Joey Hess 57405061f4 add test 2010-05-05 22:12:31 -04:00
Joey Hess 9257381e8d fix test count 2010-05-05 18:32:48 -04:00
Joey Hess 34afaf1015 add test suite for find_src_files 2010-05-04 23:20:47 -04:00
Joey Hess a6d38b7f26 update test suite for recent index load on rebuild changes 2010-04-26 19:01:31 -04:00
Joey Hess 3ac2ae1f14 Add page() PageSpec, which is like glob() but matches only pages, not other files. 2010-04-26 18:47:17 -04:00
Joey Hess 9b112cc986 add test case to ensure all templates are documented 2010-04-23 17:23:31 -04:00
Joey Hess ef34ea7c05 fix test cases for dynamic influence calculation 2010-04-22 00:07:25 -04:00
Joey Hess c98414e192 added a test case for this bug
Further analysis suggests fixing this might not be as dreadful as I first
thought!
2010-04-21 23:08:54 -04:00
Joey Hess 13325317a3 backlink influence data seems ok 2010-04-21 22:04:03 -04:00
Joey Hess cff3937b68 remove 2 argument form of file_pruned 2010-04-20 14:08:29 -04:00
Joey Hess a97964688b unfinished file_prune revamp
Many calls to file_prune were incorrectly calling it with 2 parameters.
In cases where the filename being checked is relative to the srcdir,
that is not needed.

Made absolute filenames be pruned. (This won't work for the 2 parameter call
style.)
2010-04-17 19:05:40 -04:00
Jelmer Vernooij 9ff5174f11 Fix get_ctime implementation in Bazaar plugin, add get_mtime implementation. 2010-04-17 13:52:16 -04:00
Joey Hess f5da8d3aed more tests with more items 2010-04-12 15:16:57 -04:00
Joey Hess 0bfc364a7d optimization: pagespec_match_list with no num limit matches before sorting
This can be a lot faster, since huge numbers of pages are not sorted
only to mostly be thrown away. It sped up a build of my blog by at least
5 minutes.
2010-04-11 01:30:03 -04:00
Joey Hess 1004e6c739 fix testsuite
typedlink matchspec was removed
2010-04-10 14:40:03 -04:00
Joey Hess bab8fec524 Merge remote branch 'smcv/ready/sort-package'
Conflicts:
	debian/NEWS
2010-04-06 23:15:33 -04:00
Simon McVittie cb8b2f80b2 Use $a and $b for SortSpec cmp callbacks 2010-04-05 22:50:51 +01:00
Simon McVittie d7e32dc98d Add a unit test for changed-link calculation 2010-04-04 01:20:02 +01:00
Simon McVittie ef63441440 Remove tagged_is_strict option, and just behave as though it was enabled
Jon was worried about the backwards-compatibility break involved in making
tagged() not match non-tag links, but Joey seems less concerned about it.
2010-04-04 00:43:58 +01:00
Simon McVittie c1a42e76bc implement typed links; add tagged_is_strict config option 2010-04-04 00:43:48 +01:00
Simon McVittie 04a59b3c65 Move sort hooks to the IkiWiki::SortSpec namespace
Also rename cmpspec_translate (internal function) to sortspec_translate
for consistency.
2010-04-03 14:28:21 +01:00
Joey Hess 0d524ad672 Fix incorrect influence info returned by a failing link() pagespec, that could lead to bad dependency handling in certian situations. 2010-03-26 01:38:53 -04:00
Simon McVittie b86276ffed Reimplement extensible sorting mechanisms, in the same way as pagespecs 2010-03-25 23:31:53 +00:00
Simon McVittie 60edd2dc31 Allow sorting to be combined and/or reversed 2010-03-24 23:51:48 +00:00
Simon McVittie e67a9382f6 Allow hooks to add sorting functions to pagespec_match_list 2010-03-24 00:29:10 +00:00
Joey Hess 87a36bbb46 update 2010-03-14 15:22:45 -04:00
Joey Hess c0ad4929de Improve openid url munging; do not display anchors and cgi parameters, as used by yahoo and google urls. 2010-03-13 20:10:50 -05:00
Joey Hess b3c3c42b26 Loosen regexp, to allow empty quoted parameters in directives. 2010-02-26 11:49:51 -05:00
Joey Hess 6f3641f16c add some openid matching tests 2010-02-11 22:42:24 -05:00
Joey Hess c923e0ba33 Allow globs to be used in user() pagespecs. 2010-02-11 20:39:10 -05:00
Joey Hess 01c0f533de fix test suite after bestlink change 2009-11-30 18:05:47 -05:00
Joey Hess 96729cafc3 override LC_ALL, not LANG 2009-10-15 14:26:06 -04:00
Joey Hess 7ba4fa760a build wiki in C locale, to ensure that the "no broken links" message is not translated 2009-10-14 13:19:44 -04:00
Joey Hess 57a135c92a abort test if cvs prereq perl modules are not available 2009-10-14 13:15:12 -04:00
Joey Hess c916dcd035 fix some broken influence blocking testing, add more tests 2009-10-13 14:58:22 -04:00
Joey Hess 2f5beb59bf tests for influence blocking 2009-10-13 14:46:38 -04:00
Joey Hess 139085b3f2 add some TODO tests for influence blocking 2009-10-11 23:53:21 -04:00
Joey Hess 51d8899515 influences returns hash ref now 2009-10-11 19:13:40 -04:00
Joey Hess 04d0a72c09 typo 2009-10-11 19:05:37 -04:00
Joey Hess 5dba91cdc8 typo 2009-10-11 13:51:23 -04:00
Joey Hess ba00fb319c update 2009-10-09 21:23:39 -04:00
Joey Hess 6d6fff8d87 added tests of SuccessReason/FailReason objects 2009-10-09 21:12:14 -04:00
Joey Hess 9eb229bfc7 move influence tests to pagespec_match_list.t 2009-10-09 14:05:22 -04:00
Joey Hess b7351daacd conditional: use yesno 2009-10-09 12:54:35 -04:00
Joey Hess 34b2132355 fix test to use new calling convention
This test still fails several cases, since add_depends influence testing is
currently commented out.
2009-10-09 00:06:58 -04:00
Joey Hess 5e7b2dea84 rename use_pagespec to pagespec_match_list
To avoid breaking plugins, also support the old pagespec_match_list
calling convention, with a deprecation warning.
2009-10-08 23:51:06 -04:00
Joey Hess 955bcea2a7 fix test broken by change to failing link() influence 2009-10-08 23:48:08 -04:00
Joey Hess d5f0144495 use_pagespec: do not fail with error when unable to match, unless it fails
with an ErrorReason
2009-10-08 18:47:48 -04:00
Joey Hess 5e236f5d25 add use_pagespec and deptype functions 2009-10-08 17:53:20 -04:00
Joey Hess 5f9860e65c add type info to influence information 2009-10-07 21:52:37 -04:00
Joey Hess bb389a5ae2 convert add_depends to use influences
No more horrible special-case pagespec parsing.

OTOH, matching over all pages to determine influences is a lot of work.
2009-10-07 21:17:57 -04:00
Joey Hess 54fb82a5a4 more influences tests 2009-10-07 20:35:26 -04:00
Joey Hess 4002d7c1a4 add influence info to match_*
Also update docs, test suite.
2009-10-07 20:31:13 -04:00
Joey Hess c72fda7d69 make success and failreason objects carry an influences hash
The hash will be used used to record a set of pages that influenced the
result of a pagespec match.

The influences are merged together when boolean and/or are encountered
in a pagespec. That means using a non-short-circuiting OR operator. And
so I use & and | when translating pagespecs, since those bitwise operators
can be overloaded. ("and" and "or" cannot, apparently).
2009-10-07 19:59:26 -04:00
Joey Hess 7a8b492bcc add_depends should default to content dependencies if unknown type specified 2009-10-06 19:07:52 -04:00
Joey Hess 62cc2afcaa update to test backlinks() pagespecs 2009-10-06 18:44:34 -04:00
Joey Hess 36c605cada add test suite for add_depends
and found a bug in my bitmath..
2009-10-04 23:27:00 -04:00
Joey Hess b94c1ccd55 fix CVS prune test
The regexp only matches things inside the CVS directory, not
just "CVS" by itself. I changed the test to not test that it will be
pruned.
2009-09-13 19:40:42 -04:00
Joey Hess e22af796e5 skip if cvsps is not available 2009-09-10 16:49:54 -04:00
Amitai Schlair 98553d1537 CVS operations generally need to be within CVS checkouts, so these chdir()
calls are warranted. They shouldn't modify the caller's working directory,
though. Use File::chdir to keep the scope of the changes subroutine-local.
The tests now pass without resetting the working directory.
2009-09-10 00:51:34 -04:00
Amitai Schlair 12bbc6c919 Add automated tests, modeled after svn's. Note the chdir() calls;
perhaps cvs.pm should be doing pushd/popd in case the caller expects
its working directory to be left alone.
2009-09-09 23:09:26 -04:00
Amitai Schlair c36d2fa896 Merge branch 'master' of git://github.com/joeyh/ikiwiki 2009-08-30 03:02:15 -04:00
Simon McVittie 1ea8580a5f Remove now-unused function pagespec_merge
Now that dependencies are a list of pagespecs with an implicit "or"
operation, there's no need to try to merge pagespecs under normal use.

ikiwiki-transition contains the only use of the function, so move
it there rather than deleting it entirely (it's used to concatenate all
admins' lists of locked pages).
2009-08-25 00:31:40 +01:00
Simon McVittie 7227c2debf Use a hash to de-duplicate dependencies 2009-08-25 00:31:16 +01:00
Simon McVittie fe4f176f72 Optimize the dependencies list
On a large wiki you can spend a lot of time reading through large lists
of dependencies to see whether files need to be rebuilt (album, with its
one-page-per-photo arrangement, suffers particularly badly from this).

The dependency list is currently a single pagespec, but it's not used like
a normal pagespec - in practice, it's a list of pagespecs joined with the
"or" operator.

Accordingly, change it to be stored as a list of pagespecs. On a wiki
with many tagged photo albums, this reduces the time to refresh after
`touch tags/*.mdwn` from about 31 to 25 seconds.

Getting the benefit of this change on an existing wiki requires a rebuild.
2009-08-24 23:18:10 +01:00
Amitai Schlair 2b7a003794 Add my CVS plugin and related patches. 2009-08-13 16:56:26 -04:00
Joey Hess 68fa7b5f8c use underlay_install as optimisaton 2009-07-21 13:16:59 +02:00
Joey Hess ec965fc92c Merge branch 'master' into po
Conflicts:
	debian/changelog
2009-07-19 12:36:01 +02:00
Joey Hess 5418385336 Optimise use of gettext, and avoid ugly warnings if Locale::gettext is not available.
The test suite was emitting a lot of ugly gettext warnings;
setting LC_ALL didn't solve the problem for all locale setups
(since ikiwiki remaps it to LANG, and ikiwiki didn't know about
the C locale).

People also seem generally annoyed by the messages when
Locale::Gettext is not installed, and I suspect will be
generally happier if it just silently doesn't localize.

The optimisation came about when I noticed that the gettext
sub was doing rather a lot of work each call just to see
if localisation is needed. We can avoid that work by caching,
and the best thing to cache is a version of the gettext sub
that does exactly the right thing.

This was slightly complicated by the locale setting,
which might need to override the original locale (or lack
thereof) after gettext has been called. So it needs to invalidate
the cache in that case. It used to do it via a global variable,
which I am happy to have also gotten rid of.
2009-06-08 18:33:54 -04:00
intrigeri 86edd73d16 Merge commit 'upstream/master' into pub/po
Conflicts:

	debian/changelog
	debian/control

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-06-06 14:03:40 +02:00
Joey Hess 763f4b91da add test case for unterminated """ string
A directive that contains an unterminated """ string should not
cause each word of the string to be treated as a bare word. Instead,
the directive should fail to parse.

There are two tests. One just checks that a complete directive
containing such a string fails to parse. The other checks for a case
where a directive ends with a very long unterminated """ string,
and the directive is itself not closed. While this test won't fail,
it does trigger a nasty perl warning.
2009-06-05 16:10:08 -04:00
Joey Hess fd7db49f94 Fix test suite to not rely on an installed copy of ikiwiki after underlaydir change. Closes: #530502 2009-05-25 12:40:40 -04:00
Joey Hess e92c6722dd stop using perl -T here
See bug #411786. Perl's random corruption of the taint flag is even effecting
the untainting of source filenames now (which AFAICS, is a proper untaint
and always worked before..), and that makes using ikiwiki in perl taint
mode not work at all.
2009-05-22 13:27:23 -04:00
Joey Hess bcf3f9091a add test case for multiline pagespec 2009-05-21 12:44:21 -04:00
Joey Hess ef003f48f4 Merge branch 'master' into po
Conflicts:
	debian/changelog
2009-05-19 13:07:47 -04:00
Joey Hess 23a4ee6d15 Allow curly braces to be used in pagespecs
And avoid a whole class of potential security problems (though
none that I know of actually existing..), by avoiding
performing any string interpolation on user-supplied data when translating
pagespecs.
2009-05-18 15:25:10 -04:00
intrigeri 4558457402 Merge commit 'upstream/master' into pub/po
Conflicts:

	debian/changelog
	debian/control
2009-04-20 12:21:18 +02:00
Joey Hess 8a11983946 Fix git test suite to use a bare repo.
This works around an enormous (and, in this context, enormously confusing)
message that git has begun to print when one attempts to push changes into
a non-bare repo.

As a bonus, it now tests whether ikiwiki-makerepo works.
2009-04-04 14:58:34 -04:00
intrigeri ae474d8e14 Merge commit 'upstream/master' into prv/po
Conflicts:

	IkiWiki/Plugin/editpage.pm
	debian/control
	debian/copyright
	doc/todo/need_global_renamepage_hook.mdwn

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-03-08 09:50:27 +01:00
Joey Hess 66dc253437 Add noextension parameter to htmlize hooks to support, eg, Makefile. 2009-02-19 18:38:45 -05:00
Joey Hess 9ecb0036a3 add keepextension tests 2009-02-19 18:31:57 -05:00
Joey Hess c1907ded87 fix pagename, pagetype tests
Put tests in right file.

Set internal variable to hash, the functions expect that.
2009-02-19 18:28:43 -05:00
Joey Hess 8c8b18935b fix pagetype test
File had wrong name, and made wrong assumption about what pagetype does for
bare files.
2009-02-19 18:23:40 -05:00
Joey Hess 3b83e52018 rename apache404 -> 404
This may already work with other web servers that have copied apache's
interface, and it should be easy to add support to it for web servers that
use some other interface. So, make the name more general.
2009-01-31 19:26:36 -05:00
Simon McVittie 46b880f839 Split apache404 into an independent plugin
Also make it ignore the 'do' parameter at Joey's suggestion, to have one
less thing to remember when configuring.
2009-01-31 22:32:10 +00:00