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

Unified Diff: utils/pub/git_source.dart

Issue 12280019: Revert "Support relative paths in path dependencies." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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 | « utils/pub/entrypoint.dart ('k') | utils/pub/hosted_source.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/git_source.dart
diff --git a/utils/pub/git_source.dart b/utils/pub/git_source.dart
index 56425e7d7e0c201df4091d541684b03bd84d5890..fdb0ed4828c8e9ebcc35ea2ebceadab57f4136ed 100644
--- a/utils/pub/git_source.dart
+++ b/utils/pub/git_source.dart
@@ -10,7 +10,6 @@ import '../../pkg/path/lib/path.dart' as path;
import 'git.dart' as git;
import 'io.dart';
-import 'log.dart' as log;
import 'package.dart';
import 'source.dart';
import 'source_registry.dart';
@@ -68,33 +67,24 @@ class GitSource extends Source {
return path.join(systemCacheRoot, revisionCacheName);
});
}
-
/// Ensures [description] is a Git URL.
- dynamic parseDescription(String containingPath, description,
- {bool fromLockFile: false}) {
- // TODO(rnystrom): Handle git URLs that are relative file paths (#8570).
+ void validateDescription(description, {bool fromLockFile: false}) {
// A single string is assumed to be a Git URL.
- // TODO(rnystrom): Now that this function can modify the description, it
- // may as well canonicalize it to a map so that other code in the source
- // can assume that.
- if (description is String) return description;
+ if (description is String) return;
if (description is! Map || !description.containsKey('url')) {
throw new FormatException("The description must be a Git URL or a map "
"with a 'url' key.");
}
-
- var parsed = new Map.from(description);
- parsed.remove('url');
- parsed.remove('ref');
- if (fromLockFile) parsed.remove('resolved-ref');
-
- if (!parsed.isEmpty) {
- var plural = parsed.length > 1;
- var keys = parsed.keys.join(', ');
+ description = new Map.from(description);
+ description.remove('url');
+ description.remove('ref');
+ if (fromLockFile) description.remove('resolved-ref');
+
+ if (!description.isEmpty) {
+ var plural = description.length > 1;
+ var keys = description.keys.join(', ');
throw new FormatException("Invalid key${plural ? 's' : ''}: $keys.");
}
-
- return description;
}
/// Two Git descriptions are equal if both their URLs and their refs are
« no previous file with comments | « utils/pub/entrypoint.dart ('k') | utils/pub/hosted_source.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698