line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::GitGot::Command::push; |
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:GENEHACK'; |
3
|
|
|
|
|
|
|
$App::GitGot::Command::push::VERSION = '1.339'; |
4
|
|
|
|
|
|
|
# ABSTRACT: Push local changes to the default remote in git repos |
5
|
15
|
|
|
15
|
|
8939
|
use 5.014; |
|
15
|
|
|
|
|
60
|
|
6
|
|
|
|
|
|
|
|
7
|
15
|
|
|
15
|
|
97
|
use Data::Dumper; |
|
15
|
|
|
|
|
46
|
|
|
15
|
|
|
|
|
901
|
|
8
|
15
|
|
|
15
|
|
103
|
use Try::Tiny; |
|
15
|
|
|
|
|
66
|
|
|
15
|
|
|
|
|
1080
|
|
9
|
|
|
|
|
|
|
|
10
|
15
|
|
|
15
|
|
144
|
use App::GitGot -command; |
|
15
|
|
|
|
|
45
|
|
|
15
|
|
|
|
|
128
|
|
11
|
|
|
|
|
|
|
|
12
|
15
|
|
|
15
|
|
5349
|
use Moo; |
|
15
|
|
|
|
|
35
|
|
|
15
|
|
|
|
|
90
|
|
13
|
|
|
|
|
|
|
extends 'App::GitGot::Command'; |
14
|
15
|
|
|
15
|
|
5137
|
use namespace::autoclean; |
|
15
|
|
|
|
|
50
|
|
|
15
|
|
|
|
|
109
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# incremental output looks nicer for this command... |
17
|
|
|
|
|
|
|
STDOUT->autoflush(1); |
18
|
2
|
|
|
2
|
|
9
|
sub _use_io_page { 0 } |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub _execute { |
21
|
2
|
|
|
2
|
|
7
|
my( $self, $opt, $args ) = @_; |
22
|
|
|
|
|
|
|
|
23
|
2
|
|
|
|
|
12
|
my $max_len = $self->max_length_of_an_active_repo_label; |
24
|
|
|
|
|
|
|
|
25
|
2
|
|
|
|
|
56
|
REPO: for my $repo ( $self->active_repos ) { |
26
|
8
|
50
|
|
|
|
157
|
next REPO unless $repo->type eq 'git'; |
27
|
|
|
|
|
|
|
|
28
|
8
|
50
|
33
|
|
|
26
|
unless ( $repo->current_remote_branch and $repo->cherry ) { |
29
|
8
|
100
|
|
|
|
303
|
printf "%3d) %-${max_len}s : Nothing to push\n", |
30
|
|
|
|
|
|
|
$repo->number , $repo->label unless $self->quiet; |
31
|
8
|
|
|
|
|
581
|
next REPO; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
try { |
35
|
0
|
|
|
0
|
|
|
printf "%3d) %-${max_len}s : ", $repo->number , $repo->label; |
36
|
|
|
|
|
|
|
# really wish this gave _some_ kind of output... |
37
|
0
|
|
|
|
|
|
my @output = $repo->push; |
38
|
0
|
|
|
|
|
|
printf "%s\n", $self->major_change( 'PUSHED' ); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
catch { |
41
|
0
|
|
|
0
|
|
|
say STDERR $self->error( 'ERROR: Problem with push on repo ' , $repo->label ); |
42
|
0
|
|
|
|
|
|
say STDERR "\n" , Dumper $_; |
43
|
0
|
|
|
|
|
|
}; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
## FIXME docs |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
__END__ |