--- /dev/null
+Issue: b5a4ef93
+CreatedBy: Andrew Chilton <andychilton@gmail.com>
+Inserted: 2010-01-22T02:11:30
+Updated: 2010-01-22T02:11:48
+
+Added the code for --add and --commit for 'comment'.
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:07:47
+Updated: 2010-01-22T02:11:48
When adding a new issue, I usually do:
sub name { 'comment' }
sub run {
- my ($self, $cil, undef, $issue_name) = @_;
+ my ($self, $cil, $args, $issue_name) = @_;
my $issue = CIL::Utils->load_issue_fuzzy( $cil, $issue_name );
$comment->CreatedBy( CIL::Utils->user($cil) );
$comment->Description("Description ...");
- CIL::Utils->add_comment_loop($cil, undef, $issue, $comment);
+ $comment = CIL::Utils->add_comment_loop($cil, undef, $issue, $comment);
+
+ # if we want to add or commit this comment
+ if ( $args->{add} or $args->{commit} ) {
+ $cil->vcs->add( $cil, $issue );
+ $cil->vcs->add( $cil, $comment );
+ }
+
+ # if we want to commit this comment
+ if ( $args->{commit} ) {
+ $cil->vcs->commit( $cil, $issue );
+ $cil->vcs->commit( $cil, $comment );
+ }
+
}
1;