]> git.mjollnir.org Git - cil.git/commitdiff
cil:1a5fb257: Fixed so that depends-on and precedes can both do --add and --commit
authorAndrew Chilton <andychilton@gmail.com>
Sun, 24 Jan 2010 11:15:16 +0000 (00:15 +1300)
committerAndrew Chilton <andychilton@gmail.com>
Sun, 24 Jan 2010 11:15:16 +0000 (00:15 +1300)
bin/cil
issues/c_146b6b88.cil [new file with mode: 0644]
issues/i_1a5fb257.cil
lib/CIL/Command/DependsOn.pm
lib/CIL/Command/Precedes.pm

diff --git a/bin/cil b/bin/cil
index baacfa3403f2a371b840bbc35979ce9f19ac2fb0..51d202b0eb096d4328c7bd523ff9304bcfbdbb99 100755 (executable)
--- 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 (file)
index 0000000..4b4c18e
--- /dev/null
@@ -0,0 +1,7 @@
+Issue: 1a5fb257
+CreatedBy: Andrew Chilton <andychilton@gmail.com>
+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.
index d0ea8b7474c7d9c11659c7a631345c74e107aada..779287628f64528284b7b5d2c4d728396566e667 100644 (file)
@@ -1,10 +1,11 @@
 Summary: Make sure depends-on and precedes can --add and --commit
-Status: New
+Status: Finished
 CreatedBy: Andrew Chilton <andychilton@gmail.com>
 AssignedTo: Andrew Chilton <andychilton@gmail.com>
 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:
 
index 11bcec0cfe88390f364def73d8855e784001d89e..a3127874e70bf63af29a75562624f99e329fb7cd 100644 (file)
@@ -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;
index f28c020bdf82a48d6fc4e22105b5fd602cb78fe9..42c42918063280ce1dc40cdbe7d6d19c1ed72e1d 100644 (file)
@@ -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;