App-Gitc

 view release on metacpan or  search on metacpan

bin/gitc-open  view on Meta::CPAN

    history
    history_owner
    history_status
    is_auto_fetch
    is_valid_ref
    its_for_changeset
    meta_data_add
    meta_data_rm
    project_config
    project_name
    state_blocked
);
use App::Gitc::Reversible;
use Getopt::Long;
use List::MoreUtils qw( none );

my $onto;
GetOptions( 'onto=s' => \$onto );

my $changeset_name = shift or die "You must specify a changeset name\n";

exec 'gitc-quickfix', if $changeset_name eq 'quickfix';

die "You may not create a changeset named '$changeset_name'\n"
    if $changeset_name =~ m/^(master|test|stage|prod)$/;

my $its = its_for_changeset($changeset_name);
if ($its) {
    my $issue = $its->get_issue($changeset_name);
    my $state = $its->issue_state($issue);
    if ($issue && state_blocked('open', $state)) {
        my $its_label = $its->label_issue;
        die "gitc-open aborting\n"
            unless confirm("$its_label is @{[ uc $state ]}.  Proceed?");
    }
}

my $history = history($changeset_name);
if (@$history) {
    my $owner = history_owner($history);
    my $status = history_status($history);

lib/App/Gitc/Util.pm  view on Meta::CPAN

        restore_meta_data
        sendmail
        short_ref_name
        sort_changesets_by_name
        toplevel
        traverse_commits
        unmerged_changesets
        unpromoted
        user_lookup_class
        version_tag_prefix
        state_blocked
    );
}


sub confirm {
    my ($message) = @_;
    die "No message given to 'confirm'" if not defined $message;

    require Term::ReadLine;
    my $term   = Term::ReadLine->new('gitc');

lib/App/Gitc/Util.pm  view on Meta::CPAN

    }

    # promotions need another level of dereference
    die "No initial status for target $target" unless $statuses->{$target}{from};
    die "No final status for target $target" unless $statuses->{$target}{to};

    return $statuses->{$target};
}


sub state_blocked {
    my ( $command, $state ) = @_;

    my $statuses = its_config()->{ $command }
        or die 'No ' . its()->label_service . " statuses for $command";

    # promotions need another level of dereference
    my $block = $statuses->{ block };

    return unless $block;

lib/App/Gitc/Util.pm  view on Meta::CPAN

=head2 command_name

Returns the name of the gitc command that started this whole mess.
This is mostly a helper subroutine for eventum_transition_status.
If the command name can't be determined, an exception is thrown.

=head2 _states

Used internally to calculate target for state change.

=head2 state_blocked

Given a C<command> and a specified C<state> this checks the block list in the
project configuration and returns true if the state should block the command
from proceeding.

NOTE: Block list must be an arraref in the project configuration 

=head1 AUTHOR

Grant Street Group <developers@grantstreet.com>



( run in 0.710 second using v1.01-cache-2.11-cpan-49f99fa48dc )