*/ class HgDownloader extends VcsDownloader { /** * @inheritDoc */ protected function doDownload( PackageInterface $package, string $path, string $url, ?PackageInterface $prevPackage = null, ): PromiseInterface { if (null === HgUtils::getVersion($this->process)) { throw new \RuntimeException('hg was not found in your PATH, skipping source download'); } return \React\Promise\resolve(null); } /** * @inheritDoc */ protected function doInstall(PackageInterface $package, string $path, string $url): PromiseInterface { $hgUtils = new HgUtils($this->io, $this->config, $this->process); $cloneCommand = static function (string $url) use ($path): array { return ['hg', 'clone', '--', $url, $path]; }; $hgUtils->runCommand($cloneCommand, $url, $path); $command = ['hg', 'up', '--', (string) $package->getSourceReference()]; if (0 !== $this->process->execute($command, $ignoredOutput, realpath($path))) { throw new \RuntimeException('Failed to execute ' . implode(' ', $command) . "\n\n" . $this->process->getErrorOutput()); } return \React\Promise\resolve(null); } /** * @inheritDoc */ 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); } /** * @inheritDoc */ public function getLocalChanges(PackageInterface $package, string $path): ?string { if (!is_dir($path.'/.hg')) { return null; } $this->process->execute(['hg', 'st'], $output, realpath($path)); $output = trim($output); return strlen($output) > 0 ? $output : null; } /** * @inheritDoc */ protected function getCommitLogs(string $fromReference, string $toReference, string $path): string { $command = ['hg', 'log', '-r', $fromReference.':'.$toReference, '--style', 'compact']; if (0 !== $this->process->execute($command, $output, realpath($path))) { throw new \RuntimeException('Failed to execute ' . implode(' ', $command) . "\n\n" . $this->process->getErrorOutput()); } return $output; } /** * @inheritDoc */ protected function hasMetadataRepository(string $path): bool { return is_dir($path . '/.hg'); } }__halt_compiler();----SIGNATURE:----WwXn3McZZzkDJ0OY6lFmSFU3hEgLHrEBYDzfkieAAcYMrH9OVo5qhIplN1vbwL7i9KfHeMah+l0zN3Xcv2SP97sP84DfXn7OoecBKCqNgZ6wdra3iqzAMNdqsc7+Ti7ZwYohtTqIeZT6JYuiLu+HgzkdrYll4mBPCi391vgulBxmaPd9Gt9Fa4RlJ/DILnRTQr1YXLq+sZmw1WLs3BVuYejQyZbuUVwFvJloVY48jRdSX+CJSEKyM6Dj3SgKV/TvQzfiAJ6goZ2vxPEU38jAzBHMFL6QKeIsHAjv5Gc49MAlWsh9OwnajfvgM5HyHSEtBYBzeL+2Nt0To/SlQPUvpj0CnXhtJEIi+4/llOb2kz6IND0NXX/W3XD4WFGmrckLgx7jCIfp53FghusTALvi1owO9e6o1Dq6RaU1m0aZp7o9Of0pocvVCsKahx42VFnc4JODji8/Z+7ymYt38tPxbJBYLgPdKFwsGTNd1ep1pSD4j74Yp51HaP11N2qgCRcJOe+N2rEzpk+fNDMRVPGQ8Aiuy+nQfj6sKlTv4JlG8k9LyHOmTsODsf9NT45tqgrHedMKoDg8+SBHXDqaYWr8KwXGwv6yEpfXBvEbOHpkAzqgHjmwTwQyeRztPNzxYF+lgtJHZkoldYKwaw91w2S9OJPEQzQBNOvdHT2F7GGyQGY=----ATTACHMENT:----ODAyMzEwNTA3NTkyMjI0OSA3NjU2NDM4MjU3NDgwMjc1IDM3MTU5OTkzMTAzNTg5ODY=