Ensure that the correct parent is chosen in relation chains


Fixup for da2b640d7e6c2157bb7af0bac7b37f66ca4a25fa

When examining heridity for a change in a relation chain, the "parent"
field of the newly merged change cannot be trusted due to gerrit
breaking relation chains on merge. Instead, use the previously fetched
relation chain data for the current-1 patchset to select a parent
change ID, then query for the current revision of the parent.

Also contains a fix for picking when the preferred parent is not ready.

Fixes: QTQAINFRA-5796
Fixes: QTQAINFRA-5849
Change-Id: I2a0dc214ae3669e83ff525d21ae46505d2acad51
Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
commit8bc1c59ca73337771a98c1871b31a754b9e3afc9
parent54614874c05223138990df15a62e5e6e6d3a3330
authorDaniel Smith <daniel.smith@qt.io>
committerDaniel Smith <Daniel.Smith@qt.io>
commit timeMon, 15 Jan 2024 08:20:52 +0000