basho/cuttlefish — pull request #71 by Licenser (2013-11-17 16:24:33+00:00)
Title: Added prioritization of schema files.

Fixing the behavior described in #70.

This patch changes the behavior of schema loading slightly, each schema gets a priority assigned, this priority is based on the alphabetical order. The priority is stored in both mappings and translations, putting them in validators would be easy but did not seem to make sense to me.

This allows mappings and transactions to be applied in any order while retaining the priority/order they had in regards to the loaded schema files. It works like this:

```
00.schema -> priority 2
01.schema -> priority 1
02.schema -> priority 0
```

A mapping of variable `app.v` in `00.schema` will this overwrite a mapping to variable `app.v` in `01.schema` since the priority of the first mapping would be 2 which is greater 1, then the priority of mapping of the `01.schema`.

Even if `02.schema` would have a translation for `app.v` this would not take affect since the priority of this translation would be 0, while the mapping form `00.schema` wins with a priority of 2. While the other way around a translation to `app.v` from `00.schema` would overwrite both, mappings to `app.v` and translations to `app.v` from `01.schema` or `02.schema`