build: fake PEP440 versions

Authored by joerg.sonnenberger.


build: fake PEP440 versions

If the current version is not exactly a tag, use a local version
specifier to fix it up. PEP 440 uses the "+" separator and only allows
alphanumeric and dot, so use dot for further separations.

Old devel build: 5.7+155-a163cc36d06b
New devel build: 5.7+hg155.a163cc36d06b

Differential Revision: https://phab.mercurial-scm.org/D9955