From 450aa8d76cbfd4635e2650dfa6630a1876eaf3f6 Mon Sep 17 00:00:00 2001 From: Josip Sokcevic Date: Wed, 3 Jan 2024 00:05:13 +0000 Subject: [PATCH] [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 Reviewed-by: Gavin Mak --- git_cl.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/git_cl.py b/git_cl.py index e4aee41ab..daa02d5df 100755 --- a/git_cl.py +++ b/git_cl.py @@ -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