pre-upload: allow different --rerun-since argument interpretations

When passing the --rerun-since command line option, date is not the
easiest to specify time limit when trying to determine how many
patches should be checked.

Let's allow specifying different arguments to this command line
option, adding sha1 of an existing patch and number of patches to
check.

The following heuristics are used: if the value is shorter than 3
symbols, it must be the number of patches to check. If the value has
dashes in it, it must be a date. Otherwise it must be a SHA1.

BUG=none
TEST=verified that pre-uplad.py --rerun-since properly checks patches
     with any of all three formats.

Change-Id: I4a9383e820fa1c74fb7d26241d82495233d68969
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/860905
Reviewed-by: Mike Frysinger <vapier@chromium.org>
(cherry picked from commit 75447b92ba2cf224a52e13a98a18b77ab011d885)
Reviewed-on: https://chromium-review.googlesource.com/895903
1 file changed