Commit 5bf80d62 authored by nodir@chromium.org's avatar nodir@chromium.org

Refactoring in trychange: _ParseSendChangeOptions

R=iannucci@chromium.org, agable@chromium.org
BUG=360180

Review URL: https://codereview.chromium.org/228113003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@262746 0039d316-1c4b-4281-b951-d872f2087c98
parent 74bfde0f
......@@ -421,27 +421,29 @@ def _ParseSendChangeOptions(bot_spec, options):
_SendChangeGit.
"""
values = [
('user', options.user),
('name', options.name),
('user', options.user),
('name', options.name),
]
if options.email:
values.append(('email', options.email))
if options.revision:
values.append(('revision', options.revision))
# A list of options to copy.
optional_values = (
'email',
'revision',
'root',
'patchlevel',
'issue',
'patchset',
'target',
'project',
)
for option_name in optional_values:
value = getattr(options, option_name)
if value:
values.append((option_name, value))
# Not putting clobber to optional_names
# because it used to have lower-case 'true'.
if options.clobber:
values.append(('clobber', 'true'))
if options.root:
values.append(('root', options.root))
if options.patchlevel:
values.append(('patchlevel', options.patchlevel))
if options.issue:
values.append(('issue', options.issue))
if options.patchset:
values.append(('patchset', options.patchset))
if options.target:
values.append(('target', options.target))
if options.project:
values.append(('project', options.project))
for bot, tests in bot_spec:
values.append(('bot', ('%s:%s' % (bot, ','.join(tests)))))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment