findmissing: Improve SHA handling
Experience shows that in almost all cases, we want to abandon all
patches associated with a given upstream patch (fix) or with a given
stable release or Chrome OS patch.
At the same time, we need to be careful to not make too many uncontrolled
To simplify the abandon/restore command line interface, only require
a single SHA. It does not matter which SHA is provided; it can be the
upstream SHA (the fix) or the stable release/ChromeOS SHA.
If that SHA reflects exactly one entry in the database, go ahead and
make the requested change. If there is more than one entry in the database,
only make the change if the '-f' or '--force' flag is provided. If the flag
is not provided, list the database entries which would be associated with
the change and exit.
- Convert "reason" argument into mandatory optional argument. This was
necessary since the list of SHAs has to come last (as positional
- Do not require specific SHA order if two SHAs are specified.
- Ignore pointless pylint error when importing MySQLdb to make 'repo
- When abandoning patches, skip already abandoned patches.
Also, do not let the user mark merged patches as "ABANDONED".
TEST=Run findmissing command and abandon/restore various patches
Commit-Queue: Guenter Roeck <email@example.com>
Tested-by: Guenter Roeck <firstname.lastname@example.org>
Reviewed-by: Curtis Malainey <email@example.com>
3 files changed