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.
Merge branch 'master' into cvs
trail: Avoid massive slowdown caused by pagetemplate hook when displaying dynamic cgi pages, which cannot use trail anyway. This seemed to be due to the pagetemplate hook calling prerender. I've observed this making it take *minutes* for the signin page to be displayed. ltracing ikiwiki showed it was matching pagespecs a lot. It may be that this is still a speed pain point when rendering pages, not just for CGI. So more work may be needed here.
trail: remove excess presence-dependencies Since trail members are explicitly rebuilt if the information used for their prev/up/next boxes changes, they don't need another dependency on the trail itself. (If the trail disappears, it will disappear from the member's member_to_trails entry, causing a rebuild; so the add_depends is redundant.) Similarly, since trail members are explicitly rebuilt if their next or previous item, or its title, changes, the presence dependencies on the next and previous items are redundant.
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.
trail: call prerender from build_affected In the unlikely event that the ordered contents of a trail have changed without the TRAILS or TRAILLOOP template variables being evaluated (for instance, all trail directives are removed from a former trail that uses a custom pagetemplate that doesn't contain TRAILS), we might get here without having already called prerender.