composer/composer — pull request #521 by naderman (2012-04-01 20:33:41+00:00)
Title: Rule literals are sorted, so first literal added is not first retrieved

The problem was essentially that after trying twig-bridge with twig/twig dev-master it would realise they are incompatible and try to learn a rule ( - twig/twig-dev-master| - symfony/twig-bridge) - which means they conflict. However we store rule literals sorted for easier comparison so the rule actually ended up being ( - symfony/twig-bridge | - twig/twig-dev-master).

So because of the incorrect order rather than removing twig/twig dev-master and trying with a different version of twig which might work with twig-bridge it decided to remove twig-bridge even though that was the basis for checking twig versions. This double assignment of twig-bridge to be installed & removed triggered the assertion.

Fixes #477