write_file( $filename, $attachment->as_binary );
}
+sub cmd_track {
+ my ($cil, $args, $issue_name) = @_;
+
+ fatal("the 'VCS' option in your .cil file is not set")
+ unless defined $cil->VCS;
+
+ fatal("the 'VCS' option currently only supports values of 'Git'")
+ unless $cil->VCS eq 'Git';
+
+ my $issue = load_issue_fuzzy($cil, $issue_name);
+
+ # add the issue to Git
+ my $issue_dir = $cil->IssueDir();
+ my @files;
+ push @files, "$issue_dir/i_" . $issue->name . '.cil';
+ push @files, map { "$issue_dir/c_${_}.cil" } @{ $issue->CommentList };
+ push @files, map { "$issue_dir/a_${_}.cil" } @{ $issue->AttachmentList };
+ msg("git add @files");
+}
+
sub cmd_fsck {
my ($cil, $args) = @_;
comment ISSUE
attach ISSUE FILENAME
extract ATTACHMENT [--filename=FILENAME]
+ am EMAIL.TXT
+ track ISSUE
fsck
Filters:
$ cil am email.txt
+ $ cil track
$ cil fsck
=head1 DESCRIPTION
Extracts the file from the attachment number. If filename if given uses that,
otherwise it will use the original one saved along with the attachment.
-=item fsck
-
-Tries to help you organise your issues if any aren't valid or have broken
-relationships.
-
=item am
Applies an email message to the issue list. It tries to figure out the type of
Note: this command will deal with Mailbox format files later on.
+=item track ISSUE
+
+This command outputs one or more command which you should run so that your VCS
+knows about your issue. It makes sure all the comments and attachments are done
+too.
+
+=item fsck
+
+Tries to help you organise your issues if any aren't valid or have broken
+relationships.
+
=back
=head1 FILTERS
The C<.cil> file is fairly simple and an example can be seen here:
+ VCS: Git
StatusStrict: 1
StatusAllowedList: New
StatusAllowedList: InProgress
=over
+=item VCS
+
+Default: empty, Type: Enum(Git)
+
+Currently this option only supports Git. This enables you to use the 'track'
+command.
+
=item StatusStrict
Default: 0, Type: Boolean (0/1)
Summary: Add a command 'track'
-Status: New
+Status: Finished
CreatedBy: Andrew Chilton <andychilton@gmail.com>
AssignedTo: Andrew Chilton <andychilton@gmail.com>
Label: Milestone-v0.5
Label: Type-Enhancement
+Comment: 70533ec8
Inserted: 2008-07-05T02:58:20
-Updated: 2008-07-05T03:04:11
+Updated: 2008-07-05T03:09:11
A new command called 'track' would be good so that you can tell 'cil' to tell
your CVS which files to track. This means you don't have to keep adding all
IssueDir
StatusStrict StatusAllowed StatusOpen StatusClosed
LabelStrict LabelAllowed
+ VCS
UserName UserEmail
));
$self->LabelStrict( $cfg->{LabelStrict} );
$self->LabelAllowed( $cfg->{LabelAllowed} );
+
+ $self->VCS( $cfg->{VCS} );
}
## ----------------------------------------------------------------------------