fromupstream: fix 'bug' handling
The introduction of --crbug and --buganizer broke
(a) the BUG= handling in --replace and
(b) the "missing BUG=" detection
because now, args['bug'] will never remain 'None'.
Let's only re-assign args['bug'] if we had 1 or more crbug or buganizer
args.
BUG=none
TEST=`fromupstream.py --replace ...` honors the old BUG= line
Change-Id: I808b28b62f75b85fe11ffeedbc49d6dbf916820c
Reviewed-on: https://chromium-review.googlesource.com/1368184
Commit-Ready: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
diff --git a/contrib/fromupstream.py b/contrib/fromupstream.py
index 3590a42..8fe3c6f 100755
--- a/contrib/fromupstream.py
+++ b/contrib/fromupstream.py
@@ -158,7 +158,8 @@
buglist += ['b:{0}'.format(x) for x in args['buganizer']]
if args['crbug']:
buglist += ['chromium:{0}'.format(x) for x in args['crbug']]
- args['bug'] = ', '.join(buglist)
+ if buglist:
+ args['bug'] = ', '.join(buglist)
if args['replace']:
old_commit_message = subprocess.check_output(