| 1 | package Git::CPAN::Patch::Command::Update; | ||||||||||
| 2 | 1 | our $AUTHORITY = 'cpan:YANICK'; | |||||||||
| 3 | #ABSTRACT: Import the latest version of a module and rebase the current branch | ||||||||||
| 4 | 1 | $Git::CPAN::Patch::Command::Update::VERSION = '2.5.2'; | |||||||||
| 5 | 1 | ▶ | use 5.10.0; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 1 | ▶ | use Git::Repository; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 1 | ▶ | use MooseX::App::Command; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | |||||||||||
| 14 | 1 | extends 'Git::CPAN::Patch::Command::Import'; | |||||||||
| 15 | |||||||||||
| 16 | 1 | ▶ | use experimental qw/ | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 17 | signatures | ||||||||||
| 18 | postderef | ||||||||||
| 19 | 1 | /; | |||||||||
| 20 | |||||||||||
| 21 | #TODO check for versions before download | ||||||||||
| 22 | |||||||||||
| 23 | 1 | has last_import_before_run => ( | |||||||||
| 24 | is => 'rw', | ||||||||||
| 25 | ); | ||||||||||
| 26 | |||||||||||
| 27 | 0 | ▶ | before run => sub ($self) { | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||
| 28 | 0 | ▶ | eval { $self->set_last_import_before_run($self->last_commit) } | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | or die "branch 'cpan/master' doesn't exist yet (import first)\n"; | ||||||||||
| 30 | 0 | $self->set_thing_to_import( $self->tracked_distribution ); | |||||||||
| 31 | 1 | }; | |||||||||
| 32 | |||||||||||
| 33 | 0 | ▶ | after run => sub ($self) { | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||
| 34 | 0 | ▶ | return if $self->last_import_before_run eq $self->last_commit; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 35 | |||||||||||
| 36 | 0 | $self->git_run( rebase => 'cpan/master' ); | |||||||||
| 37 | 1 | }; | |||||||||
| 38 | |||||||||||
| 39 | 1 | __PACKAGE__->meta->make_immutable; | |||||||||
| 40 | |||||||||||
| 41 | 1 | 1; | |||||||||
| 42 | |||||||||||
| 43 | __END__ | ||||||||||