Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. HgDownloader.php

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\Downloader

Code

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);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal