1
0
Fork 0

Merge pull request #9667 from arnaudvanwambeke/dont-recommend-with-all-dependencies

Fixes #9665
pull/9669/head
Jordi Boggiano 2021-02-04 09:25:42 +01:00 committed by GitHub
commit 03dcb6df3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 51 additions and 1 deletions

View File

@ -63,7 +63,7 @@ class SolverProblemsException extends \RuntimeException
$hints[] = $this->createExtensionHint(); $hints[] = $this->createExtensionHint();
} }
if ($isCausedByLock && !$isDevExtraction) { if ($isCausedByLock && !$isDevExtraction && !$request->getUpdateAllowTransitiveRootDependencies()) {
$hints[] = "Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions."; $hints[] = "Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.";
} }

View File

@ -0,0 +1,50 @@
--TEST--
Verify that a conflict with all dependencies option enabled don't recommend to use the option
--COMPOSER--
{
"repositories": [
{
"type": "package",
"package": [
{ "name": "locked/pkg", "version": "dev-master", "require": {"locked/dependency": "1.0.0"}, "default-branch": true }
]
}
],
"require": {
"locked/pkg": "*@dev"
}
}
--LOCK--
{
"packages": [
{ "name": "locked/pkg", "version": "dev-master", "require": {"locked/dependency": "1.0.0"}, "default-branch": true },
{ "name": "locked/dependency", "version": "1.0.0" }
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "dev",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": []
}
--RUN--
update locked/dependency --with-all-dependencies
--EXPECT-EXIT-CODE--
2
--EXPECT-OUTPUT--
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- locked/pkg dev-master requires locked/dependency 1.0.0 -> found locked/dependency[1.0.0] in lock file but not in remote repositories, make sure you avoid updating this package to keep the one from lock file.
- locked/pkg is locked to version dev-master and an update of this package was not requested.
--EXPECT--