]> git.mjollnir.org Git - cil.git/commitdiff
Make the steal and edit commands do --add and --commit
authorAndrew Chilton <andychilton@gmail.com>
Sat, 23 Jan 2010 12:34:42 +0000 (01:34 +1300)
committerAndrew Chilton <andychilton@gmail.com>
Sat, 23 Jan 2010 12:34:42 +0000 (01:34 +1300)
lib/CIL/Command/Edit.pm
lib/CIL/Command/Steal.pm

index dcb1d92564a239c18174652cfd6a4bb14851f694..f5dacc7732e9ce4cfc623e4d5092d463dbf0ff9b 100644 (file)
@@ -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);
 }
 
index 901926e9edf9f055aade6a7a789d065e7bdc705c..d86f5493074f1d8cf77af8f4bb3e472734609334 100644 (file)
@@ -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;