From a2026faf10828d79e6c0e09bca82f40cfe3eec0c Mon Sep 17 00:00:00 2001 From: Sigurd Meldgaard Date: Fri, 4 Oct 2024 13:18:46 +0000 Subject: [PATCH] Rename flag to --unlock-transitive --- lib/src/command/upgrade.dart | 4 ++-- test/upgrade/upgrade_transitive_test.dart | 15 ++++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/src/command/upgrade.dart b/lib/src/command/upgrade.dart index 1c01237ee..c0092b201 100644 --- a/lib/src/command/upgrade.dart +++ b/lib/src/command/upgrade.dart @@ -71,7 +71,7 @@ class UpgradeCommand extends PubCommand { ); argParser.addFlag( - 'transitive', + 'unlock-transitive', help: 'Also upgrades the transitive dependencies ' 'of the listed [dependencies]', ); @@ -115,7 +115,7 @@ class UpgradeCommand extends PubCommand { /// This allows the user to specify list of names that they want the /// upgrade command to affect. Future> _computePackagesToUpgrade() async { - if (argResults.flag('transitive')) { + if (argResults.flag('unlock-transitive')) { final graph = await entrypoint.packageGraph; return argResults.rest .expand( diff --git a/test/upgrade/upgrade_transitive_test.dart b/test/upgrade/upgrade_transitive_test.dart index 38b8e6ab3..410b27369 100644 --- a/test/upgrade/upgrade_transitive_test.dart +++ b/test/upgrade/upgrade_transitive_test.dart @@ -8,7 +8,7 @@ import '../descriptor.dart' as d; import '../test_pub.dart'; void main() { - test('without --transitive, the transitive dependencies stay locked', + test('without --unlock-transitive, the transitive dependencies stay locked', () async { final server = await servePackages(); server.serve('foo', '1.0.0', deps: {'bar': '^1.0.0'}); @@ -34,7 +34,7 @@ void main() { ); }); - test('`--transitive` dependencies gets unlocked', () async { + test('`--unlock-transitive` dependencies gets unlocked', () async { final server = await servePackages(); server.serve('foo', '1.0.0', deps: {'bar': '^1.0.0'}); server.serve('bar', '1.0.0'); @@ -54,7 +54,7 @@ void main() { server.serve('baz', '1.5.0'); await pubUpgrade( - args: ['--transitive', 'foo'], + args: ['--unlock-transitive', 'foo'], output: allOf( contains('> foo 1.5.0'), contains('> bar 1.5.0'), @@ -66,8 +66,9 @@ void main() { }); test( - '`--major-versions` without `--transitive` does not allow transitive ' - 'dependencies to be upgraded along with the named packages', () async { + '`--major-versions` without `--unlock-transitive` does not allow ' + 'transitive dependencies to be upgraded along with the named packages', + () async { final server = await servePackages(); server.serve('foo', '1.0.0', deps: {'bar': '^1.0.0'}); server.serve('bar', '1.0.0'); @@ -93,7 +94,7 @@ void main() { }); test( - '`--transitive --major-versions` allows transitive dependencies ' + '`--unlock-transitive --major-versions` allows transitive dependencies ' 'be upgraded along with the named packages', () async { final server = await servePackages(); server.serve('foo', '1.0.0', deps: {'bar': '^1.0.0'}); @@ -114,7 +115,7 @@ void main() { server.serve('baz', '1.5.0'); await pubUpgrade( - args: ['--major-versions', '--transitive', 'foo'], + args: ['--major-versions', '--unlock-transitive', 'foo'], output: allOf( contains('> foo 2.0.0'), contains('> bar 1.5.0'),