13
13
# pylint: disable=import-error,redefined-builtin
14
14
from CIME import utils
15
15
from CIME .config import Config
16
- from CIME .utils import expect , get_cime_root , append_status
16
+ from CIME .status import append_status
17
+ from CIME .utils import expect , get_cime_root
17
18
from CIME .utils import convert_to_type , get_model , set_model
18
19
from CIME .utils import get_project , get_charge_account , check_name
19
20
from CIME .utils import get_current_commit , safe_copy , get_cime_default_driver
21
+ from CIME .gitinterface import GitInterface
20
22
from CIME .locked_files import LOCKED_DIR , lock_file
21
23
from CIME .XML .machines import Machines
22
24
from CIME .XML .pes import Pes
@@ -77,7 +79,7 @@ class Case(object):
77
79
78
80
"""
79
81
80
- from CIME .case .case_setup import case_setup
82
+ from CIME .case .case_setup import case_setup , _create_case_repo
81
83
from CIME .case .case_clone import create_clone , _copy_user_modified_to_clone
82
84
from CIME .case .case_test import case_test
83
85
from CIME .case .case_submit import check_DA_settings , check_case , submit
@@ -98,7 +100,6 @@ class Case(object):
98
100
)
99
101
100
102
def __init__ (self , case_root = None , read_only = True , record = False , non_local = False ):
101
-
102
103
if case_root is None :
103
104
case_root = os .getcwd ()
104
105
expect (
@@ -164,7 +165,7 @@ def __init__(self, case_root=None, read_only=True, record=False, non_local=False
164
165
self ._component_description = {}
165
166
self ._is_env_loaded = False
166
167
self ._loaded_envs = None
167
-
168
+ self . _gitinterface = None
168
169
# these are user_mods as defined in the compset
169
170
# Command Line user_mods are handled seperately
170
171
@@ -199,6 +200,10 @@ def __init__(self, case_root=None, read_only=True, record=False, non_local=False
199
200
mach == probed_machine ,
200
201
f"Current machine { probed_machine } does not match case machine { mach } ." ,
201
202
)
203
+ if os .path .exists (os .path .join (self .get_value ("CASEROOT" ), ".git" )):
204
+ self ._gitinterface = GitInterface (
205
+ self .get_value ("CASEROOT" ), logger
206
+ )
202
207
203
208
self .initialize_derived_attributes ()
204
209
@@ -682,7 +687,6 @@ def _set_compset(self, compset_name, files):
682
687
# Loop through all of the files listed in COMPSETS_SPEC_FILE and find the file
683
688
# that has a match for either the alias or the longname in that order
684
689
for component in components :
685
-
686
690
# Determine the compsets file for this component
687
691
compsets_filename = files .get_value (
688
692
"COMPSETS_SPEC_FILE" , {"component" : component }
@@ -1284,7 +1288,6 @@ def configure(
1284
1288
gpu_type = None ,
1285
1289
gpu_offload = None ,
1286
1290
):
1287
-
1288
1291
expect (
1289
1292
check_name (compset_name , additional_chars = "." ),
1290
1293
"Invalid compset name {}" .format (compset_name ),
0 commit comments