blob: 1dc5db0f0a3fefe7340e83343537ae6b609619fd (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
## Wrapper around the various Local::VCS_* modules
##
## Copyright (C) 2008 Bas Zoetekouw <bas@debian.org>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of version 2 of the GNU General Public License as
## published by the Free Software Foundation.
package Local::VCS;
use Carp;
use Exporter;
use strict;
use warnings;
our @ISA = qw(Exporter);
# this is the import routine that is called when this is "used" by a program
# We implement it ourselves here to export the symbols from the
# correct module to the main program
sub import
{
# the first argument is "Local::VCS";
# shift it away, we'll specify it manually below
shift @_;
# import the symbols from the module we need...
if ( -d 'CVS' )
{
require Local::VCS_CVS;
Local::VCS_CVS->export_to_level(1, 'Local::VCS_CVS', @_);
}
# fall back to git
else
{
require Local::VCS_git;
Local::VCS_git->export_to_level(1, 'Local::VCS_git', @_);
}
}
sub new
{
if ( -d 'CVS' )
{
require Local::VCS_CVS;
shift;
return Local::VCS_CVS->new(@_);
}
# fall back to git
else
{
require Local::VCS_git;
shift;
return Local::VCS_git->new(@_);
}
}
42;
|