function HgDownloader::doUpdate
@inheritDoc
Overrides VcsDownloader::doUpdate
File
-
vendor/
composer/ composer/ src/ Composer/ Downloader/ HgDownloader.php, line 61
Class
- HgDownloader
- @author Per Bernhardt <plb@webfactory.de>
Namespace
Composer\DownloaderCode
protected function doUpdate(PackageInterface $initial, PackageInterface $target, string $path, string $url) : PromiseInterface {
$hgUtils = new HgUtils($this->io, $this->config, $this->process);
$ref = $target->getSourceReference();
$this->io
->writeError(" Updating to " . $target->getSourceReference());
if (!$this->hasMetadataRepository($path)) {
throw new \RuntimeException('The .hg directory is missing from ' . $path . ', see https://getcomposer.org/commit-deps for more information');
}
$command = static function ($url) : array {
return [
'hg',
'pull',
'--',
$url,
];
};
$hgUtils->runCommand($command, $url, $path);
$command = static function () use ($ref) : array {
return [
'hg',
'up',
'--',
$ref,
];
};
$hgUtils->runCommand($command, $url, $path);
return \React\Promise\resolve(null);
}