| 1 | package App::GitGot::Command::push; | ||||||||||||||||||||||||||||
| 2 | 16 | our $AUTHORITY = 'cpan:GENEHACK'; | |||||||||||||||||||||||||||
| 3 | 16 | $App::GitGot::Command::push::VERSION = '1.339'; | |||||||||||||||||||||||||||
| 4 | # ABSTRACT: Push local changes to the default remote in git repos | ||||||||||||||||||||||||||||
| 5 | 16 | ▶ | use 5.014; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 16 | ▶ | use Data::Dumper; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 16 | ▶ | use Try::Tiny; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 16 | ▶ | use App::GitGot -command; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 16 | ▶ | use Moo; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | 16 | extends 'App::GitGot::Command'; | |||||||||||||||||||||||||||
| 14 | 16 | ▶ | use namespace::autoclean; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | # incremental output looks nicer for this command... | ||||||||||||||||||||||||||||
| 17 | 16 | STDOUT->autoflush(1); | |||||||||||||||||||||||||||
| 18 | 2 | ▶ | sub _use_io_page { 0 } | ||||||||||||||||||||||||||
|
Subroutine
_use_io_page: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 2 | ▶ | sub _execute { | ||||||||||||||||||||||||||
|
Subroutine
_execute: called CC=6 SCAR=22.4
| |||||||||||||||||||||||||||||
| 21 | 2 | my( $self, $opt, $args ) = @_; | |||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 2 | my $max_len = $self->max_length_of_an_active_repo_label; | |||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | 2 | REPO: for my $repo ( $self->active_repos ) { | |||||||||||||||||||||||||||
| 26 | 8 | ▶ | next REPO unless $repo->type eq 'git'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 8 | ▶ | unless ( $repo->current_remote_branch and $repo->cherry ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$repo->current_remote_branch and $repo->cherry
MC/DC0%0/2
$repo->current_remote_branch and $repo->cherry
$repo->current_remote_branch
$repo->cherry
Truth table33%1/3
A and B
A= $repo->current_remote_branchB= $repo->cherry
| |||||||||||||||||||||||||||||
| 29 | 8 | ▶ | printf "%3d) %-${max_len}s : Nothing to push\n", | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 30 | $repo->number , $repo->label unless $self->quiet; | ||||||||||||||||||||||||||||
| 31 | 8 | next REPO; | |||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 0 | ▶ | try { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 35 | 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 | 0 | ▶ | catch { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 41 | 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 | 16 | 1; | |||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | ## FIXME docs | ||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | __END__ | ||||||||||||||||||||||||||||