rcs plugin loading reorg
Move rcs plugin load to loadplugins; move duplicate rcs detection logic out of individual plugins and into loadplugins. Avoids checkconfig failing when run twice.master
parent
bb394fdae8
commit
f41448d9ca
17
IkiWiki.pm
17
IkiWiki.pm
|
@ -413,13 +413,6 @@ sub checkconfig () { #{{{
|
|||
$config{wikistatedir}="$config{srcdir}/.ikiwiki"
|
||||
unless exists $config{wikistatedir};
|
||||
|
||||
if ($config{rcs}) {
|
||||
loadplugin($config{rcs});
|
||||
}
|
||||
else {
|
||||
loadplugin("norcs");
|
||||
}
|
||||
|
||||
if (defined $config{umask}) {
|
||||
umask(possibly_foolish_untaint($config{umask}));
|
||||
}
|
||||
|
@ -456,6 +449,16 @@ sub loadplugins () { #{{{
|
|||
|
||||
loadplugin($_) foreach @{$config{default_plugins}}, @{$config{add_plugins}};
|
||||
|
||||
if ($config{rcs}) {
|
||||
if (exists $IkiWiki::hooks{rcs}) {
|
||||
error(gettext("cannot use multiple rcs plugins"));
|
||||
}
|
||||
loadplugin($config{rcs});
|
||||
}
|
||||
if (! exists $IkiWiki::hooks{rcs}) {
|
||||
loadplugin("norcs");
|
||||
}
|
||||
|
||||
run_hooks(getopt => sub { shift->() });
|
||||
if (grep /^-/, @ARGV) {
|
||||
print STDERR "Unknown option: $_\n"
|
||||
|
|
|
@ -8,9 +8,6 @@ use Encode;
|
|||
use open qw{:utf8 :std};
|
||||
|
||||
sub import { #{{{
|
||||
if (exists $IkiWiki::hooks{rcs}) {
|
||||
error(gettext("cannot use multiple rcs plugins"));
|
||||
}
|
||||
hook(type => "checkconfig", id => "bzr", call => \&checkconfig);
|
||||
hook(type => "getsetup", id => "bzr", call => \&getsetup);
|
||||
hook(type => "rcs", id => "rcs_update", call => \&rcs_update);
|
||||
|
|
|
@ -11,9 +11,6 @@ my $sha1_pattern = qr/[0-9a-fA-F]{40}/; # pattern to validate Git sha1sums
|
|||
my $dummy_commit_msg = 'dummy commit'; # message to skip in recent changes
|
||||
|
||||
sub import { #{{{
|
||||
if (exists $IkiWiki::hooks{rcs}) {
|
||||
error(gettext("cannot use multiple rcs plugins"));
|
||||
}
|
||||
hook(type => "checkconfig", id => "git", call => \&checkconfig);
|
||||
hook(type => "getsetup", id => "git", call => \&getsetup);
|
||||
hook(type => "rcs", id => "rcs_update", call => \&rcs_update);
|
||||
|
|
|
@ -8,9 +8,6 @@ use Encode;
|
|||
use open qw{:utf8 :std};
|
||||
|
||||
sub import { #{{{
|
||||
if (exists $IkiWiki::hooks{rcs}) {
|
||||
error(gettext("cannot use multiple rcs plugins"));
|
||||
}
|
||||
hook(type => "checkconfig", id => "mercurial", call => \&checkconfig);
|
||||
hook(type => "getsetup", id => "mercurial", call => \&getsetup);
|
||||
hook(type => "rcs", id => "rcs_update", call => \&rcs_update);
|
||||
|
|
|
@ -11,9 +11,6 @@ use Date::Format qw(time2str);
|
|||
my $sha1_pattern = qr/[0-9a-fA-F]{40}/; # pattern to validate sha1sums
|
||||
|
||||
sub import { #{{{
|
||||
if (exists $IkiWiki::hooks{rcs}) {
|
||||
error(gettext("cannot use multiple rcs plugins"));
|
||||
}
|
||||
hook(type => "checkconfig", id => "monotone", call => \&checkconfig);
|
||||
hook(type => "getsetup", id => "monotone", call => \&getsetup);
|
||||
hook(type => "rcs", id => "rcs_update", call => \&rcs_update);
|
||||
|
|
|
@ -7,9 +7,6 @@ use IkiWiki;
|
|||
use POSIX qw(setlocale LC_CTYPE);
|
||||
|
||||
sub import { #{{{
|
||||
if (exists $IkiWiki::hooks{rcs}) {
|
||||
error(gettext("cannot use multiple rcs plugins"));
|
||||
}
|
||||
hook(type => "checkconfig", id => "svn", call => \&checkconfig);
|
||||
hook(type => "getsetup", id => "svn", call => \&getsetup);
|
||||
hook(type => "rcs", id => "rcs_update", call => \&rcs_update);
|
||||
|
|
|
@ -6,9 +6,6 @@ use strict;
|
|||
use IkiWiki;
|
||||
|
||||
sub import { #{{{
|
||||
if (exists $IkiWiki::hooks{rcs}) {
|
||||
error(gettext("cannot use multiple rcs plugins"));
|
||||
}
|
||||
hook(type => "checkconfig", id => "tla", call => \&checkconfig);
|
||||
hook(type => "getsetup", id => "tla", call => \&getsetup);
|
||||
hook(type => "rcs", id => "rcs_update", call => \&rcs_update);
|
||||
|
|
Loading…
Reference in New Issue