oleiade/etcaetera — pull request #19 by bitprophet (2014-10-24 20:33:50+00:00)
Title: AdapterSet.insert() doesn't work in nontrivial situations

Ran into a silly bug:

* Have `Config` with a bunch (~10) of `File` adapters + a `Defaults`
* Register an `Overrides`
* Try registering an `Env` adapter after that
* `Config.register` sees the `Overrides` and opts to use `AdapterSet.insert` instead of `.append` (which is used for all other register calls prior to adding the `Overrides`)
* `insert` doesn't work correctly when you have >1 adapter in-between your `Defaults` and your `Overrides` - it's using incorrect indexes when calling `deque.rotate`.

Poking at the fix now, guessing just needs a couple numbers peeled off of the `index` value based on the existence of `Defaults` and/or `Overrides`.