Chromium Code Reviews| Index: git_cl.py |
| diff --git a/git_cl.py b/git_cl.py |
| index 5441c1801b0fc1a92a86588195f108a4d710f391..f779c361526b88b292ca3f1581b5ba242d1ac05e 100755 |
| --- a/git_cl.py |
| +++ b/git_cl.py |
| @@ -2945,15 +2945,23 @@ def CMDpatch(parser, args): |
| 'attempting a 3-way merge') |
| parser.add_option('-n', '--no-commit', action='store_true', dest='nocommit', |
| help="don't commit after patch applies") |
| + parser.add_option('--reapply', action='store_true', |
| + dest='reapply', |
| + help="""Reapply the issue currently associated with the |
| +branch. Error if none, or if issue is also explicitly provided.""") |
| auth.add_auth_options(parser) |
| (options, args) = parser.parse_args(args) |
| auth_config = auth.extract_auth_config_from_options(options) |
| - if len(args) != 1: |
| - parser.print_help() |
| - return 1 |
| + issue_arg = None |
| + if (options.reapply) : |
| + if len(args) == 1: |
|
iannucci
2016/01/29 00:54:48
if len(args) < 0
I think is what you want. --reap
Mircea Trofin
2016/01/29 05:01:49
I'm confused, can len(args) be negative?
|
| + parser.print_help() |
| + return 1 |
| + issue_arg = Changelist().GetIssue() |
| + elif len(args) == 1: |
| + issue_arg = ParseIssueNum(args[0]) |
| - issue_arg = ParseIssueNum(args[0]) |
| # The patch URL works because ParseIssueNum won't do any substitution |
| # as the re.sub pattern fails to match and just returns it. |
| if issue_arg == None: |