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

Unified Diff: sdk/lib/_internal/pub/lib/src/entrypoint.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
Index: sdk/lib/_internal/pub/lib/src/entrypoint.dart
diff --git a/sdk/lib/_internal/pub/lib/src/entrypoint.dart b/sdk/lib/_internal/pub/lib/src/entrypoint.dart
index c866d60eab116e4c1180de96b1750a7bb27c732b..4bfa1f0cc102a42686662aface3d8f1e38333540 100644
--- a/sdk/lib/_internal/pub/lib/src/entrypoint.dart
+++ b/sdk/lib/_internal/pub/lib/src/entrypoint.dart
@@ -79,6 +79,8 @@ class Entrypoint {
/// Gets all dependencies of the [root] package.
///
+ /// Performs version resolution according to [SolveType].
+ ///
/// [useLatest], if provided, defines a list of packages that will be
/// unlocked and forced to their latest versions. If [upgradeAll] is
/// true, the previous lockfile is ignored and all packages are re-resolved
@@ -86,21 +88,21 @@ class Entrypoint {
/// previously locked packages.
///
/// Shows a report of the changes made relative to the previous lockfile. If
- /// [isUpgrade] is `true`, all transitive dependencies are shown in the
- /// report. Otherwise, only dependencies that were changed are shown. If
+ /// this is an upgrade or downgrade, all transitive dependencies are shown in
+ /// the report. Otherwise, only dependencies that were changed are shown. If
/// [dryRun] is `true`, no physical changes are made.
- Future acquireDependencies({List<String> useLatest, bool isUpgrade: false,
+ Future acquireDependencies(SolveType type, {List<String> useLatest,
bool dryRun: false}) {
return syncFuture(() {
- return resolveVersions(cache.sources, root, lockFile: lockFile,
+ return resolveVersions(type, cache.sources, root, lockFile: lockFile,
useLatest: useLatest, upgradeAll: isUpgrade && useLatest.isEmpty);
}).then((result) {
if (!result.succeeded) throw result.error;
- result.showReport(isUpgrade: isUpgrade);
+ result.showReport(type);
if (dryRun) {
- result.summarizeChanges(isUpgrade: isUpgrade, dryRun: dryRun);
+ result.summarizeChanges(type, dryRun: dryRun);
return null;
}
@@ -110,7 +112,7 @@ class Entrypoint {
_saveLockFile(ids);
_linkSelf();
_linkSecondaryPackageDirs();
- result.summarizeChanges(isUpgrade: isUpgrade, dryRun: dryRun);
+ result.summarizeChanges(type, dryRun: dryRun);
});
});
}
@@ -211,7 +213,7 @@ class Entrypoint {
});
}).then((upToDate) {
if (upToDate) return null;
- return acquireDependencies();
+ return acquireDependencies(SolveType.GET);
});
}
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/command/upgrade.dart ('k') | sdk/lib/_internal/pub/lib/src/global_packages.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698