Sync latest setup code from oslo-incubator

Changes include:

 6b3c544 setup: count revs for revno if there are no tags
 9c8685a Use revno and git sha for pre-release versioning.
 5f5ef7d Add env var version override for packagers.
 602aa9c trivial pep whitespace fix