diff --git a/src/Composer/Downloader/HgDownloader.php b/src/Composer/Downloader/HgDownloader.php index ccd81d354..090129411 100644 --- a/src/Composer/Downloader/HgDownloader.php +++ b/src/Composer/Downloader/HgDownloader.php @@ -38,7 +38,7 @@ class HgDownloader implements DownloaderInterface $url = escapeshellarg($package->getSourceUrl()); $ref = escapeshellarg($package->getSourceReference()); - system(sprintf('hg clone %s %s && cd %2$s && hg up %s', $url, $path, $ref)); + system(sprintf('(hg clone %s %s 2> /dev/null) && cd %2$s && hg up %s', $url, $path, $ref)); } /** diff --git a/src/Composer/Repository/Vcs/HgDriver.php b/src/Composer/Repository/Vcs/HgDriver.php index de9d51599..cee85066b 100644 --- a/src/Composer/Repository/Vcs/HgDriver.php +++ b/src/Composer/Repository/Vcs/HgDriver.php @@ -41,7 +41,7 @@ class HgDriver implements VcsDriverInterface if (is_dir($this->tmpDir)) { exec(sprintf('cd %s && hg pull -u', $tmpDir), $output); } else { - exec(sprintf('hg clone %s %s', $url, $tmpDir), $output); + exec(sprintf('cd %s && hg clone %s %s', escapeshellarg(sys_get_temp_dir()), $url, $tmpDir), $output); } $this->getTags(); @@ -179,7 +179,7 @@ class HgDriver implements VcsDriverInterface return false; } - exec(sprintf('hg identify %s', escapeshellarg($url)), $ignored, $exit); + exec(sprintf('cd %s && hg identify %s', escapeshellarg(sys_get_temp_dir()), escapeshellarg($url)), $ignored, $exit); return $exit === 0; } }