From f862194c863b62eee336f141defb1e0fd3861a24 Mon Sep 17 00:00:00 2001 From: Andrew Chilton Date: Sun, 24 Jan 2010 01:34:42 +1300 Subject: [PATCH] Make the steal and edit commands do --add and --commit --- lib/CIL/Command/Edit.pm | 13 ++++++++++++- lib/CIL/Command/Steal.pm | 12 +++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/lib/CIL/Command/Edit.pm b/lib/CIL/Command/Edit.pm index dcb1d92..f5dacc7 100644 --- a/lib/CIL/Command/Edit.pm +++ b/lib/CIL/Command/Edit.pm @@ -35,7 +35,7 @@ my $y = 'y'; sub name { 'edit' } sub run { - my ($self, $cil, undef, $issue_name) = @_; + my ($self, $cil, $args, $issue_name) = @_; my $issue = CIL::Utils->load_issue_fuzzy( $cil, $issue_name ); @@ -64,6 +64,17 @@ sub run { # save it $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 ); + } + CIL::Utils->display_issue($cil, $issue); } diff --git a/lib/CIL/Command/Steal.pm b/lib/CIL/Command/Steal.pm index 901926e..d86f549 100644 --- a/lib/CIL/Command/Steal.pm +++ b/lib/CIL/Command/Steal.pm @@ -40,7 +40,17 @@ sub run { $issue->AssignedTo( CIL::Utils->user($cil) ); $issue->save($cil); - CIL::Utils->display_issue($cil, $issue); + # 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 ); + } + + CIL::Utils->display_issue_full($cil, $issue); } 1; -- 2.39.5