Summary: Add a '--commit' to 'cil add' (plus some others)
-Status: InProgress
+Status: Finished
CreatedBy: Andrew Chilton <andychilton@gmail.com>
AssignedTo: Andrew Chilton <andychilton@gmail.com>
Label: Milestone-v0.06
Comment: d98c9a37
Comment: da74ee18
Inserted: 2009-12-23T06:27:27
-Updated: 2010-01-22T02:11:48
+Updated: 2010-01-22T02:15:23
When adding a new issue, I usually do:
sub name { 'label' }
sub run {
- my ($self, $cil, undef, $label, @issue_names) = @_;
+ my ($self, $cil, $args, $label, @issue_names) = @_;
unless ( defined $label ) {
CIL::Utils->fatal("provide a valid label to add to this issue");
# set the status for this issue
$issue->add_label( $label );
$issue->save($cil);
+
+ # if we want to add or commit this issue
+ if ( $args->{add} or $args->{commit} ) {
+ $cil->vcs->add( $cil, $issue );
+ }
+
+ # if we want to commit this issue
+ if ( $args->{commit} ) {
+ $cil->vcs->commit( $cil, $issue );
+ }
}
}
sub name { 'status' }
sub run {
- my ($self, $cil, undef, $status, @issue_names) = @_;
+ my ($self, $cil, $args, $status, @issue_names) = @_;
unless ( defined $status ) {
CIL::Utils->fatal("provide a valid status to set this issue to");
# set the label for this issue
$issue->Status( $status );
$issue->save($cil);
+
+ # if we want to add or commit this issue
+ if ( $args->{add} or $args->{commit} ) {
+ $cil->vcs->add( $cil, $issue );
+ }
+
+ # if we want to commit this issue
+ if ( $args->{commit} ) {
+ $cil->vcs->commit( $cil, $issue );
+ }
}
}