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

Unified Diff: buildbucket.py

Issue 1199963004: Add --changes flag to buildbucket.py's put subcommand (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 5 years, 6 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: buildbucket.py
diff --git a/buildbucket.py b/buildbucket.py
index 97829d45b2a91f65a90224325426bd64363637f7..f00cc8f9d10124abdcf192f8ebf2478045ee00fb 100755
--- a/buildbucket.py
+++ b/buildbucket.py
@@ -52,6 +52,11 @@ def main(argv):
required=True,
)
put_parser.add_argument(
+ '-c',
+ '--changes',
+ help='A flie to load a JSON list of changes dicts from.',
+ )
+ put_parser.add_argument(
'-n',
'--builder-name',
help='The builder to schedule the build on.',
@@ -66,6 +71,15 @@ def main(argv):
# TODO(smut): When more commands are implemented, refactor this.
assert args.command == 'put'
+ changes = []
+ if args.changes:
+ try:
+ with open(args.changes) as fp:
+ changes.extend(json.load(fp))
+ except (TypeError, ValueError):
+ sys.stderr.write('%s contained invalid JSON list.\n' % args.changes)
+ raise
+
properties = {}
if args.properties:
try:
@@ -88,6 +102,7 @@ def main(argv):
'bucket': args.bucket,
'parameters_json': json.dumps({
'builder_name': args.builder_name,
+ 'changes': changes,
'properties': properties,
}),
}),
« 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