| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
1
|
|
|
1
|
|
1199
|
use 5.008; # utf8 |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
45
|
|
|
2
|
1
|
|
|
1
|
|
6
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
32
|
|
|
3
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
27
|
|
|
4
|
1
|
|
|
1
|
|
878
|
use utf8; |
|
|
1
|
|
|
|
|
10
|
|
|
|
1
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Git::PurePerl::Walker::Method::FirstParent; |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.004000'; |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# ABSTRACT: Walk down a tree following the first parent. |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY |
|
13
|
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
|
490
|
use Moose qw( with has ); |
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
with qw( Git::PurePerl::Walker::Role::Method ); |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
has '_commit' => ( isa => 'Maybe[ Object ]', is => 'rw', lazy_build => 1 ); |
|
57
|
|
|
|
|
|
|
has 'start' => ( isa => 'Str', is => 'rw', required => 1 ); |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub _build__commit { |
|
64
|
|
|
|
|
|
|
my ($self) = @_; |
|
65
|
|
|
|
|
|
|
return $self->_repo->get_object( $self->start ); |
|
66
|
|
|
|
|
|
|
} |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub current { |
|
75
|
|
|
|
|
|
|
my ($self) = @_; |
|
76
|
|
|
|
|
|
|
return $self->_commit; |
|
77
|
|
|
|
|
|
|
} |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub has_next { |
|
86
|
|
|
|
|
|
|
my ($self) = @_; |
|
87
|
|
|
|
|
|
|
if ( not $self->_commit ) { |
|
88
|
|
|
|
|
|
|
return; |
|
89
|
|
|
|
|
|
|
} |
|
90
|
|
|
|
|
|
|
if ( not $self->_commit->parent ) { |
|
91
|
|
|
|
|
|
|
return; |
|
92
|
|
|
|
|
|
|
} |
|
93
|
|
|
|
|
|
|
return 1; |
|
94
|
|
|
|
|
|
|
} |
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
## no critic (Subroutines::ProhibitBuiltinHomonyms) |
|
103
|
|
|
|
|
|
|
sub next { |
|
104
|
|
|
|
|
|
|
my ($self) = @_; |
|
105
|
|
|
|
|
|
|
my $commit; |
|
106
|
|
|
|
|
|
|
$self->_commit( $commit = $self->peek_next ); |
|
107
|
|
|
|
|
|
|
return $commit; |
|
108
|
|
|
|
|
|
|
} |
|
109
|
|
|
|
|
|
|
## use critic |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
sub peek_next { |
|
118
|
|
|
|
|
|
|
my $commit = (shift)->_commit->parent; |
|
119
|
|
|
|
|
|
|
return $commit; |
|
120
|
|
|
|
|
|
|
} |
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
## no critic ( Subroutines::ProhibitBuiltinHomonyms ) |
|
129
|
|
|
|
|
|
|
sub reset { |
|
130
|
|
|
|
|
|
|
my ($self) = @_; |
|
131
|
|
|
|
|
|
|
$self->_commit( $self->_repo->get_object( $self->start ) ); |
|
132
|
|
|
|
|
|
|
return $self; |
|
133
|
|
|
|
|
|
|
} |
|
134
|
|
|
|
|
|
|
## use critic |
|
135
|
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
no Moose; |
|
137
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
|
138
|
|
|
|
|
|
|
1; |
|
139
|
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
__END__ |
|
141
|
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
=pod |
|
143
|
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=encoding UTF-8 |
|
145
|
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=head1 NAME |
|
147
|
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
Git::PurePerl::Walker::Method::FirstParent - Walk down a tree following the first parent. |
|
149
|
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=head1 VERSION |
|
151
|
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
version 0.004000 |
|
153
|
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
=head1 CONSTRUCTOR ARGUMENTS |
|
155
|
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
=head2 start |
|
157
|
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
|
159
|
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
=head2 start |
|
161
|
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
=head1 ATTRIBUTE GENERATED METHODS |
|
163
|
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
=head2 start |
|
165
|
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
=head1 INHERITED METHODS |
|
167
|
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
=head2 for_repository |
|
169
|
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
L<< C<Git::PurePerl::B<Walker::Role::HasRepo>-E<gt>I<for_repository( $repo )>>|Git::PurePerl::Walker::Role::HasRepo/for_repository >> |
|
171
|
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
=head2 clone |
|
173
|
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
L<< C<MooseX::B<Clone>-E<gt>I<clone( %params )>>|MooseX::Clone/clone-params >> |
|
175
|
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
=head2 _repo |
|
177
|
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
L<< C<Git::PurePerl::B<Walker::Role::HasRepo>-E<gt>I<_repo( $repo )>>|Git::PurePerl::Walker::Role::HasRepo/_repo >> |
|
179
|
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
=head1 PRIVATE CONSTRUCTOR ARGUMENTS |
|
181
|
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
=head2 _commit |
|
183
|
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
=head1 PRIVATE ATTRIBUTES |
|
185
|
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
=head2 _commit |
|
187
|
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
=head1 PRIVATE METHODS |
|
189
|
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
=head2 _build_commit |
|
191
|
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
=head1 PRIVATE ATTRIBUTE GENERATED METHODS |
|
193
|
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
=head2 _commit |
|
195
|
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
=head1 CONSUMED ROLES |
|
197
|
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
=head2 Git::PurePerl::Walker::Role::Method |
|
199
|
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
L<< C<Git::PurePerl::B<Walker::Role::Method>>|Git::PurePerl::Walker::Role::Method >> |
|
201
|
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
=head1 ROLE SATISFYING METHODS |
|
203
|
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
=head2 current |
|
205
|
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
L<< C<Git::PurePerl::B<Walker::Role::Method>-E<gt>I<current()>>|Git::PurePerl::Walker::Role::Method/current >> |
|
207
|
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
=head2 has_next |
|
209
|
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
L<< C<Git::PurePerl::B<Walker::Role::Method>-E<gt>I<has_next()>>|Git::PurePerl::Walker::Role::Method/has_next >> |
|
211
|
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
=head2 next |
|
213
|
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
L<< C<Git::PurePerl::B<Walker::Role::Method>-E<gt>I<next()>>|Git::PurePerl::Walker::Role::Method/next >> |
|
215
|
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
=head2 peek_next |
|
217
|
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
L<< C<Git::PurePerl::B<Walker::Role::Method>-E<gt>I<peek_next()>>|Git::PurePerl::Walker::Role::Method/peek_next >> |
|
219
|
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
=head2 reset |
|
221
|
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
L<< C<Git::PurePerl::B<Walker::Role::Method>-E<gt>I<reset()>>|Git::PurePerl::Walker::Role::Method/reset >> |
|
223
|
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
=head1 AUTHOR |
|
225
|
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
Kent Fredric <kentnl@cpan.org> |
|
227
|
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
229
|
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
This software is copyright (c) 2014 by Kent Fredric <kentnl@cpan.org>. |
|
231
|
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
|
233
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
|
234
|
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
=cut |