line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package File::Find::Rule::ConflictMarker; |
2
|
2
|
|
|
2
|
|
181587
|
use strict; |
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
57
|
|
3
|
2
|
|
|
2
|
|
21
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
56
|
|
4
|
2
|
|
|
2
|
|
964
|
use parent qw/File::Find::Rule/; |
|
2
|
|
|
|
|
655
|
|
|
2
|
|
|
|
|
11
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
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
|
240
|
my ($file_find_rule) = @_; |
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
|
|
6
|
my $self = $file_find_rule->_force_object; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
return $self->file->exec(sub{ |
28
|
7
|
|
|
7
|
|
1187
|
my ($file) = @_; |
29
|
|
|
|
|
|
|
|
30
|
7
|
50
|
|
|
|
220
|
open my $fh, '<', $file or die "Could not open $file, $!"; |
31
|
7
|
|
|
|
|
17
|
my $content = do { local $/; <$fh>; }; |
|
7
|
|
|
|
|
30
|
|
|
7
|
|
|
|
|
156
|
|
32
|
7
|
|
|
|
|
64
|
close $fh; |
33
|
|
|
|
|
|
|
|
34
|
7
|
|
|
|
|
214
|
return $content =~ m!$CONFLICT_MARKER_REGEX!; |
35
|
1
|
|
|
|
|
44
|
}); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |