summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-07-30 14:32:48 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-07-30 14:32:48 -0400
commit6c8a8dd13b96f2990f58596c7ec5e7c497b39cbe (patch)
tree4cdb03750aa6178cd43ca744106c69987ceef2eb
parent12c5786df4e74c143f24398b8d0028000b61daba (diff)
add guard against enabling multiple rcs plugins
-rw-r--r--IkiWiki/Plugin/bzr.pm3
-rw-r--r--IkiWiki/Plugin/git.pm3
-rw-r--r--IkiWiki/Plugin/mercurial.pm3
-rw-r--r--IkiWiki/Plugin/monotone.pm3
-rw-r--r--IkiWiki/Plugin/svn.pm3
-rw-r--r--IkiWiki/Plugin/tla.pm3
6 files changed, 18 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/bzr.pm b/IkiWiki/Plugin/bzr.pm
index 99025a973..e7b22f3c5 100644
--- a/IkiWiki/Plugin/bzr.pm
+++ b/IkiWiki/Plugin/bzr.pm
@@ -8,6 +8,9 @@ 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);
diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm
index 5e302729e..6f0ac56d5 100644
--- a/IkiWiki/Plugin/git.pm
+++ b/IkiWiki/Plugin/git.pm
@@ -11,6 +11,9 @@ 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);
diff --git a/IkiWiki/Plugin/mercurial.pm b/IkiWiki/Plugin/mercurial.pm
index d2c34fa6a..b05c954dc 100644
--- a/IkiWiki/Plugin/mercurial.pm
+++ b/IkiWiki/Plugin/mercurial.pm
@@ -8,6 +8,9 @@ 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);
diff --git a/IkiWiki/Plugin/monotone.pm b/IkiWiki/Plugin/monotone.pm
index 4b9be316a..a591ecec5 100644
--- a/IkiWiki/Plugin/monotone.pm
+++ b/IkiWiki/Plugin/monotone.pm
@@ -11,6 +11,9 @@ 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);
diff --git a/IkiWiki/Plugin/svn.pm b/IkiWiki/Plugin/svn.pm
index 51683704c..262fca99a 100644
--- a/IkiWiki/Plugin/svn.pm
+++ b/IkiWiki/Plugin/svn.pm
@@ -7,6 +7,9 @@ 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);
diff --git a/IkiWiki/Plugin/tla.pm b/IkiWiki/Plugin/tla.pm
index 6faaecccc..fe5965259 100644
--- a/IkiWiki/Plugin/tla.pm
+++ b/IkiWiki/Plugin/tla.pm
@@ -6,6 +6,9 @@ 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);