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

Unified Diff: git_cl.py

Issue 1641903002: Use current issue number for git cl patch (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698