Skip to content

Commit

Permalink
No longer check if the patch list and patch files don't match
Browse files Browse the repository at this point in the history
If the user does not manually edit those (i.e. only uses format-patch), it will always be up to date
Additionally, since self.old_tag wasn't updated, format_patch would have false positives
  • Loading branch information
KangarooKoala committed Jul 22, 2024
1 parent 356e81e commit 6717645
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions upstream_utils/upstream_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,38 +262,6 @@ def __init__(
self.pre_patch_commits = pre_patch_commits
self.wpilib_root = get_repo_root()

def check_patches(self):
"""Checks that the patch list supplied to the constructor matches the
patches in the patch directory.
"""
patch_directory_patches = set()
patch_directory = os.path.join(
self.wpilib_root, f"upstream_utils/{self.name}_patches"
)
if os.path.exists(patch_directory):
for f in os.listdir(patch_directory):
if f.endswith(".patch"):
patch_directory_patches.add(f)
patches = set(self.patch_list)
patch_directory_only = sorted(patch_directory_patches - patches)
patch_list_only = sorted(patches - patch_directory_patches)
common_patches = sorted(patch_directory_patches & patches)
warning = False
if patch_directory_only:
print(
f"WARNING: The patch directory has patches {patch_directory_only} not in the patch list"
)
warning = True
if patch_list_only:
print(
f"WARNING: The patch list has patches {patch_list_only} not in the patch directory"
)
warning = True
if warning and common_patches:
print(
f" Note: The patch directory and the patch list both have patches {common_patches}"
)

def get_repo_path(self, tempdir=None):
"""Returns the path to the clone of the upstream repository.
Expand Down Expand Up @@ -654,5 +622,3 @@ def main(self, argv=sys.argv[1:]):
self.format_patch()
elif args.subcommand == "copy-upstream-to-thirdparty":
self.copy_upstream_to_thirdparty()

self.check_patches()

0 comments on commit 6717645

Please sign in to comment.