]> git.mjollnir.org Git - cil.git/commitdiff
Add DefaultNewStatus config option so I don't have to use 'new'
authorPenny Leach <penny@mjollnir.org>
Thu, 23 Jul 2009 09:03:02 +0000 (11:03 +0200)
committerPenny Leach <penny@mjollnir.org>
Thu, 23 Jul 2009 09:03:02 +0000 (11:03 +0200)
lib/CIL.pm
lib/CIL/Command/Add.pm
lib/CIL/Command/Am.pm
lib/CIL/Command/Init.pm

index 327adc69034dcae70c7a655f39c9d5d4c11faa3d..d6360b538cf2d7e6bfc302dae1b008f753fd7aef 100644 (file)
@@ -41,16 +41,18 @@ __PACKAGE__->mk_accessors(qw(
     IssueDir
     StatusStrict StatusAllowed StatusOpen StatusClosed
     LabelStrict LabelAllowed
+    DefaultNewStatus
     VCS
     vcs hook
     vcs_revision
 ));
 
 my $defaults = {
-    IssueDir     => 'issues', # the dir to save the issues in
-    StatusStrict => 0,        # whether to complain if a status is invalid
-    LabelStrict  => 0,        # whether to complain if a label is invalid
-    VCS          => 'Null',   # don't do anything for VCS hooks
+    IssueDir         => 'issues', # the dir to save the issues in
+    StatusStrict     => 0,        # whether to complain if a status is invalid
+    LabelStrict      => 0,        # whether to complain if a label is invalid
+    DefaultNewStatus => 'New',    # What Status to use for new issues by default
+    VCS              => 'Null',   # don't do anything for VCS hooks
 };
 
 my @config_hashes = qw(StatusAllowed StatusOpen StatusClosed LabelAllowed);
@@ -287,6 +289,8 @@ sub read_config_file {
     $self->LabelStrict( $cfg->{LabelStrict} );
     $self->LabelAllowed( $cfg->{LabelAllowed} );
 
+    $self->DefaultNewStatus( $cfg->{DefaultNewStatus} );
+
     # if we are allowed this VCS, create the hook instance
     $self->VCS( $cfg->{VCS} || 'Null' );
     my $vcs = CIL::VCS::Factory->new( $cfg->{VCS} );
index de8a9e2a67bd6149afe2994a73ad09db5b025b2e..18ff0bb22b32280d417fcc74da63e5d9365472a6 100644 (file)
@@ -39,7 +39,7 @@ sub run {
 
     my $issue = CIL::Issue->new('tmpname');
     $issue->Summary( join ' ', @argv );
-    $issue->Status('New');
+    $issue->Status($cil->DefaultNewStatus);
     $issue->CreatedBy( $user );
     $issue->AssignedTo( $user )
         if $args->{mine};
index bff0531412b7c2c749470d28971f1a498754b5a9..4f6d2dd7e00454bb26908641e975ca11653070a1 100644 (file)
@@ -115,7 +115,7 @@ sub run {
         # no issue found so make up the issue first
         my $issue = CIL::Issue->new('tmpname');
         $issue->Summary( $subject );
-        $issue->Status( 'New' );
+        $issue->Status($cil->DefaultNewStatus);
         $issue->CreatedBy( $from );
         $issue->AssignedTo( CIL::Utils->user($cil) );
         $issue->Inserted( $date );
index 76ee893bf73f36a7d0ae97dff274700758a0a2b7..3bc33c13dbcab13e7734392b2de68b5ffffe9a8f 100644 (file)
@@ -84,6 +84,7 @@ StatusAllowedList: Finished
 StatusOpenList: New
 StatusOpenList: InProgress
 StatusClosedList: Finished
+DefaultNewStatus: New
 LabelStrict: 1
 LabelAllowedList: Type-Enhancement
 LabelAllowedList: Type-Defect