File tree Expand file tree Collapse file tree 2 files changed +0
-31
lines changed Expand file tree Collapse file tree 2 files changed +0
-31
lines changed Original file line number Diff line number Diff line change 4
4
import click
5
5
from .config import test_settings_map
6
6
from .utils import (
7
- apply_patches ,
8
7
copy_mongo_apps ,
9
8
copy_mongo_migrations ,
10
9
copy_mongo_settings ,
@@ -368,7 +367,6 @@ def test(
368
367
)
369
368
return
370
369
command = [test_settings_map [repo_name ]["test_command" ]]
371
- apply_patches (repo_name )
372
370
copy_mongo_migrations (repo_name )
373
371
copy_mongo_apps (repo_name )
374
372
Original file line number Diff line number Diff line change 12
12
from .config import test_settings_map
13
13
14
14
15
- def apply_patches (repo_name ):
16
- """Apply a patch file to the specified project directory."""
17
- repo_dir = test_settings_map [repo_name ]["clone_dir" ]
18
- patch_dir = os .path .join ("patches" , repo_name )
19
- if os .path .exists (patch_dir ):
20
- for patch_file in os .listdir (patch_dir ):
21
- shutil .copyfile (
22
- os .path .join (patch_dir , patch_file ),
23
- os .path .join (repo_dir , patch_file ),
24
- )
25
- click .echo (click .style (f"Applying patch { patch_file } " , fg = "blue" ))
26
- # Ensure the repository is valid
27
- repo = git .Repo (repo_dir )
28
- if not repo .bare :
29
- try :
30
- # Apply the patch
31
- repo .git .apply (patch_file )
32
- click .echo (
33
- f"Patch { os .path .basename (patch_file )} applied successfully."
34
- )
35
- except Exception as e :
36
- click .echo (f"Failed to apply patch: { e } " )
37
- return
38
- else :
39
- click .echo ("Not a valid Git repository." )
40
- return
41
- click .echo (click .style ("Patch applied" , fg = "green" ))
42
-
43
-
44
15
def copy_mongo_apps (repo_name ):
45
16
"""Copy the appropriate mongo_apps file based on the repo name."""
46
17
if "apps_file" in test_settings_map [repo_name ] and repo_name != "django" :
You can’t perform that action at this time.
0 commit comments