pre-upload: Verify the bug reference based on the upstream project.

When uploading patches to AOSP directly from a Chromium OS checkout, we
need to specify the bug number in a different format. This patch checks
the upstream project the branch is tracking and decides what format
should be used for the bug number line.

BUG=None
TEST=Added unittests.

Change-Id: I2084b4de7c55051bb229f1642384788916d1253b
Reviewed-on: https://chromium-review.googlesource.com/297173
Commit-Ready: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2 files changed