/** * Commit info * * @param null * @return void */ function commit() { if (!$this->active_repository->canView($this->logged_user)) { $this->httpError(HTTP_ERR_FORBIDDEN); } // if if (!instance_of($this->active_commit, 'Commit')) { $this->httpError(HTTP_ERR_NOT_FOUND); } // if $this->wireframe->addPageAction(lang('Revision history'), $this->active_repository->getHistoryUrl()); $this->wireframe->addPageAction(lang('Browse repository'), $this->active_repository->getBrowseUrl()); $grouped_paths = RepositoryEngine::groupPaths($this->active_commit->getPaths()); ksort($grouped_paths); $diff = $this->active_commit->getDiff(); if (!is_array($diff)) { $diff = $this->repository_engine->getCommitDiff($this->active_revision, $this->active_file); if (is_array($diff)) { $this->active_commit->setDiff($diff); $this->active_commit->setCreatedBy(new AnonymousUser($this->active_commit->getCreatedByName(), '*****@*****.**')); $save = $this->active_commit->save(); } else { flash_error("Unable to retrieve diff information for selected commit"); $this->redirectToReferer(source_module_url($this->active_project)); } // if } // if $parsed = $this->repository_engine->parseDiff($diff); if (is_foreachable($parsed)) { for ($x = 0; $x < count($parsed); $x++) { $filename = substr($parsed[$x]['file'], 0, 1) == '/' ? substr($parsed[$x]['file'], 1) : '/' . $parsed[$x]['file']; if (!in_array($filename, $grouped_paths[SOURCE_MODULE_STATE_MODIFIED])) { unset($parsed[$x]); } // if } // for } // if $parsed = array_values($parsed); ProjectObjectViews::log($this->active_commit, $this->logged_user); $this->smarty->assign(array('grouped_paths' => $grouped_paths, 'diff' => $parsed)); }