Fix problems parsing revision specs in TFS.
Review Request #12563 — Created Aug. 23, 2022 and submitted
Each TFS wrapper class implemented their own version of
parse_revision_spec(), and due to lack of tests, we had some
regressions in the move to Python 3, plus one wrapper that just never
returned correct results.
crashed. This was due to
returnstatement, causing a
Noneto always be returned. When fixed,
this was still returning a mix of integers and strings, where strings
are the expected type.
TEEWrapper.parse_revision_spec()worked, but produced a mix of
integers and strings.
TFHelperWrapper.parse_revision_spec()produced byte strings, which
weren't compatible with other calls on Python 3. It could also produce
error messages that were empty.
There was also some dead code in these.
These methods have all been updated to work correctly in all conditions.
Result types are all Unicode strings. Dead code has been removed. Errors
given defaults. Assertions added for type safety.
Unit tests have been added to test each of these based on simulated data.
Unit tests pass on Python 3.7-3.11.