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

Unified Diff: utils/pub/git_source.dart

Issue 12171002: Tweak SDK constraint checking a bit. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Clean up Package and Pubspec a bit. Created 7 years, 11 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/package.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 b53c7257ad6d78431ffcd11a9807f3d478cef8c4..f37db918ecf72b79012ecd97f221ddf369d4308b 100644
--- a/utils/pub/git_source.dart
+++ b/utils/pub/git_source.dart
@@ -44,8 +44,7 @@ class GitSource extends Source {
ensureDir(join(systemCacheRoot, 'cache'));
return _ensureRepoCache(id);
- }).then((_) => _revisionCachePath(id))
- .then((path) {
+ }).then((_) => systemCacheDirectory(id)).then((path) {
revisionCachePath = path;
if (entryExists(revisionCachePath)) return;
return _clone(_repoCachePath(id), revisionCachePath, mirror: false);
@@ -54,12 +53,17 @@ class GitSource extends Source {
if (ref == 'HEAD') return;
return _checkOut(revisionCachePath, ref);
}).then((_) {
- return new Package(id.name, revisionCachePath, systemCache.sources);
+ return new Package.load(id.name, revisionCachePath, systemCache.sources);
});
}
- Future<String> systemCacheDirectory(PackageId id) => _revisionCachePath(id);
-
+ /// Returns the path to the revision-specific cache of [id].
+ Future<String> systemCacheDirectory(PackageId id) {
+ return _revisionAt(id).then((rev) {
+ var revisionCacheName = '${id.name}-$rev';
+ return join(systemCacheRoot, revisionCacheName);
+ });
+ }
/// Ensures [description] is a Git URL.
void validateDescription(description, {bool fromLockFile: false}) {
// A single string is assumed to be a Git URL.
@@ -117,14 +121,6 @@ class GitSource extends Source {
workingDir: _repoCachePath(id)).then((result) => result[0]);
}
- /// Returns the path to the revision-specific cache of [id].
- Future<String> _revisionCachePath(PackageId id) {
- return _revisionAt(id).then((rev) {
- var revisionCacheName = '${id.name}-$rev';
- return join(systemCacheRoot, revisionCacheName);
- });
- }
-
/// Clones the repo at the URI [from] to the path [to] on the local
/// filesystem.
///
« no previous file with comments | « utils/pub/entrypoint.dart ('k') | utils/pub/package.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698