line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DBIx::Changeset::App::Command::compare; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
4079
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
62
|
|
4
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
62
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
58
|
use base qw/DBIx::Changeset::App::BaseCommand/; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
173
|
|
7
|
2
|
|
|
2
|
|
642
|
use DBIx::Changeset::Collection; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
26
|
|
8
|
2
|
|
|
2
|
|
88
|
use DBIx::Changeset::Exception; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
44
|
|
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
12
|
use vars qw{$VERSION}; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
85
|
|
11
|
|
|
|
|
|
|
BEGIN { |
12
|
2
|
|
|
2
|
|
805
|
$VERSION = '1.11'; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 NAME |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
DBIx::Changeset::App::Command::compare - display a list of outstanding changesets |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 SYNOPSIS |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 METHODS |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head2 run |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=cut |
26
|
|
|
|
|
|
|
sub run { |
27
|
0
|
|
|
0
|
1
|
0
|
my ($self, $opt, $args) = @_; |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
0
|
my $coll = DBIx::Changeset::Collection->new($opt->{'type'}, { |
30
|
|
|
|
|
|
|
changeset_location => $opt->{'location'}, |
31
|
|
|
|
|
|
|
}); |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
0
|
eval { $coll->retrieve_all(); }; |
|
0
|
|
|
|
|
0
|
|
34
|
0
|
|
|
|
|
0
|
my $e; |
35
|
0
|
0
|
|
|
|
0
|
if ( $e = Exception::Class->caught() ) { |
36
|
0
|
|
|
|
|
0
|
warn $e->error, "\n"; |
37
|
0
|
0
|
|
|
|
0
|
warn $e->trace->as_string, "\n" if defined $opt->{'debug'}; |
38
|
0
|
|
|
|
|
0
|
exit; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
0
|
$self->determine_outstanding($opt,$coll); |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
0
|
return; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head2 options |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
define the options for the create command |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=cut |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub options { |
55
|
3
|
|
|
3
|
1
|
16
|
my ($self, $app) = @_; |
56
|
|
|
|
|
|
|
return ( |
57
|
3
|
|
50
|
|
|
210
|
[ 'location=s' => 'Path to changeset files', { default => $app->{'config'}->{'location'} || $app->{'config'}->{'update'}->{'location'} || undef, required => 1 } ], |
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
58
|
|
|
|
|
|
|
[ 'type=s' => 'Which factory to use (default disk)', { default => $app->{'config'}->{'type'} || $app->{'config'}->{'update'}->{'type'} || 'disk' } ], |
59
|
|
|
|
|
|
|
[ 'like=s' => 'only types matching regex', { default => $app->{'config'}->{'like'} || $app->{'config'}->{'update'}->{'like'} || undef } ], |
60
|
|
|
|
|
|
|
[ 'history_db_dsn=s' => 'DBI DSN for the history db', { default => $app->{'config'}->{'history_db_dsn'} || $app->{'config'}->{'bootstrap'}->{'history_db_dsn'} || undef, required => 1 } ], |
61
|
|
|
|
|
|
|
[ 'history_db_user=s' => 'db user for history db', { default => $app->{'config'}->{'history_db_user'} || $app->{'config'}->{'bootstrap'}->{'history_db_user'} || undef } ], |
62
|
|
|
|
|
|
|
[ 'history_db_password=s' => 'db password for the history db user', { default => $app->{'config'}->{'history_db_password'} || $app->{'config'}->{'update'}->{'history_db_password'} || undef } ], |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
); |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head2 validate |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
define the options validation for the compare command |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=cut |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub validate { |
74
|
2
|
|
|
2
|
1
|
8
|
my ($self,$opt,$args) = @_; |
75
|
2
|
50
|
66
|
|
|
57
|
$self->usage_error('This command requires a valid changeset location') unless ( ( defined $opt->{'location'} ) && ( -d $opt->{'location'} ) ); |
76
|
0
|
0
|
|
|
|
|
$self->usage_error('This command requires a history_db_dsn') unless ( defined $opt->{'history_db_dsn'} ); |
77
|
0
|
|
|
|
|
|
return; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
Copyright 2004-2008 Grox Pty Ltd. |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
85
|
|
|
|
|
|
|
under the same terms as Perl itself. |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
The full text of the license can be found in the LICENSE file included with this module. |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=cut |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
1; # End of DBIx::Changeset |