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

Unified Diff: sdk/lib/_internal/pub/test/test_pub.dart

Issue 334363004: Gracefully handle a missing locked version in pub get. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 6 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/test/get/hosted/unlock_if_version_doesnt_exist_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/test/test_pub.dart
diff --git a/sdk/lib/_internal/pub/test/test_pub.dart b/sdk/lib/_internal/pub/test/test_pub.dart
index 2380ed31d10e97c22177401a1f972b7de5a88863..9160e75e011f845f49b0d3cd81f178f700f7534c 100644
--- a/sdk/lib/_internal/pub/test/test_pub.dart
+++ b/sdk/lib/_internal/pub/test/test_pub.dart
@@ -218,9 +218,10 @@ Map<String, List<Map>> _servedPackages;
/// [pubspecs] is a list of unserialized pubspecs representing the packages to
/// serve.
///
-/// Subsequent calls to [servePackages] will add to the set of packages that
-/// are being served. Previous packages will continue to be served.
-void servePackages(List<Map> pubspecs) {
+/// If [replace] is false, subsequent calls to [servePackages] will add to the
+/// set of packages that are being served. Previous packages will continue to be
+/// served. Otherwise, the previous packages will no longer be served.
+void servePackages(List<Map> pubspecs, {bool replace: false}) {
if (_servedPackages == null || _servedPackageDir == null) {
_servedPackages = <String, List<Map>>{};
_servedApiPackageDir = d.dir('packages', []);
@@ -239,6 +240,8 @@ void servePackages(List<Map> pubspecs) {
schedule(() {
return awaitObject(pubspecs).then((resolvedPubspecs) {
+ if (replace) _servedPackages.clear();
+
for (var spec in resolvedPubspecs) {
var name = spec['name'];
var version = spec['version'];
« no previous file with comments | « sdk/lib/_internal/pub/test/get/hosted/unlock_if_version_doesnt_exist_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698