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

Unified Diff: lib/src/solver/backtracking_solver.dart

Issue 2079303003: Track Source objects in PackageNames. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Code review changes Created 4 years, 6 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 | « lib/src/package.dart ('k') | lib/src/solver/solve_report.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/solver/backtracking_solver.dart
diff --git a/lib/src/solver/backtracking_solver.dart b/lib/src/solver/backtracking_solver.dart
index e36ff079d62d2ce513b50abe62f90dc1239a25f3..7f3cc432fe51ca74cdfcccc14cfb47c0335aa02c 100644
--- a/lib/src/solver/backtracking_solver.dart
+++ b/lib/src/solver/backtracking_solver.dart
@@ -231,10 +231,7 @@ class BacktrackingSolver {
// can't be downgraded.
if (type == SolveType.DOWNGRADE) {
var locked = lockFile.packages[package];
- if (locked != null &&
- !systemCache.sources[locked.source].hasMultipleVersions) {
- return locked;
- }
+ if (locked != null && !locked.source.hasMultipleVersions) return locked;
}
if (_forceLatest.isEmpty || _forceLatest.contains(package)) return null;
@@ -259,13 +256,7 @@ class BacktrackingSolver {
}
var required = _selection.getRequiredDependency(name);
- if (required != null) {
- if (package.source != required.dep.source) return null;
-
- var source = systemCache.sources[package.source];
- if (!source.descriptionsEqual(
- package.description, required.dep.description)) return null;
- }
+ if (required != null && !package.samePackage(required.dep)) return null;
return package;
}
@@ -536,9 +527,7 @@ class BacktrackingSolver {
throw new SourceMismatchException(dep.name, allDeps);
}
- var source = systemCache.sources[dep.source];
- if (!source.descriptionsEqual(
- dep.description, required.dep.description)) {
+ if (!dep.samePackage(required.dep)) {
// Mark the dependers as failing rather than the package itself, because
// no version with this description will be compatible.
for (var otherDep in _selection.getDependenciesOn(dep.name)) {
@@ -595,7 +584,7 @@ class BacktrackingSolver {
// Make sure the package doesn't have any bad dependencies.
for (var dep in deps.toSet()) {
- if (!dep.isRoot && systemCache.sources[dep.source] is UnknownSource) {
+ if (!dep.isRoot && dep.source is UnknownSource) {
throw new UnknownSourceException(id.name, [new Dependency(id, dep)]);
}
« no previous file with comments | « lib/src/package.dart ('k') | lib/src/solver/solve_report.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698