Ensure uploaded local patches actually get applied.

Currently, chromite skips uploaded local patches because their ID
changes after fetching them (they have no ID defined prior to
fetching.) This was introduced by CL:238214

1. Define an ID prior to fetching.

2. Make sure we use the same ID to reference patches both before and after
   fetching.

3. Make sure we exit with an error rather than silently dropping patches
   if an error like this happens in the future.

BUG=none
TEST=Verify this fixes the ability for local patches to be applied.

Change-Id: I9e72ebd2895d597738d7d416c49990e45dde5501
Reviewed-on: https://chromium-review.googlesource.com/239246
Commit-Queue: David James <davidjames@chromium.org>
Trybot-Ready: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
Reviewed-by: Gabe Black <gabeblack@chromium.org>
2 files changed