case with a getopt hook directly in my plugin. If the wrapper change
is safe, we won't need a wrapper wrapper.
use IkiWiki;
sub import {
use IkiWiki;
sub import {
+ hook(type => "getopt", id => "cvs", call => \&getopt);
hook(type => "checkconfig", id => "cvs", call => \&checkconfig);
hook(type => "getsetup", id => "cvs", call => \&getsetup);
hook(type => "rcs", id => "rcs_update", call => \&rcs_update);
hook(type => "checkconfig", id => "cvs", call => \&checkconfig);
hook(type => "getsetup", id => "cvs", call => \&getsetup);
hook(type => "rcs", id => "rcs_update", call => \&rcs_update);
hook(type => "rcs", id => "rcs_getctime", call => \&rcs_getctime);
}
hook(type => "rcs", id => "rcs_getctime", call => \&rcs_getctime);
}
+sub getopt () {
+ # "cvs add dir" acts immediately on the repository.
+ # post-commit gets confused by this and doesn't need to act on it.
+ # If that's why we're here, terminate the process.
+ @ARGV == 3 && $ARGV[1] eq "NONE" && $ARGV[2] eq "NONE" && exit 0;
+}
+
sub checkconfig () {
if (! defined $config{cvspath}) {
$config{cvspath}="ikiwiki";
sub checkconfig () {
if (! defined $config{cvspath}) {
$config{cvspath}="ikiwiki";
- execl("$this", "$this", NULL);
perror("exec $this");
exit(1);
}
perror("exec $this");
exit(1);
}