Commit 38e9461c authored by wtc@chromium.org's avatar wtc@chromium.org

Fix a typo for "--dry-run" in the usage message.

This typo was introduced in https://codereview.chromium.org/106403003.

Rename options.dryrun to options.dry_run.

R=agable@chromium.org,dpranke@chromium.org
BUG=none
TEST=none

Review URL: https://codereview.chromium.org/138623008

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@250802 0039d316-1c4b-4281-b951-d872f2087c98
parent f41d791a
...@@ -60,7 +60,7 @@ class Checkout(object): ...@@ -60,7 +60,7 @@ class Checkout(object):
def run(self, cmd, **kwargs): def run(self, cmd, **kwargs):
print 'Running: %s' % (' '.join(pipes.quote(x) for x in cmd)) print 'Running: %s' % (' '.join(pipes.quote(x) for x in cmd))
if self.options.dryrun: if self.options.dry_run:
return 0 return 0
return subprocess.check_call(cmd, **kwargs) return subprocess.check_call(cmd, **kwargs)
...@@ -121,7 +121,7 @@ class GclientGitCheckout(GclientCheckout, GitCheckout): ...@@ -121,7 +121,7 @@ class GclientGitCheckout(GclientCheckout, GitCheckout):
# Configure git. # Configure git.
wd = os.path.join(self.base, self.root) wd = os.path.join(self.base, self.root)
if self.options.dryrun: if self.options.dry_run:
print 'cd %s' % wd print 'cd %s' % wd
self.run_git( self.run_git(
'submodule', 'foreach', 'submodule', 'foreach',
...@@ -157,7 +157,7 @@ class GclientGitSvnCheckout(GclientGitCheckout, SvnCheckout): ...@@ -157,7 +157,7 @@ class GclientGitSvnCheckout(GclientGitCheckout, SvnCheckout):
if real_path != self.root: if real_path != self.root:
real_path = os.path.join(self.root, real_path) real_path = os.path.join(self.root, real_path)
wd = os.path.join(self.base, real_path) wd = os.path.join(self.base, real_path)
if self.options.dryrun: if self.options.dry_run:
print 'cd %s' % wd print 'cd %s' % wd
self.run_git('svn', 'init', '--prefix=origin/', '-T', self.run_git('svn', 'init', '--prefix=origin/', '-T',
svn_spec['svn_branch'], svn_spec['svn_url'], cwd=wd) svn_spec['svn_branch'], svn_spec['svn_url'], cwd=wd)
...@@ -203,7 +203,7 @@ for full usage instructions. ...@@ -203,7 +203,7 @@ for full usage instructions.
Valid options: Valid options:
-h, --help, help Print this message. -h, --help, help Print this message.
--nohooks Don't run hooks after checkout. --nohooks Don't run hooks after checkout.
-n, --dryrun Don't run commands, only print them. -n, --dry-run Don't run commands, only print them.
""" % os.path.basename(sys.argv[0])) """ % os.path.basename(sys.argv[0]))
sys.exit(bool(msg)) sys.exit(bool(msg))
...@@ -215,7 +215,7 @@ def handle_args(argv): ...@@ -215,7 +215,7 @@ def handle_args(argv):
if argv[1] in ('-h', '--help', 'help'): if argv[1] in ('-h', '--help', 'help'):
usage() usage()
dryrun = False dry_run = False
nohooks = False nohooks = False
while len(argv) >= 2: while len(argv) >= 2:
arg = argv[1] arg = argv[1]
...@@ -223,7 +223,7 @@ def handle_args(argv): ...@@ -223,7 +223,7 @@ def handle_args(argv):
break break
argv.pop(1) argv.pop(1)
if arg in ('-n', '--dry-run'): if arg in ('-n', '--dry-run'):
dryrun = True dry_run = True
elif arg == '--nohooks': elif arg == '--nohooks':
nohooks = True nohooks = True
else: else:
...@@ -238,7 +238,7 @@ def handle_args(argv): ...@@ -238,7 +238,7 @@ def handle_args(argv):
recipe = argv[1] recipe = argv[1]
props = argv[2:] props = argv[2:]
return optparse.Values({'dryrun':dryrun, 'nohooks':nohooks }), recipe, props return optparse.Values({'dry_run':dry_run, 'nohooks':nohooks }), recipe, props
def run_recipe_fetch(recipe, props, aliased=False): def run_recipe_fetch(recipe, props, aliased=False):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment