aboutsummaryrefslogtreecommitdiff
path: root/llvm_tools/patch_manager.py
diff options
context:
space:
mode:
authorSalud Lemus <saludlemus@google.com>2019-08-22 10:43:22 -0700
committerSalud Lemus <saludlemus@google.com>2019-08-22 19:54:56 +0000
commit39385f9275505753ba34a45aa9dde6051b513ac0 (patch)
tree220ddf252901abfc986707fb2f995d9d3eec7388 /llvm_tools/patch_manager.py
parenteceb8944c4f67edee85ff9606e142e770f1d453a (diff)
downloadtoolchain-utils-39385f9275505753ba34a45aa9dde6051b513ac0.tar.gz
LLVM tools: Fixed remove patches mode when dealing with future patches
The issue was that if a patch is from the future (e.g. its start version > SVN version) then that patch would be removed in 'remove_patches' mode. BUG=None TEST=Ran the script on revision 365631 and the expected patches to be removed were removed from the JSON file. Change-Id: I42e63f972103b4f48b6e9ffeaa75a0263f31ec79 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1765950 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: Salud Lemus <saludlemus@google.com>
Diffstat (limited to 'llvm_tools/patch_manager.py')
-rwxr-xr-xllvm_tools/patch_manager.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/llvm_tools/patch_manager.py b/llvm_tools/patch_manager.py
index 14e5058d..07c88e6a 100755
--- a/llvm_tools/patch_manager.py
+++ b/llvm_tools/patch_manager.py
@@ -500,12 +500,15 @@ def HandlePatches(svn_version,
svn_version < patch_metadata[1])
if can_modify_patches:
- # Add to the list only if the mode can potentially modify a patch
- # or if the mode is 'remove_patches', then all patches that are
- # applicable will be added to the updated .json file and all patches
- # that are not applicable will be added to the remove patches list which
- # will not be included in the updated .json file.
- if patch_applicable or mode != FailureModes.REMOVE_PATCHES:
+ # Add to the list only if the mode can potentially modify a patch.
+ #
+ # If the mode is 'remove_patches', then all patches that are
+ # applicable or are from the future will be added to the updated .json
+ # file and all patches that are not applicable will be added to the
+ # remove patches list which will not be included in the updated .json
+ # file.
+ if patch_applicable or svn_version < patch_metadata[0] or \
+ mode != FailureModes.REMOVE_PATCHES:
applicable_patches.append(cur_patch_dict)
elif mode == FailureModes.REMOVE_PATCHES:
removed_patches.append(path_to_patch)