Commit b9f2751b authored by pgervais@chromium.org's avatar pgervais@chromium.org

Added hyphen-only options

Some options have words separated by underscores. Added options with
same name and underscores replaced by hyphens.

BUG=400953

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@288366 0039d316-1c4b-4281-b951-d872f2087c98
parent 49f859c0
...@@ -522,7 +522,7 @@ def CMDupdate_bootstrap(parser, args): ...@@ -522,7 +522,7 @@ def CMDupdate_bootstrap(parser, args):
# First, we need to ensure the cache is populated. # First, we need to ensure the cache is populated.
populate_args = args[:] populate_args = args[:]
populate_args.append('--no_bootstrap') populate_args.append('--no-bootstrap')
CMDpopulate(parser, populate_args) CMDpopulate(parser, populate_args)
# Get the repo directory. # Get the repo directory.
...@@ -542,9 +542,11 @@ def CMDpopulate(parser, args): ...@@ -542,9 +542,11 @@ def CMDpopulate(parser, args):
help='Only cache 10000 commits of history') help='Only cache 10000 commits of history')
parser.add_option('--ref', action='append', parser.add_option('--ref', action='append',
help='Specify additional refs to be fetched') help='Specify additional refs to be fetched')
parser.add_option('--no_bootstrap', action='store_true', parser.add_option('--no_bootstrap', '--no-bootstrap',
action='store_true',
help='Don\'t bootstrap from Google Storage') help='Don\'t bootstrap from Google Storage')
parser.add_option('--ignore_locks', action='store_true', parser.add_option('--ignore_locks', '--ignore-locks',
action='store_true',
help='Don\'t try to lock repository') help='Don\'t try to lock repository')
options, args = parser.parse_args(args) options, args = parser.parse_args(args)
......
...@@ -1718,7 +1718,9 @@ def CMDupload(parser, args): ...@@ -1718,7 +1718,9 @@ def CMDupload(parser, args):
help='cc email addresses') help='cc email addresses')
parser.add_option('-s', '--send-mail', action='store_true', parser.add_option('-s', '--send-mail', action='store_true',
help='send email to reviewer immediately') help='send email to reviewer immediately')
parser.add_option("--emulate_svn_auto_props", action="store_true", parser.add_option('--emulate_svn_auto_props',
'--emulate-svn-auto-props',
action="store_true",
dest="emulate_svn_auto_props", dest="emulate_svn_auto_props",
help="Emulate Subversion's auto properties feature.") help="Emulate Subversion's auto properties feature.")
parser.add_option('-c', '--use-commit-queue', action='store_true', parser.add_option('-c', '--use-commit-queue', action='store_true',
...@@ -1726,6 +1728,7 @@ def CMDupload(parser, args): ...@@ -1726,6 +1728,7 @@ def CMDupload(parser, args):
parser.add_option('--private', action='store_true', parser.add_option('--private', action='store_true',
help='set the review private (rietveld only)') help='set the review private (rietveld only)')
parser.add_option('--target_branch', parser.add_option('--target_branch',
'--target-branch',
help='When uploading to gerrit, remote branch to ' help='When uploading to gerrit, remote branch to '
'use for CL. Default: master') 'use for CL. Default: master')
parser.add_option('--email', default=None, parser.add_option('--email', default=None,
......
...@@ -18,7 +18,8 @@ def main(args): ...@@ -18,7 +18,8 @@ def main(args):
) )
parser.add_argument('branch_name') parser.add_argument('branch_name')
g = parser.add_mutually_exclusive_group() g = parser.add_mutually_exclusive_group()
g.add_argument('--upstream_current', action='store_true', g.add_argument('--upstream-current', '--upstream_current',
action='store_true',
help='set upstream branch to current branch.') help='set upstream branch to current branch.')
g.add_argument('--upstream', metavar='REF', default=root(), g.add_argument('--upstream', metavar='REF', default=root(),
help='upstream branch (or tag) to track.') help='upstream branch (or tag) to track.')
......
...@@ -169,7 +169,8 @@ def rebase_branch(branch, parent, start_hash): ...@@ -169,7 +169,8 @@ def rebase_branch(branch, parent, start_hash):
def main(args=()): def main(args=()):
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument('--verbose', '-v', action='store_true') parser.add_argument('--verbose', '-v', action='store_true')
parser.add_argument('--no_fetch', '-n', action='store_true', parser.add_argument('--no_fetch', '--no-fetch', '-n',
action='store_true',
help='Skip fetching remotes.') help='Skip fetching remotes.')
opts = parser.parse_args(args) opts = parser.parse_args(args)
......
...@@ -69,7 +69,7 @@ def main(args): ...@@ -69,7 +69,7 @@ def main(args):
manual_merge_base(branch, mbase, new_parent) manual_merge_base(branch, mbase, new_parent)
# TODO(iannucci): ONLY rebase-update the branch which moved (and dependants) # TODO(iannucci): ONLY rebase-update the branch which moved (and dependants)
return git_rebase_update.main(['--no_fetch']) return git_rebase_update.main(['--no-fetch'])
if __name__ == '__main__': # pragma: no cover if __name__ == '__main__': # pragma: no cover
......
...@@ -120,7 +120,7 @@ echo Fetching origin ...@@ -120,7 +120,7 @@ echo Fetching origin
git fetch origin 2>&1 | grep -v 'stage' | sed 's+From.*+From https://upstream+' git fetch origin 2>&1 | grep -v 'stage' | sed 's+From.*+From https://upstream+'
silent git update-ref refs/remotes/origin/master stage_2 silent git update-ref refs/remotes/origin/master stage_2
silent git tag -d $(git tag -l 'stage_*') silent git tag -d $(git tag -l 'stage_*')
git rebase-update --no_fetch git rebase-update --no-fetch
comment "Well look at that. The CQ landed our typo and chapter2 branches " comment "Well look at that. The CQ landed our typo and chapter2 branches "
comment "already and git rebase-update cleaned them up for us." comment "already and git rebase-update cleaned them up for us."
......
...@@ -9,7 +9,7 @@ include::_git-rebase-update_desc.helper.txt[] ...@@ -9,7 +9,7 @@ include::_git-rebase-update_desc.helper.txt[]
SYNOPSIS SYNOPSIS
-------- --------
[verse] [verse]
'git rebase-update' [-v | --verbose] [-n | --no_fetch] 'git rebase-update' [-v | --verbose] [-n | --no-fetch]
DESCRIPTION DESCRIPTION
----------- -----------
...@@ -28,7 +28,7 @@ Fetching:: ...@@ -28,7 +28,7 @@ Fetching::
of git remotes is determined, and fetched accordingly. Note that if any of git remotes is determined, and fetched accordingly. Note that if any
branches have a tag as their upstream, we are forced to pull all remotes. branches have a tag as their upstream, we are forced to pull all remotes.
+ +
Pass `--no_fetch` to skip this phase. Pass `--no-fetch` to skip this phase.
Rebasing:: Rebasing::
All branches are rebased in topological order from roots (upstreams) to All branches are rebased in topological order from roots (upstreams) to
...@@ -67,7 +67,7 @@ OPTIONS ...@@ -67,7 +67,7 @@ OPTIONS
------- -------
-n:: -n::
--no_fetch:: --no-fetch::
Skip the `git fetch` phase of rebase-update. Skip the `git fetch` phase of rebase-update.
-v:: -v::
......
...@@ -85,7 +85,7 @@ class GitRebaseUpdateTest(git_test_utils.GitRepoReadWriteTestBase): ...@@ -85,7 +85,7 @@ class GitRebaseUpdateTest(git_test_utils.GitRepoReadWriteTestBase):
self.repo.git_commit('foobar2') self.repo.git_commit('foobar2')
self.repo.git('checkout', 'branch_K') self.repo.git('checkout', 'branch_K')
self.repo.run(self.nb.main, ['--upstream_current', 'sub_K']) self.repo.run(self.nb.main, ['--upstream-current', 'sub_K'])
with self.repo.open('K', 'w') as f: with self.repo.open('K', 'w') as f:
f.write('This depends on K') f.write('This depends on K')
self.repo.git_commit('sub_K') self.repo.git_commit('sub_K')
...@@ -117,7 +117,7 @@ class GitRebaseUpdateTest(git_test_utils.GitRepoReadWriteTestBase): ...@@ -117,7 +117,7 @@ class GitRebaseUpdateTest(git_test_utils.GitRepoReadWriteTestBase):
self.assertIn('Cannot rebase-update', output) self.assertIn('Cannot rebase-update', output)
self.repo.run(self.nb.main, ['empty_branch']) self.repo.run(self.nb.main, ['empty_branch'])
self.repo.run(self.nb.main, ['--upstream_current', 'empty_branch2']) self.repo.run(self.nb.main, ['--upstream-current', 'empty_branch2'])
self.repo.git('checkout', 'branch_K') self.repo.git('checkout', 'branch_K')
......
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