Update prebuilt.py to upload correctly when tracking branch is a revision.

This contains the following two commits.

1. Update prebuilt.py to sync to latest revision before pushing.

This fixes a bug where prebuilt.py is unable to push if it is using
manifest-versions to sync to an old revision. This bug occurs because
manifest-versions is pointing at an old version of the repository so
the prebuilt pusher is never able to push.

BUG=chrome-os-partner:3959
TEST=Test with --dry-run push. Also run unit test suite.

Reviewed-on: http://gerrit.chromium.org/gerrit/1239
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: David James <davidjames@chromium.org>
(cherry picked from commit 1b6e67aef79696d74bcee3d2fce252c8397e592a)

2. Update prebuilt.py to upload correctly when tracking branch is a revision.

If the tracking branch is a revision, we shouldn't push there. We need to
look in the manifest for the default branch and use that instead.

BUG=chrome-os-partner:4169
TEST=Run prebuilt.py when tracking branch is a revision and verify it pushes
     to the right branch (i.e. the default branch defined in the manifest).

Reviewed-on: http://gerrit.chromium.org/gerrit/1702
Reviewed-by: Nick Sanders <nsanders@chromium.org>
Tested-by: David James <davidjames@chromium.org>
(cherry picked from commit d611f3d89a40ca74bb9218f341259a9a1b6f351b)

Change-Id: I553fc0931052ff51a5dcfd6fd5862da7115b4cb2
Reviewed-on: http://gerrit.chromium.org/gerrit/1699
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: David James <davidjames@chromium.org>
2 files changed