From: Andrew Chilton Date: Sun, 24 Jan 2010 11:15:16 +0000 (+1300) Subject: cil:1a5fb257: Fixed so that depends-on and precedes can both do --add and --commit X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=0b3dce5623591f47cad47cb805d59279676af52e;p=cil.git cil:1a5fb257: Fixed so that depends-on and precedes can both do --add and --commit --- diff --git a/bin/cil b/bin/cil index baacfa3..51d202b 100755 --- a/bin/cil +++ b/bin/cil @@ -104,8 +104,6 @@ my %BOOLEAN_ARGS = ( if @ARGV == 0; my $command_name = shift @ARGV; - $command_name =~ s{-}{_}gxms; - my( $command ) = grep { $command_name eq $_->name } CIL->commands or Getopt::Mixed::abortMsg("'$command_name' is not a valid cil command."); diff --git a/issues/c_146b6b88.cil b/issues/c_146b6b88.cil new file mode 100644 index 0000000..4b4c18e --- /dev/null +++ b/issues/c_146b6b88.cil @@ -0,0 +1,7 @@ +Issue: 1a5fb257 +CreatedBy: Andrew Chilton +Inserted: 2010-01-24T11:14:08 +Updated: 2010-01-24T11:14:40 + +Before even doing this issue, the 'depends-on' was being mapped to +'depends_on', so that has also been fixed. diff --git a/issues/i_1a5fb257.cil b/issues/i_1a5fb257.cil index d0ea8b7..7792876 100644 --- a/issues/i_1a5fb257.cil +++ b/issues/i_1a5fb257.cil @@ -1,10 +1,11 @@ Summary: Make sure depends-on and precedes can --add and --commit -Status: New +Status: Finished CreatedBy: Andrew Chilton AssignedTo: Andrew Chilton Label: Milestone-v0.07 +Comment: 146b6b88 Inserted: 2010-01-24T10:36:07 -Updated: 2010-01-24T10:39:29 +Updated: 2010-01-24T11:14:40 We need to support the following: diff --git a/lib/CIL/Command/DependsOn.pm b/lib/CIL/Command/DependsOn.pm index 11bcec0..a312787 100644 --- a/lib/CIL/Command/DependsOn.pm +++ b/lib/CIL/Command/DependsOn.pm @@ -41,6 +41,18 @@ sub run { $issue->save($cil); $depends->save($cil); + + # if we want to add or commit this change + if ( $args->{add} or $args->{commit} ) { + $cil->vcs->add( $cil, $issue ); + $cil->vcs->add( $cil, $depends ); + } + + # if we want to commit this change + if ( $args->{commit} ) { + my $message = 'Issue ' . $issue->name . ' has a new dependent ' . $depends->name; + $cil->vcs->commit_multiple( $cil, $message, $issue, $depends ); + } } 1; diff --git a/lib/CIL/Command/Precedes.pm b/lib/CIL/Command/Precedes.pm index f28c020..42c4291 100644 --- a/lib/CIL/Command/Precedes.pm +++ b/lib/CIL/Command/Precedes.pm @@ -41,6 +41,18 @@ sub run { $issue->save($cil); $precedes->save($cil); + + # if we want to add or commit this change + if ( $args->{add} or $args->{commit} ) { + $cil->vcs->add( $cil, $issue ); + $cil->vcs->add( $cil, $precedes ); + } + + # if we want to commit this change + if ( $args->{commit} ) { + my $message = 'Issue ' . $issue->name . ' precedes ' . $precedes->name; + $cil->vcs->commit_multiple( $cil, $message, $issue, $precedes ); + } } 1;