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

Unified Diff: git_cl.py

Issue 2274743003: Add a --json option to git cl try-results. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 4 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: git_cl.py
diff --git a/git_cl.py b/git_cl.py
index 42a5eabc18207e364575959ab1d420de7f6f9f12..7fdc6aa7fe73dfe5e41477ec7a9c5233f5c153b0 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -4757,6 +4757,9 @@ def CMDtry_results(parser, args):
group.add_option(
"--buildbucket-host", default='cr-buildbucket.appspot.com',
help="Host of buildbucket. The default host is %default.")
+ group.add_option(
+ "--json", action='store_true', default=False,
tandrii(chromium) 2016/08/24 11:32:23 no need for default.
qyearsley 2016/08/26 01:56:47 Now changing this to be an option that takes a fil
+ help="Output try job results as JSON instead of a human-readable format.")
tandrii(chromium) 2016/08/24 11:32:23 IMO, change to 'write try job results as JSON to a
qyearsley 2016/08/26 01:56:47 Sounds good.
parser.add_option_group(group)
auth.add_auth_options(parser)
options, args = parser.parse_args(args)
@@ -4785,7 +4788,10 @@ def CMDtry_results(parser, args):
print('ERROR: Exception when trying to fetch tryjobs: %s\n%s' %
(e, stacktrace))
return 1
- print_tryjobs(options, jobs)
+ if options.json:
+ print(json.dumps(jobs, indent=2))
tandrii(chromium) 2016/08/24 11:32:23 hm, you want to dump the *whole* metadata? i don't
+ else:
+ print_tryjobs(options, jobs)
return 0
« 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