1
0
Fork 0

Fail hard when failing to download using hg

pull/501/head
Jordi Boggiano 2012-03-26 13:22:05 +02:00
parent 7cb79bb1c9
commit 5be7f4cf09
1 changed files with 8 additions and 2 deletions

View File

@ -29,7 +29,10 @@ class HgDownloader extends VcsDownloader
$ref = escapeshellarg($package->getSourceReference()); $ref = escapeshellarg($package->getSourceReference());
$path = escapeshellarg($path); $path = escapeshellarg($path);
$this->io->write(" Cloning ".$package->getSourceReference()); $this->io->write(" Cloning ".$package->getSourceReference());
$this->process->execute(sprintf('hg clone %s %s && cd %2$s && hg up %s', $url, $path, $ref), $ignoredOutput); $command = sprintf('hg clone %s %s && cd %2$s && hg up %s', $url, $path, $ref);
if (0 !== $this->process->execute($command, $ignoredOutput)) {
throw new \RuntimeException('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput());
}
} }
/** /**
@ -41,7 +44,10 @@ class HgDownloader extends VcsDownloader
$ref = escapeshellarg($target->getSourceReference()); $ref = escapeshellarg($target->getSourceReference());
$path = escapeshellarg($path); $path = escapeshellarg($path);
$this->io->write(" Updating to ".$target->getSourceReference()); $this->io->write(" Updating to ".$target->getSourceReference());
$this->process->execute(sprintf('cd %s && hg pull %s && hg up %s', $path, $url, $ref), $ignoredOutput); $command = sprintf('cd %s && hg pull %s && hg up %s', $path, $url, $ref);
if (0 !== $this->process->execute($command, $ignoredOutput)) {
throw new \RuntimeException('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput());
}
} }
/** /**