/** * Parse a commit. * * @param \Mesamatrix\Git\Commit $commit The commit to parse. */ protected function parseCommit(\Mesamatrix\Git\Commit $commit) { // Show content for this commit. $hash = $commit->getHash(); $cat = new \Mesamatrix\Git\ProcessBuilder(array('show', $hash . ':' . $this->gl3Path)); $proc = $cat->getProcess(); $this->getHelper('process')->mustRun($this->output, $proc); // Parse the content. \Mesamatrix::$logger->info('Parsing GL3.txt for commit ' . $hash); $parser = new OglParser(); $matrix = $parser->parseContent($proc->getOutput(), $commit); // Create the XML. $xml = new \SimpleXMLElement("<mesa></mesa>"); // Write commit info. $xmlCommit = $xml->addChild('commit'); $xmlCommit->addChild('hash', $hash); //$xmlCommit->addChild('subject', $commit->getSubject()); $xmlCommit->addChild('author', $commit->getAuthor()); $xmlCommit->addChild('committer-date', $commit->getCommitterDate()->format(\DateTime::W3C)); $xmlCommit->addChild('committer-name', $commit->getCommitter()); // Write GL sections. $this->generateGlSections($xml, $matrix); // Write file. $xmlPath = \Mesamatrix::path(\Mesamatrix::$config->getValue('info', 'private_dir')) . '/commits/commit_' . $hash . '.xml'; $dom = dom_import_simplexml($xml)->ownerDocument; $dom->formatOutput = true; file_put_contents($xmlPath, $dom->saveXML()); \Mesamatrix::$logger->info('XML saved to ' . $xmlPath); }
protected function execute(InputInterface $input, OutputInterface $output) { $fetch = new \Mesamatrix\Git\ProcessBuilder(array('fetch', '-f', 'origin', 'master:master')); $this->getHelper('process')->mustRun($output, $fetch->getProcess()); }
protected function execute(InputInterface $input, OutputInterface $output) { $git = new \Mesamatrix\Git\ProcessBuilder(array('clone', '--bare', '--depth', \Mesamatrix::$config->getValue('git', 'depth', 6000), \Mesamatrix::$config->getValue('git', 'mesa_url'), '@gitDir@')); $this->getHelper('process')->mustRun($output, $git->getProcess()); }