line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package File::Find::Rule::ConflictMarker; |
2
|
2
|
|
|
2
|
|
183899
|
use strict; |
|
2
|
|
|
|
|
11
|
|
|
2
|
|
|
|
|
57
|
|
3
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
54
|
|
4
|
2
|
|
|
2
|
|
998
|
use parent qw/File::Find::Rule/; |
|
2
|
|
|
|
|
639
|
|
|
2
|
|
|
|
|
11
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
my $CONFLICT_MARKER_BASE = '<' x 7; |
9
|
|
|
|
|
|
|
my $CONFLICT_MARKER_DEVIDER = '=' x 7; |
10
|
|
|
|
|
|
|
my $CONFLICT_MARKER_TARGET = '>' x 7; |
11
|
|
|
|
|
|
|
my $CONFLICT_MARKER_SOURCE = '|' x 7; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my $CONFLICT_MARKER_COND = join '|', map { "\Q$_\E" } ( |
14
|
|
|
|
|
|
|
$CONFLICT_MARKER_BASE, |
15
|
|
|
|
|
|
|
$CONFLICT_MARKER_DEVIDER, |
16
|
|
|
|
|
|
|
$CONFLICT_MARKER_TARGET, |
17
|
|
|
|
|
|
|
$CONFLICT_MARKER_SOURCE, |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
our $CONFLICT_MARKER_REGEX = qr/($CONFLICT_MARKER_COND)/; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub File::Find::Rule::conflict_marker { |
23
|
1
|
|
|
1
|
0
|
202
|
my ($file_find_rule) = @_; |
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
|
|
3
|
my $self = $file_find_rule->_force_object; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
return $self->file->exec(sub{ |
28
|
7
|
|
|
7
|
|
1165
|
my ($file) = @_; |
29
|
|
|
|
|
|
|
|
30
|
7
|
50
|
|
|
|
219
|
open my $fh, '<', $file or die "Could not open $file, $!"; |
31
|
7
|
|
|
|
|
21
|
my $content = do { local $/; <$fh>; }; |
|
7
|
|
|
|
|
30
|
|
|
7
|
|
|
|
|
167
|
|
32
|
7
|
|
|
|
|
62
|
close $fh; |
33
|
|
|
|
|
|
|
|
34
|
7
|
|
|
|
|
221
|
return $content =~ m!$CONFLICT_MARKER_REGEX!; |
35
|
1
|
|
|
|
|
39
|
}); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |