line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package File::Find::Object::Rule::VCS; |
2
|
|
|
|
|
|
|
$File::Find::Object::Rule::VCS::VERSION = '0.0.4'; |
3
|
|
|
|
|
|
|
|
4
|
2
|
|
|
2
|
|
106957
|
use 5.008; |
|
2
|
|
|
|
|
20
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
14
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
43
|
|
7
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
66
|
|
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
1201
|
use UNIVERSAL; |
|
2
|
|
|
|
|
28
|
|
|
2
|
|
|
|
|
8
|
|
10
|
2
|
|
|
2
|
|
67
|
use Carp (); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
40
|
|
11
|
2
|
|
|
2
|
|
474
|
use Text::Glob 0.08 (); |
|
2
|
|
|
|
|
937
|
|
|
2
|
|
|
|
|
51
|
|
12
|
2
|
|
|
2
|
|
613
|
use File::Find::Object::Rule (); |
|
2
|
|
|
|
|
28497
|
|
|
2
|
|
|
|
|
70
|
|
13
|
|
|
|
|
|
|
|
14
|
2
|
|
|
2
|
|
17
|
use vars qw{@ISA @EXPORT}; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
130
|
|
15
|
2
|
|
|
2
|
|
17
|
use parent 'File::Find::Object::Rule'; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
17
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
my $FFOR = 'File::Find::Object::Rule'; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# In some Windows SVN implementations, it uses _svn instead of |
20
|
|
|
|
|
|
|
# .svn, so use both on Win32. |
21
|
|
|
|
|
|
|
my @svn = ($^O eq 'MSWin32') ? ('.svn', '_svn') : ('.svn'); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
##################################################################### |
24
|
|
|
|
|
|
|
# File::Find::Object::Rule Method Addition |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub File::Find::Object::Rule::ignore_vcs { |
28
|
4
|
|
|
4
|
0
|
1200
|
my $find = $_[0]->_force_object; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
# Handle special cases |
31
|
4
|
50
|
|
|
|
32
|
unless ( @_ ) { |
32
|
|
|
|
|
|
|
# Logically combine all the ignores. This will be much |
33
|
|
|
|
|
|
|
# faster than just calling them all one after the other. |
34
|
0
|
|
|
|
|
0
|
return $find->or( |
35
|
|
|
|
|
|
|
$FFOR->name(@svn, '.bzr', '.git', 'CVS')->directory->prune->discard, |
36
|
|
|
|
|
|
|
$FFOR->name(qr/^\.\#/)->file->discard, |
37
|
|
|
|
|
|
|
$FFOR->new, |
38
|
|
|
|
|
|
|
); |
39
|
|
|
|
|
|
|
} |
40
|
4
|
50
|
|
|
|
11
|
unless ( defined $_[1] ) { |
41
|
0
|
|
|
|
|
0
|
Carp::croak("->ignore_vcs: No version control system name provided"); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
# As a convenience for higher-level APIs |
45
|
|
|
|
|
|
|
# we treat a defined null string as a nullop |
46
|
4
|
|
|
|
|
11
|
my $vcs = lc $_[1]; |
47
|
4
|
100
|
|
|
|
14
|
return $find if $vcs eq ''; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# Hand off to the rules for each VCS |
50
|
3
|
100
|
|
|
|
9
|
return $find->ignore_cvs if $vcs eq 'cvs'; |
51
|
2
|
100
|
|
|
|
7
|
return $find->ignore_svn if $vcs eq 'svn'; |
52
|
1
|
50
|
|
|
|
7
|
return $find->ignore_svn if $vcs eq 'subversion'; |
53
|
1
|
50
|
|
|
|
7
|
return $find->ignore_bzr if $vcs eq 'bzr'; |
54
|
0
|
0
|
|
|
|
0
|
return $find->ignore_bzr if $vcs eq 'bazaar'; |
55
|
0
|
0
|
|
|
|
0
|
return $find->ignore_git if $vcs eq 'git'; |
56
|
0
|
|
|
|
|
0
|
Carp::croak("->ignore_vcs: '$vcs' is not supported"); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub File::Find::Object::Rule::ignore_cvs { |
61
|
2
|
|
|
2
|
0
|
1586
|
my $find = $_[0]->_force_object; |
62
|
2
|
|
|
|
|
20
|
return $find->or( |
63
|
|
|
|
|
|
|
$FFOR->name('CVS')->directory->prune->discard, |
64
|
|
|
|
|
|
|
$FFOR->name(qr/^\.\#/)->file->discard, |
65
|
|
|
|
|
|
|
$FFOR->new, |
66
|
|
|
|
|
|
|
); |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub File::Find::Object::Rule::ignore_svn { |
71
|
2
|
|
|
2
|
0
|
532
|
my $find = $_[0]->_force_object; |
72
|
2
|
|
|
|
|
14
|
return $find->or( |
73
|
|
|
|
|
|
|
$FFOR->name(@svn)->directory->prune->discard, |
74
|
|
|
|
|
|
|
$FFOR->new, |
75
|
|
|
|
|
|
|
); |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
sub File::Find::Object::Rule::ignore_bzr { |
80
|
2
|
|
|
2
|
0
|
270
|
my $find = $_[0]->_force_object; |
81
|
2
|
|
|
|
|
16
|
return $find->or( |
82
|
|
|
|
|
|
|
$FFOR->name('.bzr')->directory->prune->discard, |
83
|
|
|
|
|
|
|
$FFOR->new, |
84
|
|
|
|
|
|
|
); |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub File::Find::Object::Rule::ignore_git { |
89
|
0
|
|
|
0
|
0
|
|
my $find = $_[0]->_force_object; |
90
|
0
|
|
|
|
|
|
return $find->or( |
91
|
|
|
|
|
|
|
$FFOR->name('.git')->directory->prune->discard, |
92
|
|
|
|
|
|
|
$FFOR->new, |
93
|
|
|
|
|
|
|
); |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
1; |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
__END__ |