| 1 | # ABSTRACT: revert stack to a prior revision | ||||||||||
| 2 | |||||||||||
| 3 | package App::Pinto::Command::revert; | ||||||||||
| 4 | |||||||||||
| 5 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | #----------------------------------------------------------------------------- | ||||||||||
| 9 | |||||||||||
| 10 | 1 | ▶ | use base 'App::Pinto::Command'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | #------------------------------------------------------------------------------ | ||||||||||
| 13 | |||||||||||
| 14 | 1 | our $VERSION = '0.14'; # VERSION | |||||||||
| 15 | |||||||||||
| 16 | #------------------------------------------------------------------------------ | ||||||||||
| 17 | |||||||||||
| 18 | 0 | ▶ | sub command_names { return qw(revert) } | ||||||||
|
Subroutine
command_names: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 19 | |||||||||||
| 20 | #------------------------------------------------------------------------------ | ||||||||||
| 21 | |||||||||||
| 22 | 0 | ▶ | sub opt_spec { | ||||||||
|
Subroutine
opt_spec: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 23 | 0 | my ( $self, $app ) = @_; | |||||||||
| 24 | |||||||||||
| 25 | return ( | ||||||||||
| 26 | 0 | [ 'dry-run' => 'Do not commit any changes' ], | |||||||||
| 27 | [ 'force' => 'Revert even if revision is not ancestor' ], | ||||||||||
| 28 | [ 'message|m=s' => 'Message to describe the change' ], | ||||||||||
| 29 | [ 'stack|s=s' => 'Revert this stack' ], | ||||||||||
| 30 | [ 'use-default-message|M' => 'Use the generated message' ], | ||||||||||
| 31 | ); | ||||||||||
| 32 | |||||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | #------------------------------------------------------------------------------ | ||||||||||
| 36 | |||||||||||
| 37 | 0 | ▶ | sub validate_args { | ||||||||
|
Subroutine
validate_args: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||
| 38 | 0 | my ( $self, $opts, $args ) = @_; | |||||||||
| 39 | |||||||||||
| 40 | 0 | my $arg_count = @{$args}; | |||||||||
| 41 | |||||||||||
| 42 | # If there is one arg, then it is revision and stack is default | ||||||||||
| 43 | # If there are 2 args, then the 1st is stack and 2nd is revision | ||||||||||
| 44 | |||||||||||
| 45 | 0 | ▶ | $opts->{revision} = $arg_count == 1 ? $args->[0] : $args->[1]; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 46 | 0 | ▶ | $opts->{stack} = $args->[0] if $arg_count == 2; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 47 | |||||||||||
| 48 | 0 | return 1; | |||||||||
| 49 | } | ||||||||||
| 50 | |||||||||||
| 51 | #------------------------------------------------------------------------------ | ||||||||||
| 52 | 1 | 1; | |||||||||
| 53 | |||||||||||
| 54 | __END__ | ||||||||||