line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: Iterates through revision history |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Pinto::RevisionWalker; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
6
|
use Moose; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
6
|
1
|
|
|
1
|
|
7906
|
use MooseX::StrictConstructor; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
10
|
|
7
|
1
|
|
|
1
|
|
3082
|
use MooseX::Types::Moose qw(ArrayRef); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
16
|
|
8
|
1
|
|
|
1
|
|
5894
|
use MooseX::MarkAsMethods ( autoclean => 1 ); |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
10
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.14'; # VERSION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
15
|
|
|
|
|
|
|
# TODO: Rethink this API. Do we need start? Can we just use queue? What |
16
|
|
|
|
|
|
|
# about filtering, or walking forward? Sort chronological or topological? |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
has start => ( |
19
|
|
|
|
|
|
|
is => 'ro', |
20
|
|
|
|
|
|
|
isa => 'Pinto::Schema::Result::Revision', |
21
|
|
|
|
|
|
|
required => 1, |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
has queue => ( |
25
|
|
|
|
|
|
|
isa => ArrayRef, |
26
|
|
|
|
|
|
|
traits => [qw(Array)], |
27
|
|
|
|
|
|
|
handles => { enqueue => 'push', dequeue => 'shift' }, |
28
|
|
|
|
|
|
|
default => sub { [ $_[0]->start ] }, |
29
|
|
|
|
|
|
|
lazy => 1, |
30
|
|
|
|
|
|
|
); |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub next { |
35
|
5
|
|
|
5
|
0
|
211
|
my ($self) = @_; |
36
|
|
|
|
|
|
|
|
37
|
5
|
|
|
|
|
176
|
my $next = $self->dequeue; |
38
|
|
|
|
|
|
|
|
39
|
5
|
50
|
|
|
|
30
|
return if not $next; |
40
|
5
|
100
|
|
|
|
283
|
return if $next->is_root; |
41
|
|
|
|
|
|
|
|
42
|
3
|
|
|
|
|
17
|
$self->enqueue( $next->parents ); |
43
|
|
|
|
|
|
|
|
44
|
3
|
|
|
|
|
19
|
return $next; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
52
|
|
|
|
|
|
|
1; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
__END__ |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=pod |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=encoding UTF-8 |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=for :stopwords Jeffrey Ryan Thalhammer |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 NAME |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Pinto::RevisionWalker - Iterates through revision history |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 VERSION |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
version 0.14 |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 AUTHOR |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Jeffrey Ryan Thalhammer <jeff@stratopan.com> |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
This software is copyright (c) 2015 by Jeffrey Ryan Thalhammer. |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
79
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=cut |