Add env var version override for packagers.

Fixes bug 1100805.

Change-Id: I8c8ba8610ed2d9093e188c1412e9689314560015
Use revno and git sha for pre-release versioning.

In discussions with ttx and zul, it became clear that the git describe info
for our intra-release case wasn't providing any value and was providing
confusion. Additionally, plain git sha's are not providing enough info.

So, the scheme settled on that breaks the least amount of things and yet
still reduces complexity is:

if pre-version: # server projects
  try:
    use current tag
  except:
    use pre-version+revcount+gitsha
else:
  use git describe | s/-/./

Additionally, we'll use a as a prefix for the revcount, b as the prefix for
the milestone portion of a milestone tag, and rc as the prefix for rc's, so
that for our releases, python version sorting works as expected.

Change-Id: I6f0fe029d225afa8f435bc83216fc144c2402ae0
Merge "Add env var version override for packagers."
Merge "Use revno and git sha for pre-release versioning."