JuliaLang/julia — pull request #3637 by carlobaldassi (2013-07-06 02:48:19+00:00)
Title: Pkg2: new VersionInterval rules, version filtering, new resolve objective function 

@StefanKarpinski

As discussed, here is a revised version of Pkg2 resolve whose objective function is not affected by version pruning, which can therefore be moved upstream.

In order for this change to make sense, I also changed VersionInterval to only use and consider the "normal" part of the version, disregarding the prerelease and build fields. Therefore, a require line such as `julia 0.1- 0.2-` can now be written as `julia 0.1 0.2`.

As for require line parsing, it issues warnings for all non-normal versions except those in the form `x.y.z-`.

There is also a prefiltering step, such that versions of a package are first grouped according to their normal version number, and then only the highest value is kept. Examples of combinations and the resulting version:

```
1.2-pre, 1.2-pre2, 1.2 --> 1.2
1.2-pre, 1.2-pre2 --> 1.2pre
1.2-pre, 1.2, 1.2+build1 --> 1.2+build1
```

However, the sanity check routine is still checking all of them (in case they don't belong to the same equivalence class).

Some additional details are provided in the commit messages.

In my tests everything works fine, and the new weight function has a surprisingly little impact on performance. Users should not notice any difference at the moment, but probably advertising the change in the parsing rules would be a good idea.