Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove deprecated use_git_am option to apply_patch #4244

Merged
merged 1 commit into from
Apr 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 1 addition & 5 deletions easybuild/tools/filetools.py
Original file line number Diff line number Diff line change
Expand Up @@ -1540,18 +1540,14 @@ def validate_patch_spec(patch_spec):
_log.deprecated(msg, '5.0')


def apply_patch(patch_file, dest, fn=None, copy=False, level=None, use_git_am=False, use_git=False):
def apply_patch(patch_file, dest, fn=None, copy=False, level=None, use_git=False):
"""
Apply a patch to source code in directory dest
- assume unified diff created with "diff -ru old new"

Raises EasyBuildError on any error and returns True on success
"""

if use_git_am:
_log.deprecated("'use_git_am' named argument in apply_patch function has been renamed to 'use_git'", '5.0')
use_git = True

if build_option('extended_dry_run'):
# skip checking of files in dry run mode
patch_filename = os.path.basename(patch_file)
Expand Down
9 changes: 0 additions & 9 deletions test/framework/filetools.py
Original file line number Diff line number Diff line change
Expand Up @@ -1765,15 +1765,6 @@ def test_apply_patch(self):

self.assertNotIn("I'm a toy, and very proud of it", ft.read_file(toy_source_path))

# mock stderr to catch deprecation warning caused by setting 'use_git_am'
self.allow_deprecated_behaviour()
self.mock_stderr(True)
ft.apply_patch(toy_patch, self.test_prefix, use_git_am=True)
stderr = self.get_stderr()
self.mock_stderr(False)
self.assertIn("I'm a toy, and very proud of it", ft.read_file(toy_source_path))
self.assertIn("'use_git_am' named argument in apply_patch function has been renamed to 'use_git'", stderr)

def test_copy_file(self):
"""Test copy_file function."""
testdir = os.path.dirname(os.path.abspath(__file__))
Expand Down