jiri: Fix and improve remote repo status checks.

Previously jiri was only checking the status of the "master" branch, and
replacing any "HEAD" revision with the current value.  This caused a bug
where projects with a non-master RemoteBranch would end up at the
current HEAD of master.

Additionally, the old code had a bug whereby projects with the same name
could collide, and one project might get set to a revision that does not
exist (because it is a revision of a different project with the same
name).

This CL fixes these bugs, and also improves the repo status check by
checking the status of all project remote branches, not just master.

We first group all projects by their google source host, and then for
each host we make a request with all the branches we care about and set
project revisions accordingly.

Change-Id: Iae7f059e0afa04107a3f94c086a03aa719c79219
3 files changed