X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FApp%2FRgit%2FCommand%2FEach.pm;h=7996f3d1795f515ad3f9057368f1128c95f06f73;hb=e267749b5294c865fa9584c6f15bb0af85e24e30;hp=c313dc815b760250378c0b95a591a3e827418aac;hpb=34eec9dcea44c01535ee6ab4593d98a724ce7e06;p=perl%2Fmodules%2Frgit.git diff --git a/lib/App/Rgit/Command/Each.pm b/lib/App/Rgit/Command/Each.pm index c313dc8..7996f3d 100644 --- a/lib/App/Rgit/Command/Each.pm +++ b/lib/App/Rgit/Command/Each.pm @@ -5,17 +5,19 @@ use warnings; use base qw/App::Rgit::Command/; +use App::Rgit::Utils qw/:codes/; + =head1 NAME App::Rgit::Command::Each - Class for commands to execute for each repository. =head1 VERSION -Version 0.02 +Version 0.03 =cut -our $VERSION = '0.02'; +our $VERSION = '0.03'; =head1 DESCRIPTION @@ -37,13 +39,20 @@ sub run { my $self = shift; my $conf = shift; my $status = 0; + my $code; for (@{$conf->repos}) { $_->chdir or next; $status = $_->run($conf, @{$self->args}); - last if $status; + $code = $self->report($conf, $_, $status) unless defined $code; + if ($code & REDO) { + undef $code; # Don't save it, that would be very dumb + redo; + } + last if $code & LAST; + undef $code unless $code & SAVE; } - $conf->root_repo->chdir; - return $status; + $conf->cwd_repo->chdir; + return wantarray ? ($status, $code) : $status; } =head1 SEE ALSO