diff options
author | Jian Cai <jiancai@google.com> | 2021-05-14 17:07:46 -0700 |
---|---|---|
committer | Jian Cai <jiancai@google.com> | 2021-05-15 00:49:16 +0000 |
commit | bc16e2fb4ddcefcfb6c16816249c4b864a2a65a7 (patch) | |
tree | 3ba533ff6edeb24d740b7f55b7d03c2b41d0ef6c | |
parent | d8f873694e5091bad5ea8c8e3bddf4a17f064384 (diff) | |
download | toolchain-utils-bc16e2fb4ddcefcfb6c16816249c4b864a2a65a7.tar.gz |
llvm_tool: make either --sha or --differential required.
This fixed the following error when only --sha or --differential is
used.
TypeError: can only concatenate list (not "NoneType") to list
BUG=b:187554374
TEST=get_upstream_patch.py --chroot_path <chroot> --start llvm --sha <sha>
TEST=get_upstream_patch.py --chroot_path <chroot> --start llvm --differential <rev>
TEST=get_upstream_patch.py --chroot_path <chroot> --start llvm
Change-Id: Ie50e1c081a6a41859d7e4db7a2d815e48b84fa3d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2898172
Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Jian Cai <jiancai@google.com>
-rwxr-xr-x | llvm_tools/get_upstream_patch.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm_tools/get_upstream_patch.py b/llvm_tools/get_upstream_patch.py index e1f321de..350fc25c 100755 --- a/llvm_tools/get_upstream_patch.py +++ b/llvm_tools/get_upstream_patch.py @@ -331,12 +331,13 @@ def main(): '"llvm" or "llvm-next", as well. Defaults to %(default)s.') parser.add_argument( '--sha', - required=True, action='append', + default=[], help='The LLVM git SHA to cherry-pick.') parser.add_argument( '--differential', action='append', + default=[], help='The LLVM differential revision to apply. Example: D1234') parser.add_argument( '--create_cl', @@ -345,6 +346,9 @@ def main(): help='Automatically create a CL if specified') args = parser.parse_args() + if not (args.sha or args.differential): + parser.error('--sha or --differential required') + get_from_upstream( chroot_path=args.chroot_path, create_cl=args.create_cl, |