(bug 54686) re-enable support for svn repo revision detection

* re-enable old code still there
* add support for git sha hash (cf. change 85523)
* try to avoid to excessive use of try...except structures
* hash is primary identifier thus swapped with revision number
* revision number for git prefixed with "g" for svn with "s"
* some PEP8

Change-Id: I0aa62bc722df77d06c6e0bc10b87c4d284c63ede
Merge "(bug 54686) re-enable support for svn repo revision detection"