line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package File::Find::Object::Rule::VCS; |
2
|
|
|
|
|
|
|
$File::Find::Object::Rule::VCS::VERSION = '0.0.5'; |
3
|
|
|
|
|
|
|
|
4
|
2
|
|
|
2
|
|
81326
|
use 5.008; |
|
2
|
|
|
|
|
13
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
9
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
34
|
|
7
|
2
|
|
|
2
|
|
8
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
57
|
|
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
911
|
use UNIVERSAL; |
|
2
|
|
|
|
|
22
|
|
|
2
|
|
|
|
|
6
|
|
10
|
2
|
|
|
2
|
|
52
|
use Carp (); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
32
|
|
11
|
2
|
|
|
2
|
|
378
|
use Text::Glob 0.08 (); |
|
2
|
|
|
|
|
709
|
|
|
2
|
|
|
|
|
41
|
|
12
|
2
|
|
|
2
|
|
473
|
use File::Find::Object::Rule (); |
|
2
|
|
|
|
|
17018
|
|
|
2
|
|
|
|
|
42
|
|
13
|
|
|
|
|
|
|
|
14
|
2
|
|
|
2
|
|
11
|
use vars qw{@ISA @EXPORT}; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
83
|
|
15
|
2
|
|
|
2
|
|
9
|
use parent 'File::Find::Object::Rule'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
11
|
|
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
|
797
|
my $find = $_[0]->_force_object; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
# Handle special cases |
31
|
4
|
50
|
|
|
|
25
|
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
|
|
|
|
7
|
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
|
|
|
|
|
9
|
my $vcs = lc $_[1]; |
47
|
4
|
100
|
|
|
|
9
|
return $find if $vcs eq ''; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# Hand off to the rules for each VCS |
50
|
3
|
100
|
|
|
|
8
|
return $find->ignore_cvs if $vcs eq 'cvs'; |
51
|
2
|
100
|
|
|
|
6
|
return $find->ignore_svn if $vcs eq 'svn'; |
52
|
1
|
50
|
|
|
|
3
|
return $find->ignore_svn if $vcs eq 'subversion'; |
53
|
1
|
50
|
|
|
|
6
|
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
|
1861
|
my $find = $_[0]->_force_object; |
62
|
2
|
|
|
|
|
16
|
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
|
409
|
my $find = $_[0]->_force_object; |
72
|
2
|
|
|
|
|
13
|
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
|
219
|
my $find = $_[0]->_force_object; |
81
|
2
|
|
|
|
|
13
|
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__ |