Fix issues with the new update_from_commit_id protection on 2.0.x.
Review Request #6044 — Created July 1, 2014 and submitted
A fix was recently added to prevent a failure when fetching a changeset
from creating a review request without a commit ID. This worked fine on
1.7.x, but the underlying code changed a bit on 2.0. On 2.0, we didn't
have a saved review request in the database before attempting all this,
and the new change broke saving of review requests completely.The code has been reworked to perform the updating and validation early,
and to also associate the commit ID in the event of failure (in order to
allow it to more easily try again or at least look up the review request
later).A number of unit tests for various conditions were added to help with
these cases and to also test for commit ID uniqueness.
Unit tests pass.