fix generation of short revision hashes in test_perf

This PR fixes the broken generation of short revision hashes of test_perf.py described in #4654.