Add an option for writing hinted evolution files.

Review Request #8634 — Created Jan. 19, 2017 and submitted — Latest diff uploaded


Django Evolution


This adds a new -w, --write option to the evolve command for writing
hinted evolutions to disk. This makes it easier to generate new
evolution files, and will help with some of the future
evolution+migrations work (which will need to output migration files).

The contents of the hinted evolutions slightly improved, in that they
now include unicode_literals by default and have a trailing comma on the
last mutation.

There's also a few new utility functions for working with app
information and evolutions module paths, which some existing code has
been updated to use.

Generated some hinted evolutions and wrote them to disk. Verified that
each app with modifications had an evolution with the given name.
Compared this to the printed output and saw that the output was the
same, minus the dividers showing the app label (which is used in the
printed output for differentiating evolutions for different apps).

Tested that calling this without --hint results in an error.