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.

TEST=Use "--replace"

Change-Id: I367108d618b5ce9a1c7d9221f42653391a89f326
Tested-by: Douglas Anderson <>
Auto-Submit: Douglas Anderson <>
Commit-Queue: Tzung-Bi Shih <>
Reviewed-by: Tzung-Bi Shih <>
1 file changed