Clone
Cédric Champeau
committed
on 21 Sep 17
Introduce check on replaced modules before short-circuit selection
When we perform short-circuit selection for a module (where its selected … Show more
Introduce check on replaced modules before short-circuit selection

When we perform short-circuit selection for a module (where its selected version is `null`), we need to check that

this module actually doesn't participate in module replacements. If it does, we need to fall back on classic conflict

resolution. Otherwise, the following situation might occur:

- `a` is replaced by `b`

- we add `a:1` to the graph. No version is selected for `a`, so we select `a:1`

- we add `b:1` to the graph. No version is selected for `b`, so we select `b:1`

- we end up with both `a` and `b` in the result

Instead, we now follow this process:

- `a` is replaced by `b`

- we add `a:1` to the graph. No version is selected for `a`, but `a` participates in replacements. We don't short-circuit,

but in the end we select `a:1`

- we add `b:1` to the graph. No version is selected for `b`, but `b` participates in replacements. We fall back to conflict

resolution, which sees that `a` needs to be replaced by `b`.

- only `b:1` ends up in the result

Show less

green-master + 462 more