|
@@ -28,10 +28,14 @@ class HgDownloader extends VcsDownloader
|
|
|
$ref = escapeshellarg($package->getSourceReference());
|
|
|
$path = escapeshellarg($path);
|
|
|
$this->io->write(" Cloning ".$package->getSourceReference());
|
|
|
- $command = sprintf('hg clone %s %s && cd %2$s && hg up %s', $url, $path, $ref);
|
|
|
+ $command = sprintf('hg clone %s %s', $url, $path);
|
|
|
if (0 !== $this->process->execute($command, $ignoredOutput)) {
|
|
|
throw new \RuntimeException('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput());
|
|
|
}
|
|
|
+ $command = sprintf('hg up %s', $ref);
|
|
|
+ if (0 !== $this->process->execute($command, $ignoredOutput, $path)) {
|
|
|
+ throw new \RuntimeException('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -43,8 +47,8 @@ class HgDownloader extends VcsDownloader
|
|
|
$ref = escapeshellarg($target->getSourceReference());
|
|
|
$path = escapeshellarg($path);
|
|
|
$this->io->write(" Updating to ".$target->getSourceReference());
|
|
|
- $command = sprintf('cd %s && hg pull %s && hg up %s', $path, $url, $ref);
|
|
|
- if (0 !== $this->process->execute($command, $ignoredOutput)) {
|
|
|
+ $command = sprintf('hg pull %s && hg up %s', $url, $ref);
|
|
|
+ if (0 !== $this->process->execute($command, $ignoredOutput, $path)) {
|
|
|
throw new \RuntimeException('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput());
|
|
|
}
|
|
|
}
|
|
@@ -58,7 +62,7 @@ class HgDownloader extends VcsDownloader
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- $this->process->execute(sprintf('cd %s && hg st', escapeshellarg($path)), $output);
|
|
|
+ $this->process->execute('hg st', $output, $path);
|
|
|
|
|
|
return trim($output) ?: null;
|
|
|
}
|
|
@@ -68,9 +72,9 @@ class HgDownloader extends VcsDownloader
|
|
|
*/
|
|
|
protected function getCommitLogs($fromReference, $toReference, $path)
|
|
|
{
|
|
|
- $command = sprintf('cd %s && hg log -r %s:%s --style compact', escapeshellarg($path), $fromReference, $toReference);
|
|
|
+ $command = sprintf('hg log -r %s:%s --style compact', $fromReference, $toReference);
|
|
|
|
|
|
- if (0 !== $this->process->execute($command, $output)) {
|
|
|
+ if (0 !== $this->process->execute($command, $output, $path)) {
|
|
|
throw new \RuntimeException('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput());
|
|
|
}
|
|
|
|