]> sipb.mit.edu Git - ikiwiki.git/commitdiff
rcs plugin loading reorg
authorJoey Hess <joey@kodama.kitenet.net>
Fri, 1 Aug 2008 20:02:01 +0000 (16:02 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Fri, 1 Aug 2008 20:45:05 +0000 (16:45 -0400)
Move rcs plugin load to loadplugins; move duplicate rcs detection logic out
of individual plugins and into loadplugins. Avoids checkconfig failing when
run twice.

IkiWiki.pm
IkiWiki/Plugin/bzr.pm
IkiWiki/Plugin/git.pm
IkiWiki/Plugin/mercurial.pm
IkiWiki/Plugin/monotone.pm
IkiWiki/Plugin/svn.pm
IkiWiki/Plugin/tla.pm

index 6a6e93e7ec699e250ae72b408dee21b21e39b4d9..bfa85343d26e173d6648fc9da2314a8202903629 100644 (file)
@@ -412,13 +412,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}));
@@ -455,6 +448,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) {
index e7b22f3c5c5ffb24e8c1379b4dc4399cfaf2e6f8..99025a973db235605cf64448e9ccdd04e1fc687b 100644 (file)
@@ -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);
index b683e4ec3b7fbba4b1f41c5bb7ac96c074ec2fd2..d1c1165e03c25528d1cb10d4f03e54ed890c547b 100644 (file)
@@ -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);
index b05c954dc5565433add20738f8020bd83fe4b8f9..d2c34fa6a5810c43ac999fb23184a08dab1abc76 100644 (file)
@@ -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);
index a591ecec56e3f099e6bf2cff5bc4a565f753a71f..4b9be316a4e602f5aaa075c8c62f2e8ade8e3ed2 100644 (file)
@@ -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);
index 262fca99a781e01a49eb35d440c86c648c77c5ed..51683704c5928d6e5577a3e1f92b62adbb41849f 100644 (file)
@@ -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);
index fe596525970a0be23a1fa416cfb01c966018697c..6faaecccc5d7a48a1f44e3fd40aa6376c8d8cf48 100644 (file)
@@ -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);