Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1530)

Unified Diff: trychange.py

Issue 228113003: Refactoring in trychange: _ParseSendChangeOptions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trychange.py
diff --git a/trychange.py b/trychange.py
index f352243a92ff49d6ec40f8582a22b3aadff16d8a..e8132b94ca2229913b3f05b747fe9a27f98895fb 100755
--- a/trychange.py
+++ b/trychange.py
@@ -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)))))
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698