| Index: sdk/lib/_internal/pub/lib/src/command/downgrade.dart
|
| diff --git a/sdk/lib/_internal/pub/lib/src/command/upgrade.dart b/sdk/lib/_internal/pub/lib/src/command/downgrade.dart
|
| similarity index 54%
|
| copy from sdk/lib/_internal/pub/lib/src/command/upgrade.dart
|
| copy to sdk/lib/_internal/pub/lib/src/command/downgrade.dart
|
| index e8b6ad0bbba9a579a8a4544ed25cd73e6bc11468..94e8fc6c056d3442c6937f47857e9d648ae559a8 100644
|
| --- a/sdk/lib/_internal/pub/lib/src/command/upgrade.dart
|
| +++ b/sdk/lib/_internal/pub/lib/src/command/downgrade.dart
|
| @@ -2,25 +2,25 @@
|
| // for details. All rights reserved. Use of this source code is governed by a
|
| // BSD-style license that can be found in the LICENSE file.
|
|
|
| -library pub.command.upgrade;
|
| +library pub.command.downgrade;
|
|
|
| import 'dart:async';
|
|
|
| import '../command.dart';
|
| import '../log.dart' as log;
|
| +import '../solver/version_solver.dart';
|
|
|
| -/// Handles the `upgrade` pub command.
|
| -class UpgradeCommand extends PubCommand {
|
| +/// Handles the `downgrade` pub command.
|
| +class DowngradeCommand extends PubCommand {
|
| String get description =>
|
| - "Upgrade the current package's dependencies to latest versions.";
|
| - String get usage => "pub upgrade [dependencies...]";
|
| - String get docUrl => "http://dartlang.org/tools/pub/cmd/pub-upgrade.html";
|
| - List<String> get aliases => const ["update"];
|
| + "Downgrade the current package's dependencies to oldest versions.\n\n"
|
| + "This doesn't modify the lockfile, so it can be reset with \"pub get\".";
|
| + String get usage => "pub downgrade [dependencies...]";
|
| bool get takesArguments => true;
|
|
|
| bool get isOffline => commandOptions['offline'];
|
|
|
| - UpgradeCommand() {
|
| + DowngradeCommand() {
|
| commandParser.addFlag('offline',
|
| help: 'Use cached packages instead of accessing the network.');
|
|
|
| @@ -30,11 +30,11 @@ class UpgradeCommand extends PubCommand {
|
|
|
| Future onRun() {
|
| var dryRun = commandOptions['dry-run'];
|
| - return entrypoint.acquireDependencies(useLatest: commandOptions.rest,
|
| - isUpgrade: true, dryRun: dryRun).then((_) {
|
| + return entrypoint.acquireDependencies(SolveType.DOWNGRADE,
|
| + useLatest: commandOptions.rest, dryRun: dryRun).then((_) {
|
| if (isOffline) {
|
| - log.warning("Warning: Upgrading when offline may not update you to the "
|
| - "latest versions of your dependencies.");
|
| + log.warning("Warning: Downgrading when offline may not update you to "
|
| + "the oldest versions of your dependencies.");
|
| }
|
| });
|
| }
|
|
|