Skip to content

Commit a9441a8

Browse files
committed
update git-fleximod to 0.9.3
1 parent 51d1e07 commit a9441a8

File tree

9 files changed

+38
-32
lines changed

9 files changed

+38
-32
lines changed

.lib/git-fleximod/git_fleximod/cli.py

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,31 @@
22
import argparse
33
from git_fleximod import utils
44

5-
__version__ = "0.9.2"
5+
__version__ = "0.9.3"
66

77
def find_root_dir(filename=".gitmodules"):
88
""" finds the highest directory in tree
99
which contains a file called filename """
10-
d = Path.cwd()
11-
root = Path(d.root)
12-
dirlist = []
13-
dl = d
14-
while dl != root:
15-
dirlist.append(dl)
16-
dl = dl.parent
17-
dirlist.append(root)
18-
dirlist.reverse()
19-
20-
for dl in dirlist:
21-
attempt = dl / filename
22-
if attempt.is_file():
23-
return str(dl)
24-
return None
25-
10+
try:
11+
root = utils.execute_subprocess(["git","rev-parse", "--show-toplevel"],
12+
output_to_caller=True ).rstrip()
13+
except:
14+
d = Path.cwd()
15+
root = Path(d.root)
16+
dirlist = []
17+
dl = d
18+
while dl != root:
19+
dirlist.append(dl)
20+
dl = dl.parent
21+
dirlist.append(root)
22+
dirlist.reverse()
23+
24+
for dl in dirlist:
25+
attempt = dl / filename
26+
if attempt.is_file():
27+
return str(dl)
28+
return None
29+
return Path(root)
2630

2731
def get_parser():
2832
description = """

.lib/git-fleximod/git_fleximod/git_fleximod.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ def main():
342342
excludelist=excludelist,
343343
)
344344
if not gitmodules.sections():
345-
sys.exit("No submodule components found")
345+
sys.exit(f"No submodule components found, root_dir={root_dir}")
346346
retval = 0
347347
if action == "update":
348348
submodules_update(gitmodules, root_dir, fxrequired, force)

.lib/git-fleximod/git_fleximod/submodule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def sparse_checkout(self):
221221
if superroot:
222222
gitroot = superroot.strip()
223223
else:
224-
gitroot = self.root_dir.strip()
224+
gitroot = self.root_dir
225225
# Now need to move the .git dir to the submodule location
226226
rootdotgit = os.path.join(self.root_dir, ".git")
227227
while os.path.isfile(rootdotgit):

.lib/git-fleximod/poetry.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.lib/git-fleximod/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "git-fleximod"
3-
version = "0.9.2"
3+
version = "0.9.3"
44
description = "Extended support for git-submodule and git-sparse-checkout"
55
authors = ["Jim Edwards <[email protected]>"]
66
maintainers = ["Jim Edwards <[email protected]>"]

.lib/git-fleximod/tbump.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
github_url = "https://github.com/jedwards4b/git-fleximod/"
33

44
[version]
5-
current = "0.9.2"
5+
current = "0.9.3"
66

77
# Example of a semver regexp.
88
# Make sure this matches current_version before

.lib/git-fleximod/tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def logger():
3232
"submodule_name": "test_optional",
3333
"status1" : "test_optional MPIserial_2.5.0-3-gd82ce7c is out of sync with .gitmodules MPIserial_2.4.0",
3434
"status2" : "test_optional at tag MPIserial_2.4.0",
35-
"status3" : "test_optional not checked out, out of sync at tag None, expected tag is MPIserial_2.4.0 (optional)",
35+
"status3" : "test_optional not checked out, out of sync at tag MPIserial_2.5.1, expected tag is MPIserial_2.4.0 (optional)",
3636
"status4" : "test_optional at tag MPIserial_2.4.0",
3737
"gitmodules_content": """
3838
[submodule "test_optional"]
@@ -46,7 +46,7 @@ def logger():
4646
"submodule_name": "test_alwaysoptional",
4747
"status1" : "test_alwaysoptional MPIserial_2.3.0 is out of sync with .gitmodules e5cf35c",
4848
"status2" : "test_alwaysoptional at hash e5cf35c",
49-
"status3" : "out of sync at tag None, expected tag is e5cf35c",
49+
"status3" : "out of sync at tag MPIserial_2.5.1, expected tag is e5cf35c",
5050
"status4" : "test_alwaysoptional at hash e5cf35c",
5151
"gitmodules_content": """
5252
[submodule "test_alwaysoptional"]

doc/ChangeLog

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
===============================================================
22

3-
Tag name: cam6_4_047
3+
Tag name: cam6_4_049
44
Originator(s): peverwhee
5-
Date: 12 November 2024
5+
Date: November 2024
66
One-line Summary: History bugfixes
77
Github PR URL: https://github.com/ESCOMP/CAM/pull/1163
88

@@ -12,7 +12,8 @@ Purpose of changes (include the issue number and title text for each relevant Gi
1212
- Issue #1166: time_bounds array should not be present in history files containing instantaneous output
1313
- Issue #1167: Time shown in history file names is incorrect for instantaneous data
1414
- Issue #1183: Suggested improvement for openfile
15-
- Updates git-fleximod to v0.9.2
15+
- Update git-fleximod to v0.9.3
16+
- Update archive_baseline.sh modify read permissions on izumi
1617

1718
Describe any changes made to build system:
1819
M bld/namelist_files/use_cases/sd_waccm_sulfur.xml
@@ -66,6 +67,9 @@ M src/physics/cam7/stochastic_tau_cam.F90
6667
M src/utils/cam_pio_utils.F90
6768
- move filename logging to before pio call
6869

70+
M test/system/archive_baseline.sh
71+
- make all baseline files globally readable on izumi
72+
6973
If there were any failures reported from running test_driver.sh on any test
7074
platform, and checkin with these failures has been OK'd by the gatekeeper,
7175
then copy the lines from the td.*.status files for the failed tests to the

test/system/archive_baseline.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ case $hostname in
6868
test_file_list="tests_pretag_izumi_${CAM_FC,,}"
6969
cam_tag=$1_${CAM_FC,,}
7070
baselinedir="/fs/cgd/csm/models/atm/cam/pretag_bl/$cam_tag"
71-
chmod_cmd="chmod -R a+r ${baselinedir}"
7271
;;
7372

7473
de*)
@@ -79,7 +78,6 @@ case $hostname in
7978
test_file_list="tests_pretag_derecho_${CAM_FC,,}"
8079
cam_tag=$1_${CAM_FC,,}
8180
baselinedir="/glade/campaign/cesm/community/amwg/cam_baselines/$cam_tag"
82-
chmod_cmd=""
8381
;;
8482

8583
* ) echo "ERROR: machine $hostname not currently supported"; exit 1 ;;
@@ -99,7 +97,7 @@ if [ -n "$CESM_TESTDIR" ]; then
9997
if [ -d $CESM_TESTDIR/baselines ]; then
10098
echo "Using cp to archive baselines."
10199
cp -r $CESM_TESTDIR/baselines/. $root_baselinedir/$cam_tag
102-
eval ${chmod_cmd}
100+
chmod -R a+r ${baselinedir}
103101
else
104102
echo "Using bless_test_results to archive baselines."
105103
../../cime/CIME/Tools/bless_test_results -p -t '' -c '' -r $CESM_TESTDIR --baseline-root $root_baselinedir -b $cam_tag -f -s

0 commit comments

Comments
 (0)