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

Side by Side Diff: recipe_engine/remote.py

Issue 2848443003: [recipes.py] add missing helpstrings, merge test subcommands into main parser. (Closed)
Patch Set: rebase Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « recipe_engine/refs.py ('k') | recipe_engine/run.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 The LUCI Authors. All rights reserved. 1 # Copyright 2016 The LUCI Authors. All rights reserved.
2 # Use of this source code is governed under the Apache License, Version 2.0 2 # Use of this source code is governed under the Apache License, Version 2.0
3 # that can be found in the LICENSE file. 3 # that can be found in the LICENSE file.
4 4
5 from __future__ import print_function 5 from __future__ import print_function
6 6
7 import contextlib 7 import contextlib
8 import logging 8 import logging
9 import os 9 import os
10 import shutil 10 import shutil
(...skipping 15 matching lines...) Expand all
26 logging.info('Created temporary workdir %s', args.workdir) 26 logging.info('Created temporary workdir %s', args.workdir)
27 27
28 try: 28 try:
29 yield 29 yield
30 finally: 30 finally:
31 if workdir_tempdir: 31 if workdir_tempdir:
32 shutil.rmtree(args.workdir, ignore_errors=True) 32 shutil.rmtree(args.workdir, ignore_errors=True)
33 33
34 34
35 def add_subparser(parser): 35 def add_subparser(parser):
36 helpstr = 'Invoke a recipe command from specified repo and revision.'
36 remote_p = parser.add_parser( 37 remote_p = parser.add_parser(
37 'remote', 38 'remote', help=helpstr, description=helpstr)
38 description='Invoke a recipe command from specified repo and revision')
39 remote_p.add_argument( 39 remote_p.add_argument(
40 '--repository', required=True, 40 '--repository', required=True,
41 help='URL of a git repository to fetch') 41 help='URL of a git repository to fetch')
42 remote_p.add_argument( 42 remote_p.add_argument(
43 '--revision', 43 '--revision',
44 help=( 44 help=(
45 'Git commit hash to check out; defaults to latest revision on master' 45 'Git commit hash to check out; defaults to latest revision on master'
46 ' (refs/heads/master)' 46 ' (refs/heads/master)'
47 )) 47 ))
48 remote_p.add_argument( 48 remote_p.add_argument(
(...skipping 29 matching lines...) Expand all
78 package.InfraRepoConfig().to_recipes_cfg(checkout_dir)) 78 package.InfraRepoConfig().to_recipes_cfg(checkout_dir))
79 cmd = [ 79 cmd = [
80 sys.executable, 80 sys.executable,
81 os.path.join( 81 os.path.join(
82 checkout_dir, 82 checkout_dir,
83 recipes_cfg.read().recipes_path, 83 recipes_cfg.read().recipes_path,
84 'recipes.py'), 84 'recipes.py'),
85 ] + args.remote_args 85 ] + args.remote_args
86 logging.info('Running %r', cmd) 86 logging.info('Running %r', cmd)
87 return subprocess.call(cmd) 87 return subprocess.call(cmd)
OLDNEW
« no previous file with comments | « recipe_engine/refs.py ('k') | recipe_engine/run.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698