fromupstream: Fix "--replace" to keep the old BUG

The recent BUG cleanup broke "--replace" mode.  Now when you use
"--replace" you end up with a blank bug line.  Oops.  Let's fix.

The problem is that ''.split('\n') produces the list [''] or a 1 item
list containing the empty string.  In a boolean context that evaluates
to True to later tests in the code that were trying to check of
"bug_lines" was unset were failing.  Let's add a rule to the logic
where we keep bug_lines as the empty list if no bugs are specified.

BUG=None
TEST=Use "--replace"

Change-Id: I367108d618b5ce9a1c7d9221f42653391a89f326
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/dev-util/+/2674111
Tested-by: Douglas Anderson <dianders@chromium.org>
Auto-Submit: Douglas Anderson <dianders@chromium.org>
Commit-Queue: Tzung-Bi Shih <tzungbi@chromium.org>
Reviewed-by: Tzung-Bi Shih <tzungbi@chromium.org>
1 file changed