/** * Parse the Xml result from Subversion * * @param string $output * @param array $arguments * @return array */ protected function parseDiffOutput($output, array $arguments = array()) { if (!isset($arguments['--xml']) || false === $arguments['--xml']) { // non xml results are not supported return $output; } if (!isset($arguments['--summarize']) || false === $arguments['--summarize']) { // non summarized results are not supported return $output; } $sxml = simplexml_load_string($output); $retval = array(); foreach ($sxml->xpath('//path') as $item) { $url = (string) $item; $path = ltrim(str_replace($this->client->getSvnUrl(''), '', $url), '/'); // @todo move to a Mapper class? $status = (string) $item->attributes()->item; switch ($status) { case "modified": $status = Status::MODIFIED; break; case "added": $status = Status::ADDED; break; case "deleted": $status = Status::DELETED; break; } $file = new VcsFileInfo($path, $this->getClient()->getHead()); $file->setStatus($status); $retval[] = $file; } return $retval; }
/** * Perform a checkout * * @throws NotFoundException */ public function checkout() { $this->svn->execute('checkout', array($this->svn->getSvnUrl(''), $this->cwd)); }