1
0
Fork 0

Fix for #2494, don't retrieve svn log when the references don't contain a reference number.

pull/2728/head
Sandy Pleyte 2014-02-20 16:26:34 +01:00
parent 9896abeb38
commit 40095d980c
1 changed files with 12 additions and 6 deletions

View File

@ -144,6 +144,7 @@ class SvnDownloader extends VcsDownloader
*/
protected function getCommitLogs($fromReference, $toReference, $path)
{
if (preg_match('{.*@(\d+)$}', $fromReference) && preg_match('{.*@(\d+)$}', $toReference) ) {
// strip paths from references and only keep the actual revision
$fromRevision = preg_replace('{.*@(\d+)$}', '$1', $fromReference);
$toRevision = preg_replace('{.*@(\d+)$}', '$1', $toReference);
@ -151,7 +152,12 @@ class SvnDownloader extends VcsDownloader
$command = sprintf('svn log -r%s:%s --incremental', $fromRevision, $toRevision);
if (0 !== $this->process->execute($command, $output, $path)) {
throw new \RuntimeException('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput());
throw new \RuntimeException(
'Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput()
);
}
} else {
$output = "Couldn't retrieve changes with reference $fromReference:$toReference";
}
return $output;