X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FApp%2FRgit%2FCommand%2FEach.pm;h=ef843f76eddbb5e42f8bbaee80760335ddf585c8;hb=a43b4096bf0350b564465090554317935a84e7ef;hp=a42ddb886d988b06ed55fc2ce0e73e6261a93cd7;hpb=67e585ffae69ce0c350a920658738d7864b1d54a;p=perl%2Fmodules%2Frgit.git diff --git a/lib/App/Rgit/Command/Each.pm b/lib/App/Rgit/Command/Each.pm index a42ddb8..ef843f7 100644 --- a/lib/App/Rgit/Command/Each.pm +++ b/lib/App/Rgit/Command/Each.pm @@ -5,6 +5,8 @@ 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. @@ -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; + ($status, my $signal) = $_->run($conf, @{$self->args}); + $code = $self->report($conf, $_, $status, $signal) unless defined $code; + last if $code & LAST; + if ($code & REDO) { + undef $code; # Don't save it, that would be very dumb + redo; + } + undef $code unless $code & SAVE; } $conf->cwd_repo->chdir; - return $status; + return wantarray ? ($status, $code) : $status; } =head1 SEE ALSO