patch_sync: Filter patches better

This commit introduces better patch filtering. Specifically,
* it prevents patches from being reintroduced to repos which
  already have those patches in their own PATCHES.json.
* it only applies android patches which are within the
  desired version range.

BUG=b:209493133
TEST=patch_sync transpose --no-commit -s <...>

Change-Id: I667a095395a36edf290e5e652ae40efaa2df7d57
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3382194
Reviewed-by: George Burgess <gbiv@chromium.org>
Tested-by: Jordan Abrahams-Whitehead <ajordanr@google.com>
Commit-Queue: Jordan Abrahams-Whitehead <ajordanr@google.com>
2 files changed