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

Side by Side Diff: utils/pub/git_source.dart

Issue 11090016: Change core lib, dart2js, and more for new optional parameters syntax (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « utils/pub/git.dart ('k') | utils/pub/hosted_source.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library git_source; 5 library git_source;
6 6
7 import 'git.dart' as git; 7 import 'git.dart' as git;
8 import 'io.dart'; 8 import 'io.dart';
9 import 'package.dart'; 9 import 'package.dart';
10 import 'source.dart'; 10 import 'source.dart';
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 if (ref == 'HEAD') return new Future.immediate(null); 59 if (ref == 'HEAD') return new Future.immediate(null);
60 return _checkOut(revisionCachePath, ref); 60 return _checkOut(revisionCachePath, ref);
61 }).chain((_) { 61 }).chain((_) {
62 return Package.load(id.name, revisionCachePath, systemCache.sources); 62 return Package.load(id.name, revisionCachePath, systemCache.sources);
63 }); 63 });
64 } 64 }
65 65
66 /** 66 /**
67 * Ensures [description] is a Git URL. 67 * Ensures [description] is a Git URL.
68 */ 68 */
69 void validateDescription(description, [bool fromLockFile = false]) { 69 void validateDescription(description, {bool fromLockFile: false}) {
70 // A single string is assumed to be a Git URL. 70 // A single string is assumed to be a Git URL.
71 if (description is String) return; 71 if (description is String) return;
72 if (description is! Map || !description.containsKey('url')) { 72 if (description is! Map || !description.containsKey('url')) {
73 throw new FormatException("The description must be a Git URL or a map " 73 throw new FormatException("The description must be a Git URL or a map "
74 "with a 'url' key."); 74 "with a 'url' key.");
75 } 75 }
76 description = new Map.from(description); 76 description = new Map.from(description);
77 description.remove('url'); 77 description.remove('url');
78 description.remove('ref'); 78 description.remove('ref');
79 if (fromLockFile) description.remove('resolved-ref'); 79 if (fromLockFile) description.remove('resolved-ref');
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 217
218 /** 218 /**
219 * Returns [description] if it's a description, or [PackageId.description] if 219 * Returns [description] if it's a description, or [PackageId.description] if
220 * it's a [PackageId]. 220 * it's a [PackageId].
221 */ 221 */
222 _getDescription(description) { 222 _getDescription(description) {
223 if (description is PackageId) return description.description; 223 if (description is PackageId) return description.description;
224 return description; 224 return description;
225 } 225 }
226 } 226 }
OLDNEW
« no previous file with comments | « utils/pub/git.dart ('k') | utils/pub/hosted_source.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698