From: Andrew Chilton Date: Sat, 23 Jan 2010 11:55:58 +0000 (+1300) Subject: cil-f8b44370: New Issue X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=b363a45c10f6ab88f2ad319d30a4560d9de42d0f;p=cil.git cil-f8b44370: New Issue --- diff --git a/issues/i_f8b44370.cil b/issues/i_f8b44370.cil new file mode 100644 index 0000000..6367286 --- /dev/null +++ b/issues/i_f8b44370.cil @@ -0,0 +1,12 @@ +Summary: When adding new issues, the Git comment is 'New Comment' +Status: Finished +CreatedBy: Andrew Chilton +AssignedTo: Andrew Chilton +Label: Milestone-v0.06 +Inserted: 2010-01-23T11:52:10 +Updated: 2010-01-23T11:56:58 + +Instead, the message should say 'New '. + +For this, we'll need the entities to return a user readable string of what it +is. diff --git a/lib/CIL/Attachment.pm b/lib/CIL/Attachment.pm index 337ed1a..ee2a73a 100644 --- a/lib/CIL/Attachment.pm +++ b/lib/CIL/Attachment.pm @@ -81,6 +81,10 @@ sub prefix { return 'a'; } +sub type { + return 'Attachment'; +} + sub fields { return \@FIELDS; } diff --git a/lib/CIL/Command/Comment.pm b/lib/CIL/Command/Comment.pm index ab1e1ba..8bbf1e4 100644 --- a/lib/CIL/Command/Comment.pm +++ b/lib/CIL/Command/Comment.pm @@ -53,9 +53,8 @@ sub run { # if we want to commit this comment if ( $args->{commit} ) { - $cil->vcs->commit( $cil, $issue, $comment ); + $cil->vcs->commit( $cil, $comment, $issue ); } - } 1; diff --git a/lib/CIL/Comment.pm b/lib/CIL/Comment.pm index 362f094..5fa572b 100644 --- a/lib/CIL/Comment.pm +++ b/lib/CIL/Comment.pm @@ -63,6 +63,10 @@ sub prefix { return 'c'; } +sub type { + return 'Comment'; +} + sub fields { return \@FIELDS; } diff --git a/lib/CIL/Issue.pm b/lib/CIL/Issue.pm index 75ca7b7..9d23d17 100644 --- a/lib/CIL/Issue.pm +++ b/lib/CIL/Issue.pm @@ -82,6 +82,10 @@ sub prefix { return 'i'; } +sub type { + return 'Issue'; +} + sub fields { return \@FIELDS; } diff --git a/lib/CIL/VCS/Git.pm b/lib/CIL/VCS/Git.pm index 1aec18f..a601324 100644 --- a/lib/CIL/VCS/Git.pm +++ b/lib/CIL/VCS/Git.pm @@ -128,7 +128,7 @@ sub commit { push @filenames, $filename; } - my $message = 'cil-' . $entities[0]->name . ': New Comment'; + my $message = 'cil-' . $entities[0]->name . ': New ' . $entities[0]->type; return $self->git->command('commit', '-m', $message, @filenames); }