Use SCMTool IDs for tool selection in the repository form.

Review Request #10805 — Created Nov. 21, 2019 and submitted — Latest diff uploaded


Review Board


The Tool field for repositories historically has used database IDs to
represent each possible choice, which would then be used to look up the
appropriate database entry. Long-term, we know that we want to move away
from database entries and to a registry of SCMTool IDs. Short-term, we
will have a need for mapping choices to SCMTool-specific information,
which database IDs aren't going to be very suitable for.

This change moves the field and tracking to use SCMTool IDs exclusively,
and entirely away from database IDs. This does require maintaining a map
of SCMTool IDs to Tool models, which we'll be replacing down the road
with a registry.

Unit tests passed.

Tested loading and saving multiple repositories with different SCMTools,
with and without hosting services.

Inspected the HTML to make sure all the proper state was there.

Switched values for the Tool field to make sure that fields updated