@subcommand.usage('[args to "git diff"]')
def CMDupload(parser, args):
    'Uploads the current changelist to codereview.\n\n  Can skip dependency patchset uploads for a branch by running:\n    git config branch.branch_name.skip-deps-uploads True\n  To unset run:\n    git config --unset branch.branch_name.skip-deps-uploads\n  Can also set the above globally by using the --global flag.\n  '
    parser.add_option('--bypass-hooks', action='store_true', dest='bypass_hooks', help='bypass upload presubmit hook')
    parser.add_option('--bypass-watchlists', action='store_true', dest='bypass_watchlists', help='bypass watchlists auto CC-ing reviewers')
    parser.add_option('-f', action='store_true', dest='force', help="force yes to questions (don't prompt)")
    parser.add_option('-m', dest='message', help='message for patchset')
    parser.add_option('--message-file', dest='message_file', help='file which contains message for patchset')
    parser.add_option('-t', dest='title', help='title for patchset (Rietveld only)')
    parser.add_option('-r', '--reviewers', action='append', default=[], help='reviewer email addresses')
    parser.add_option('--cc', action='append', default=[], help='cc email addresses')
    parser.add_option('-s', '--send-mail', action='store_true', help='send email to reviewer immediately')
    parser.add_option('--emulate_svn_auto_props', '--emulate-svn-auto-props', action='store_true', dest='emulate_svn_auto_props', help="Emulate Subversion's auto properties feature.")
    parser.add_option('-c', '--use-commit-queue', action='store_true', help='tell the commit queue to commit this patchset')
    parser.add_option('--private', action='store_true', help='set the review private (rietveld only)')
    parser.add_option('--target_branch', '--target-branch', metavar='TARGET', help=('Apply CL to remote ref TARGET.  ' + 'Default: remote branch head, or master'))
    parser.add_option('--squash', action='store_true', help='Squash multiple commits into one (Gerrit only)')
    parser.add_option('--no-squash', action='store_true', help=("Don't squash multiple commits into one " + '(Gerrit only)'))
    parser.add_option('--email', default=None, help='email address to use to connect to Rietveld')
    parser.add_option('--tbr-owners', dest='tbr_owners', action='store_true', help='add a set of OWNERS to TBR')
    parser.add_option('-d', '--cq-dry-run', dest='cq_dry_run', action='store_true', help='Send the patchset to do a CQ dry run right after upload.')
    parser.add_option('--dependencies', action='store_true', help='Uploads CLs of all the local branches that depend on the current branch')
    orig_args = args
    add_git_similarity(parser)
    auth.add_auth_options(parser)
    _add_codereview_select_options(parser)
    (options, args) = parser.parse_args(args)
    _process_codereview_select_options(parser, options)
    auth_config = auth.extract_auth_config_from_options(options)
    if git_common.is_dirty_git_tree('upload'):
        return 1
    options.reviewers = cleanup_list(options.reviewers)
    options.cc = cleanup_list(options.cc)
    if options.message_file:
        if options.message:
            parser.error('only one of --message and --message-file allowed.')
        options.message = gclient_utils.FileRead(options.message_file)
        options.message_file = None
    settings.GetIsGerrit()
    cl = Changelist(auth_config=auth_config, codereview=options.forced_codereview)
    return cl.CMDUpload(options, args, orig_args)
Uploads the current changelist to codereview.

Can skip dependency patchset uploads for a branch by running:
  git config branch.branch_name.skip-deps-uploads True
To unset run:
  git config --unset branch.branch_name.skip-deps-uploads
Can also set the above globally by using the --global flag.
@subcommand.usage('[args to "git diff"]')
def CMDupload(parser, args):
    'Uploads the current changelist to codereview.\n\n  Can skip dependency patchset uploads for a branch by running:\n    git config branch.branch_name.skip-deps-uploads True\n  To unset run:\n    git config --unset branch.branch_name.skip-deps-uploads\n  Can also set the above globally by using the --global flag.\n  '
    parser.add_option('--bypass-hooks', action='store_true', dest='bypass_hooks', help='bypass upload presubmit hook')
    parser.add_option('--bypass-watchlists', action='store_true', dest='bypass_watchlists', help='bypass watchlists auto CC-ing reviewers')
    parser.add_option('-f', action='store_true', dest='force', help="force yes to questions (don't prompt)")
    parser.add_option('-m', dest='message', help='message for patchset')
    parser.add_option('--message-file', dest='message_file', help='file which contains message for patchset')
    parser.add_option('-t', dest='title', help='title for patchset (Rietveld only)')
    parser.add_option('-r', '--reviewers', action='append', default=[], help='reviewer email addresses')
    parser.add_option('--cc', action='append', default=[], help='cc email addresses')
    parser.add_option('-s', '--send-mail', action='store_true', help='send email to reviewer immediately')
    parser.add_option('--emulate_svn_auto_props', '--emulate-svn-auto-props', action='store_true', dest='emulate_svn_auto_props', help="Emulate Subversion's auto properties feature.")
    parser.add_option('-c', '--use-commit-queue', action='store_true', help='tell the commit queue to commit this patchset')
    parser.add_option('--private', action='store_true', help='set the review private (rietveld only)')
    parser.add_option('--target_branch', '--target-branch', metavar='TARGET', help=('Apply CL to remote ref TARGET.  ' + 'Default: remote branch head, or master'))
    parser.add_option('--squash', action='store_true', help='Squash multiple commits into one (Gerrit only)')
    parser.add_option('--no-squash', action='store_true', help=("Don't squash multiple commits into one " + '(Gerrit only)'))
    parser.add_option('--email', default=None, help='email address to use to connect to Rietveld')
    parser.add_option('--tbr-owners', dest='tbr_owners', action='store_true', help='add a set of OWNERS to TBR')
    parser.add_option('-d', '--cq-dry-run', dest='cq_dry_run', action='store_true', help='Send the patchset to do a CQ dry run right after upload.')
    parser.add_option('--dependencies', action='store_true', help='Uploads CLs of all the local branches that depend on the current branch')
    orig_args = args
    add_git_similarity(parser)
    auth.add_auth_options(parser)
    _add_codereview_select_options(parser)
    (options, args) = parser.parse_args(args)
    _process_codereview_select_options(parser, options)
    auth_config = auth.extract_auth_config_from_options(options)
    if git_common.is_dirty_git_tree('upload'):
        return 1
    options.reviewers = cleanup_list(options.reviewers)
    options.cc = cleanup_list(options.cc)
    if options.message_file:
        if options.message:
            parser.error('only one of --message and --message-file allowed.')
        options.message = gclient_utils.FileRead(options.message_file)
        options.message_file = None
    settings.GetIsGerrit()
    cl = Changelist(auth_config=auth_config, codereview=options.forced_codereview)
    return cl.CMDUpload(options, args, orig_args)