Add functions to check Gerrit change id/number

We check whether a string is a gerrit number, a change-ID or a full
change-ID in many places. We should have functions to do this in one
place.

BUG=chromium:352899
TEST=`bulidbot/run_tests` passes

Change-Id: I75c7c9a700ef45670484d59cd04c1709a876b7d2
Reviewed-on: https://chromium-review.googlesource.com/190980
Reviewed-by: Yu-Ju Hong <yjhong@chromium.org>
Commit-Queue: Yu-Ju Hong <yjhong@chromium.org>
Tested-by: Yu-Ju Hong <yjhong@chromium.org>
4 files changed