line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Git::Repository::FileHistory; |
2
|
3
|
|
|
3
|
|
55932
|
use strict; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
73
|
|
3
|
3
|
|
|
3
|
|
12
|
use warnings; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
61
|
|
4
|
3
|
|
|
3
|
|
56
|
use 5.008001; |
|
3
|
|
|
|
|
9
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.06'; |
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
1266
|
use Git::Repository::Log::Iterator; |
|
3
|
|
|
|
|
36328
|
|
|
3
|
|
|
|
|
603
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new { |
10
|
0
|
|
|
0
|
1
|
|
my ($class, $repo, @files) = @_; |
11
|
|
|
|
|
|
|
|
12
|
0
|
|
|
|
|
|
my $args; |
13
|
0
|
0
|
|
|
|
|
$args = pop @files if ref $files[-1] eq 'HASH'; |
14
|
|
|
|
|
|
|
|
15
|
0
|
|
|
|
|
|
my @cmd = ('--', @files); |
16
|
0
|
0
|
|
|
|
|
unshift @cmd, $args->{branch} if $args->{branch}; |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
my $iter = Git::Repository::Log::Iterator->new($repo, @cmd); |
19
|
0
|
|
|
|
|
|
my @logs; |
20
|
0
|
|
|
|
|
|
while ( my $log = $iter->next ){ |
21
|
0
|
|
|
|
|
|
push @logs, $log; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
bless { |
25
|
0
|
0
|
|
|
|
|
file_name => @files == 1 ? $files[0] : \@files, |
26
|
|
|
|
|
|
|
logs => \@logs, |
27
|
|
|
|
|
|
|
}, $class; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
0
|
0
|
|
sub file_name { shift->{file_name} } |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub logs { |
33
|
0
|
|
|
0
|
1
|
|
my $logs = shift->{logs}; |
34
|
0
|
0
|
|
|
|
|
wantarray ? @$logs : $logs; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
0
|
0
|
|
sub last_log { shift->logs->[0] } |
38
|
0
|
|
|
0
|
0
|
|
sub first_log { shift->logs->[-1] } |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub created_at { |
41
|
0
|
|
|
0
|
1
|
|
my $first = shift->first_log; |
42
|
0
|
0
|
|
|
|
|
$first && $first->author_gmtime; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub last_modified_at { |
46
|
0
|
|
|
0
|
1
|
|
my $last = shift->last_log; |
47
|
0
|
0
|
|
|
|
|
$last && $last->author_gmtime; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
{ |
50
|
3
|
|
|
3
|
|
15
|
no warnings 'once'; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
247
|
|
51
|
|
|
|
|
|
|
*updated_at = *last_modified_at; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub created_by { |
55
|
0
|
|
|
0
|
1
|
|
my $first = shift->first_log; |
56
|
0
|
0
|
|
|
|
|
$first && $first->author_name; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub last_modified_by { |
60
|
0
|
|
|
0
|
1
|
|
my $last = shift->last_log; |
61
|
0
|
0
|
|
|
|
|
$last && $last->author_name; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
1; |
65
|
|
|
|
|
|
|
__END__ |