diff options
author | Jian Cai <jiancai@google.com> | 2019-12-09 18:16:02 -0800 |
---|---|---|
committer | Jian Cai <jiancai@google.com> | 2019-12-10 18:53:23 +0000 |
commit | ed2720ea2d75c26366f4e4643c6cfeda39060e34 (patch) | |
tree | 7dd6d200d8ce717f2a27d53e301045124e33c30a /llvm_tools | |
parent | 896674c89c7077b0a8ecf7a34a2c941e8d3bc37f (diff) | |
download | toolchain-utils-ed2720ea2d75c26366f4e4643c6cfeda39060e34.tar.gz |
llvm_tools: update commit message
We should mention git hashes in the CLs automatically created for LLVM
roll now that the hashes become the only revision numbers LLVM uses.
BUG=chromium:1027950
TEST=local tests.
Change-Id: Iaec59599d4fa0d133e09d2a31db45c777a2d1e60
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1959439
Commit-Queue: Jian Cai <jiancai@google.com>
Tested-by: Jian Cai <jiancai@google.com>
Reviewed-by: George Burgess <gbiv@chromium.org>
Diffstat (limited to 'llvm_tools')
-rwxr-xr-x | llvm_tools/update_chromeos_llvm_next_hash.py | 26 | ||||
-rwxr-xr-x | llvm_tools/update_chromeos_llvm_next_hash_unittest.py | 4 |
2 files changed, 15 insertions, 15 deletions
diff --git a/llvm_tools/update_chromeos_llvm_next_hash.py b/llvm_tools/update_chromeos_llvm_next_hash.py index 30660de3..d47da46d 100755 --- a/llvm_tools/update_chromeos_llvm_next_hash.py +++ b/llvm_tools/update_chromeos_llvm_next_hash.py @@ -167,8 +167,8 @@ def _ConvertChrootPathsToSymLinkPaths(chromeos_root, chroot_file_paths): # and combine the chroot path with the result and add it to the list. for cur_chroot_file_path in chroot_file_paths: if not cur_chroot_file_path.startswith(chroot_prefix): - raise ValueError('Invalid prefix for the chroot path: %s' % - cur_chroot_file_path) + raise ValueError( + 'Invalid prefix for the chroot path: %s' % cur_chroot_file_path) rel_path = cur_chroot_file_path[len(chroot_prefix):] @@ -537,8 +537,8 @@ def StagePatchMetadataFileForCommit(patch_metadata_file_path): """ if not os.path.isfile(patch_metadata_file_path): - raise ValueError('Invalid patch metadata file provided: %s' % - patch_metadata_file_path) + raise ValueError( + 'Invalid patch metadata file provided: %s' % patch_metadata_file_path) # Cmd to stage the patch metadata file for commit. stage_patch_file = [ @@ -635,14 +635,15 @@ def UpdatePackages(packages, llvm_hash, llvm_version, chroot_path, try: if svn_option in get_llvm_hash.KNOWN_HASH_SOURCES: - commit_message_header = ('llvm-next/%s: Update packages to r%d' % - (svn_option, llvm_version)) + commit_message_header = ('llvm-next/%s: upgrade to %s (r%d)' % + (svn_option, llvm_hash, llvm_version)) else: - commit_message_header = 'llvm-next: Update packages to r%d' % llvm_version + commit_message_header = ( + 'llvm-next: upgrade to %s (r%d)' % (llvm_hash, llvm_version)) commit_messages = ['-m %s' % commit_message_header] - commit_messages.append('-m %s' % 'Following packages have been updated:') + commit_messages.append('-m The following packages have been updated:') # Holds the list of packages that are updating. packages = [] @@ -700,11 +701,10 @@ def main(): llvm_hash, llvm_version = GetLLVMHashAndVersionFromSVNOption(svn_option) - change_list = UpdatePackages(args_output.update_packages, llvm_hash, - llvm_version, args_output.chroot_path, - args_output.patch_metadata_file, - FailureModes(args_output.failure_mode), - svn_option) + change_list = UpdatePackages( + args_output.update_packages, llvm_hash, llvm_version, + args_output.chroot_path, args_output.patch_metadata_file, + FailureModes(args_output.failure_mode), svn_option) print('Successfully updated packages to %d' % llvm_version) print('Gerrit URL: %s' % change_list.url) diff --git a/llvm_tools/update_chromeos_llvm_next_hash_unittest.py b/llvm_tools/update_chromeos_llvm_next_hash_unittest.py index 756ee9c9..4e39bafa 100755 --- a/llvm_tools/update_chromeos_llvm_next_hash_unittest.py +++ b/llvm_tools/update_chromeos_llvm_next_hash_unittest.py @@ -917,8 +917,8 @@ class UpdateLLVMNextHashTest(unittest.TestCase): mock_uprev_ebuild.assert_called_once_with(symlink_path_to_package) expected_commit_messages = [ - '-m %s' % 'llvm-next/tot: Update packages to r1000', - '-m %s' % 'Following packages have been updated:', + '-m %s' % 'llvm-next/tot: upgrade to a123testhash5 (r1000)', + '-m %s' % 'The following packages have been updated:', '-m %s' % 'path/to', '-m %s' % 'For the package path/to:', '-m %s' % 'The patch metadata file PATCHES.json was modified', |