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

Unified Diff: recipe_engine/autoroll.py

Issue 2845873002: [recipes.py] move autoroll arg parsing to its module (Closed)
Patch Set: rebase Created 3 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 | recipes.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipe_engine/autoroll.py
diff --git a/recipe_engine/autoroll.py b/recipe_engine/autoroll.py
index 503a4edd7f7353d7ac5571b2d5278eb8d605dcc8..b733a9b5f982b32aaf4305dc428d2bbc1682e0c8 100644
--- a/recipe_engine/autoroll.py
+++ b/recipe_engine/autoroll.py
@@ -267,7 +267,32 @@ def test_rolls(repo_cfg_block, config_file, context, package_spec,
return ret
-def main(args, repo_root, config_file):
+def add_subparser(parser):
+ autoroll_p = parser.add_parser(
+ 'autoroll',
+ help='Roll dependencies of a recipe package forward (implies fetch)')
+ autoroll_p.add_argument(
+ '--output-json',
+ type=os.path.abspath,
+ help='A json file to output information about the roll to.')
+ autoroll_p.add_argument(
+ '--verbose-json',
+ action='store_true',
+ help=('Emit even more data in the output-json file. '
+ 'Requires --output-json.'))
+
+ def postprocess_func(parser, args):
+ if args.verbose_json and not args.output_json:
+ parser.error('--verbose-json passed without --output-json')
+
+ autoroll_p.set_defaults(
+ command='autoroll', func=main, postprocess_func=postprocess_func)
+
+
+def main(_package_deps, args):
+ config_file = args.package
+ repo_root = package.InfraRepoConfig().from_recipes_cfg(config_file.path)
+
package_pb = config_file.read()
context = package.PackageContext.from_package_pb(
« no previous file with comments | « no previous file | recipes.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698