mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
“meteor update” can update non-root dependencies
Previously, “meteor update foo” meant “ignore .meteor/versions for foo”, which would upgrade if “foo” was a root dependency, and downgrade if foo was only a transitive dependency. Now, we make sure to try to upgrade foo even if it is not a root dependency. See #3282.
This commit is contained in:
@@ -188,7 +188,7 @@ var getCostFunction = function (resolver, options) {
|
||||
});
|
||||
|
||||
return {
|
||||
costFunction: function (state, options) {
|
||||
costFunction: function (state) {
|
||||
options = options || {};
|
||||
// very major, major, medium, minor costs
|
||||
// XXX maybe these can be calculated lazily?
|
||||
@@ -228,8 +228,7 @@ var getCostFunction = function (resolver, options) {
|
||||
PV.versionMagnitude(_.last(resolver.unitsVersions[uv.name]).version) -
|
||||
PV.versionMagnitude(uv.version);
|
||||
|
||||
if (isRootDep[uv.name]) {
|
||||
// root dependency
|
||||
if (isRootDep[uv.name] || _.has(options.upgrade, uv.name)) {
|
||||
// preferably latest
|
||||
cost[MEDIUM] += latestDistance;
|
||||
} else {
|
||||
@@ -246,7 +245,7 @@ var getCostFunction = function (resolver, options) {
|
||||
return cost;
|
||||
},
|
||||
|
||||
estimateCostFunction: function (state, options) {
|
||||
estimateCostFunction: function (state) {
|
||||
options = options || {};
|
||||
|
||||
var cost = [0, 0, 0, 0];
|
||||
|
||||
@@ -77,7 +77,7 @@ ConstraintSolver.Resolver.prototype.getConstraint =
|
||||
};
|
||||
|
||||
// options: Object:
|
||||
// - costFunction: function (state, options) - given a state evaluates its cost
|
||||
// - costFunction: function (state) - given a state evaluates its cost
|
||||
// - estimateCostFunction: function (state) - given a state, evaluates the
|
||||
// estimated cost of the best path from state to a final state
|
||||
// - combineCostFunction: function (cost, cost) - given two costs (obtained by
|
||||
|
||||
Reference in New Issue
Block a user