[git_cl] Force lookup CL number

UploadAllSquashed doesn't have access to `cl` object and can't update
the issue number. When a new cl is uploaded with --dependencies flag,
`cl` that is passed to upload_branch_deps is outdated - GetIssue returns
None.

Instead of passing cl, or overriding cl in CMDupload with one generated
by UploadAllSquashed, simply unset lookedup_issue which forces GetIssue
to read value from git config.

R=gavinmak@google.com

Fixed: 1514055
Change-Id: I8a55807b097d464379aade20d9cfa3c01f1db69a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5148352
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
changes/52/5148352/2
Josip Sokcevic 1 year ago committed by LUCI CQ
parent 2bd782954f
commit 450aa8d76c

@ -5095,6 +5095,11 @@ def CMDupload(parser, args):
UploadAllSquashed(options, orig_args)
if options.dependencies:
orig_args.remove('--dependencies')
if not cl.GetIssue():
# UploadAllSquashed stored an issue number for cl, but it
# doesn't have access to cl object. By unsetting lookedup_issue,
# we force code path that will read issue from the config.
cl.lookedup_issue = False
return upload_branch_deps(cl, orig_args, options.force)
return 0

Loading…
Cancel
Save