Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(652)

Unified Diff: sdk/lib/_internal/pub/lib/src/command/downgrade.dart

Issue 365993007: Support "pub downgrade". (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/command.dart ('k') | sdk/lib/_internal/pub/lib/src/command/get.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.");
}
});
}
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/command.dart ('k') | sdk/lib/_internal/pub/lib/src/command/get.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698