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

Unified Diff: lib/src/entrypoint.dart

Issue 1281043004: Make LockFile immutable. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Code review changes Created 5 years, 4 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 | « no previous file | lib/src/global_packages.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/entrypoint.dart
diff --git a/lib/src/entrypoint.dart b/lib/src/entrypoint.dart
index 9a6cded000e8a78807d212fc1d2f7211086e974b..7e90814c8780045c95f739ba5a64464e286683fd 100644
--- a/lib/src/entrypoint.dart
+++ b/lib/src/entrypoint.dart
@@ -86,7 +86,7 @@ class Entrypoint {
if (_lockFile != null) return _lockFile;
if (!lockFileExists) {
- _lockFile = new LockFile.empty();
+ _lockFile = new LockFile.empty(cache.sources);
} else {
_lockFile = new LockFile.load(lockFilePath, cache.sources);
}
@@ -466,7 +466,10 @@ class Entrypoint {
cache.sources[id.source].getDirectory(id));
});
- return new PackageGraph(this, new LockFile(result.packages), packages);
+ return new PackageGraph(
+ this,
+ new LockFile(result.packages, cache.sources),
+ packages);
}
await ensureLockFileIsUpToDate();
@@ -486,9 +489,9 @@ class Entrypoint {
/// Saves a list of concrete package versions to the `pubspec.lock` file.
void _saveLockFile(List<PackageId> packageIds) {
- _lockFile = new LockFile(packageIds);
+ _lockFile = new LockFile(packageIds, cache.sources);
var lockFilePath = root.path('pubspec.lock');
- writeTextFile(lockFilePath, _lockFile.serialize(root.dir, cache.sources));
+ writeTextFile(lockFilePath, _lockFile.serialize(root.dir));
}
/// Creates a self-referential symlink in the `packages` directory that allows
« no previous file with comments | « no previous file | lib/src/global_packages.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698