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

Unified Diff: utils/pub/version_solver.dart

Issue 12995013: Ignore lockfile entries where the source is wrong. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 | utils/tests/pub/install/switch_source_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/version_solver.dart
diff --git a/utils/pub/version_solver.dart b/utils/pub/version_solver.dart
index c00cda5f533ff5a1e3766a335eb47abb0c7cf588..3cb3230b9a9f5af3c33726d35a82a0e9385f00dd 100644
--- a/utils/pub/version_solver.dart
+++ b/utils/pub/version_solver.dart
@@ -183,7 +183,8 @@ class VersionSolver {
for (var dependerName in dependency.dependers) {
var depender = getDependency(dependerName);
var locked = lockFile.packages[dependerName];
- if (locked != null && depender.version == locked.version) {
+ if (locked != null && depender.version == locked.version &&
+ lockedPackage.source.name == dep.source.name) {
enqueue(new UnlockPackage(depender));
return true;
}
@@ -360,7 +361,7 @@ abstract class ChangeConstraint implements WorkItem {
// If the dependency is on a package in the lockfile, use the lockfile's
// version for that package if it's valid given the other constraints.
var lockedPackage = solver.lockFile.packages[name];
- if (lockedPackage != null) {
+ if (lockedPackage != null && newDependency.source == lockedPackage.source) {
var lockedVersion = lockedPackage.version;
if (newConstraint.allows(lockedVersion)) {
solver.enqueue(
« no previous file with comments | « no previous file | utils/tests/pub/install/switch_source_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698