diff --git a/lib/scm/scm.class.php b/lib/scm/scm.class.php index da6dbb7a96..99bf05df51 100644 --- a/lib/scm/scm.class.php +++ b/lib/scm/scm.class.php @@ -82,6 +82,7 @@ class scm * @param string $comment * @param array $allCommands * @access public + * @return array */ public function parseComment($comment, &$allCommands) { @@ -89,6 +90,10 @@ class scm $matches = array(); preg_match_all($pattern, $comment,$matches); + $stories = array(); + $tasks = array(); + $bugs = array(); + if(count($matches) > 1 && count($matches[1]) > 0) { $i = 0; @@ -103,12 +108,23 @@ class scm $currArr = []; } $newArr = explode(",", $entityIds); - $allCommands[$entityType][$action] = array_keys(array_flip($currArr) + array_flip($newArr)); + if ($action === 'story') { + $stories = array_merge($stories, $newArr); + } + if ($action === 'task') { + $tasks = array_merge($tasks, $newArr); + } + if ($action === 'bug') { + $bugs = array_merge($bugs, $newArr); + } + $i++; } } + + return array('stories' => join(',', $stories), 'tasks' => join(',', $tasks), 'bugs' => join(',', $bugs)); } /** @@ -135,33 +151,6 @@ class scm $jobToBuild = array_keys(array_flip($taskToBuild) + array_flip($newArr)); } } - - /** - * Parse the actions from comment. - * - * @param array $allCommands - * @access public - * - * @return array - */ - public function parseAction($allCommands) - { - $stories = array(); - $tasks = array(); - $bugs = array(); - - foreach ($allCommands['story'] as $action => $idArr) { - $stories = array_merge($stories, $idArr); - } - foreach ($allCommands['task'] as $action => $idArr) { - $tasks = array_merge($tasks, $idArr); - } - foreach ($allCommands['bug'] as $action => $idArr) { - $bugs = array_merge($bugs, $idArr); - } - - return array('stories' => join(',', $stories), 'tasks' => join(',', $tasks), 'bugs' => join(',', $bugs)); - } } function escapeCmd($cmd) diff --git a/module/svn/model.php b/module/svn/model.php index 8306cdfb04..edf1a4abeb 100644 --- a/module/svn/model.php +++ b/module/svn/model.php @@ -112,7 +112,6 @@ class svnModel extends model $scm = $this->app->loadClass('scm'); $objects = $scm->parseComment($log->msg, $allCommands); - $objects = $this->parseComment($log->msg); if($objects) { $this->printLog('extract' .