public function getLog($limit = null, $skip = null)
{
$arguments = array('--xml', '--revision' => 'HEAD:0');
$skip = $skip === null ? 0 : (int) $skip;
if ($limit !== null) {
$arguments['--limit'] = (int) ($limit + $skip);
}
/** @var $result CallResult */
$result = $this->getSvn()->{'log'}($this->getRepositoryPath(), $arguments);
$result->assertSuccess(sprintf('Cannot retrieve log from "%s"', $this->getRepositoryPath()));
$xml = simplexml_load_string($result->getStdOut());
if (!$xml) {
throw new \RuntimeException(sprintf('Cannot read log XML for "%s"', $this->getRepositoryPath()));
}
$logEntries = new \ArrayIterator($xml->xpath('/log/logentry'));
if ($limit !== null) {
$logEntries = new \LimitIterator($logEntries, $skip, $limit);
}
$log = array();
foreach ($logEntries as $item) {
$log[] = array((string) $item['revision'], (string) $item->author, (string) $item->date, (string) $item->msg);
}
return $log;
}