Skip to content

Commit

Permalink
Removed HgBitbucketDriver support (#10248)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaeldealmeida committed Nov 10, 2021
1 parent ba5b7a5 commit 150acc5
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 103 deletions.
5 changes: 3 additions & 2 deletions doc/05-repositories.md
Expand Up @@ -400,8 +400,8 @@ VCS repository provides `dist`s for them that fetch the packages as zips.
* **BitBucket:** [bitbucket.org](https://bitbucket.org) (Git and Mercurial)

The VCS driver to be used is detected automatically based on the URL. However,
should you need to specify one for whatever reason, you can use `git-bitbucket`,
`hg-bitbucket`, `github`, `gitlab`, `perforce`, `fossil`, `git`, `svn` or `hg`
should you need to specify one for whatever reason, you can use `bitbucket`,
`github`, `gitlab`, `perforce`, `fossil`, `git`, `svn` or `hg`
as the repository type instead of `vcs`.

If you set the `no-api` key to `true` on a github repository it will clone the
Expand All @@ -412,6 +412,7 @@ attempt to use github's zip files.
Please note:
* **To let Composer choose which driver to use** the repository type needs to be defined as "vcs"
* **If you already used a private repository**, this means Composer should have cloned it in cache. If you want to install the same package with drivers, remember to launch the command `composer clearcache` followed by the command `composer update` to update Composer cache and install the package from dist.
* VCS driver `git-bitbucket` is deprecated in favor of `bitbucket`

#### BitBucket Driver Configuration

Expand Down
2 changes: 1 addition & 1 deletion res/composer-schema.json
Expand Up @@ -701,7 +701,7 @@
"type": "object",
"required": ["type", "url"],
"properties": {
"type": { "type": "string", "enum": ["vcs", "github", "git", "gitlab", "git-bitbucket", "hg", "hg-bitbucket", "fossil", "perforce", "svn"] },
"type": { "type": "string", "enum": ["vcs", "github", "git", "gitlab", "bitbucket", "git-bitbucket", "hg", "fossil", "perforce", "svn"] },
"url": { "type": "string" },
"canonical": { "type": "boolean" },
"only": {
Expand Down
2 changes: 1 addition & 1 deletion src/Composer/Repository/RepositoryFactory.php
Expand Up @@ -125,14 +125,14 @@ public static function manager(IOInterface $io, Config $config, HttpDownloader $
$rm->setRepositoryClass('package', 'Composer\Repository\PackageRepository');
$rm->setRepositoryClass('pear', 'Composer\Repository\PearRepository');
$rm->setRepositoryClass('git', 'Composer\Repository\VcsRepository');
$rm->setRepositoryClass('bitbucket', 'Composer\Repository\VcsRepository');
$rm->setRepositoryClass('git-bitbucket', 'Composer\Repository\VcsRepository');
$rm->setRepositoryClass('github', 'Composer\Repository\VcsRepository');
$rm->setRepositoryClass('gitlab', 'Composer\Repository\VcsRepository');
$rm->setRepositoryClass('svn', 'Composer\Repository\VcsRepository');
$rm->setRepositoryClass('fossil', 'Composer\Repository\VcsRepository');
$rm->setRepositoryClass('perforce', 'Composer\Repository\VcsRepository');
$rm->setRepositoryClass('hg', 'Composer\Repository\VcsRepository');
$rm->setRepositoryClass('hg-bitbucket', 'Composer\Repository\VcsRepository');
$rm->setRepositoryClass('artifact', 'Composer\Repository\ArtifactRepository');
$rm->setRepositoryClass('path', 'Composer\Repository\PathRepository');

Expand Down
3 changes: 2 additions & 1 deletion src/Composer/Repository/Vcs/GitBitbucketDriver.php
Expand Up @@ -41,7 +41,8 @@ public function getRootIdentifier()
if ($this->vcsType !== 'git') {
throw new \RuntimeException(
$this->url.' does not appear to be a git repository, use '.
$this->cloneHttpsUrl.' if this is a mercurial bitbucket repository'
$this->cloneHttpsUrl.' but remember that Bitbucket no longer supports the mercurial repositories. '.
'https://bitbucket.org/blog/sunsetting-mercurial-support-in-bitbucket'
);
}

Expand Down
95 changes: 0 additions & 95 deletions src/Composer/Repository/Vcs/HgBitbucketDriver.php

This file was deleted.

2 changes: 1 addition & 1 deletion src/Composer/Repository/VcsRepository.php
Expand Up @@ -79,9 +79,9 @@ public function __construct(array $repoConfig, IOInterface $io, Config $config,
$this->drivers = $drivers ?: array(
'github' => 'Composer\Repository\Vcs\GitHubDriver',
'gitlab' => 'Composer\Repository\Vcs\GitLabDriver',
'bitbucket' => 'Composer\Repository\Vcs\GitBitbucketDriver',
'git-bitbucket' => 'Composer\Repository\Vcs\GitBitbucketDriver',
'git' => 'Composer\Repository\Vcs\GitDriver',
'hg-bitbucket' => 'Composer\Repository\Vcs\HgBitbucketDriver',
'hg' => 'Composer\Repository\Vcs\HgDriver',
'perforce' => 'Composer\Repository\Vcs\PerforceDriver',
'fossil' => 'Composer\Repository\Vcs\FossilDriver',
Expand Down
2 changes: 1 addition & 1 deletion tests/Composer/Test/Repository/RepositoryFactoryTest.php
Expand Up @@ -36,14 +36,14 @@ public function testManagerWithAllRepositoryTypes()
'package',
'pear',
'git',
'bitbucket',
'git-bitbucket',
'github',
'gitlab',
'svn',
'fossil',
'perforce',
'hg',
'hg-bitbucket',
'artifact',
'path',
), array_keys($repositoryClasses));
Expand Down
Expand Up @@ -84,7 +84,7 @@ public function testGetRootIdentifierWrongScmType()
{
$this->setExpectedException(
'\RuntimeException',
'https://bitbucket.org/user/repo.git does not appear to be a git repository, use https://bitbucket.org/user/repo if this is a mercurial bitbucket repository'
'https://bitbucket.org/user/repo.git does not appear to be a git repository, use https://bitbucket.org/user/repo but remember that Bitbucket no longer supports the mercurial repositories. https://bitbucket.org/blog/sunsetting-mercurial-support-in-bitbucket'
);

$this->httpDownloader->expects($this->once())
Expand Down

0 comments on commit 150acc5

Please sign in to comment.