Skip to content

Commit

Permalink
Merge pull request #143 from GEOS-ESM/hotfix/mathomp4/mom6-fix
Browse files Browse the repository at this point in the history
Fix for cloning exposed by mom6
  • Loading branch information
mathomp4 committed Mar 16, 2021
2 parents cd56477 + 2911975 commit 5fa4144
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
6 changes: 4 additions & 2 deletions mepo.d/command/clone/clone.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,13 @@ def run(args):
for comp in allcomps:
if not comp.fixture:
git = GitRepository(comp.remote, comp.local)
version = comp.version.name
version = version.replace('origin/','')
recurse = comp.recurse_submodules
git.clone(recurse)
git.clone(version,recurse)
if comp.sparse:
git.sparsify(comp.sparse)
git.checkout(comp.version.name)
#git.checkout(comp.version.name)
print_clone_info(comp, max_namelen)

def print_clone_info(comp, name_width):
Expand Down
3 changes: 2 additions & 1 deletion mepo.d/command/compare/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ def print_header(max_namelen, max_origlen):

def print_cmp(name, orig, curr, name_width, orig_width):
name_blank = ''
if orig not in curr:
#if orig not in curr:
if curr not in orig:
name = colors.RED + name + colors.RESET
name_blank = colors.RED + name_blank + colors.RESET
name_width += len(colors.RED) + len(colors.RESET)
Expand Down
3 changes: 2 additions & 1 deletion mepo.d/command/status/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def print_status(allcomps, result):
time.sleep(0.025)
current_version, internal_state_branch_name, output = result[index]
# Check to see if the current tag/branch is the same as the original
if comp.version.name not in internal_state_branch_name:
#if comp.version.name not in internal_state_branch_name:
if internal_state_branch_name not in comp.version.name:
component_name = colors.RED + comp.name + colors.RESET
width = orig_width + len(colors.RED) + len(colors.RESET)
else:
Expand Down
4 changes: 2 additions & 2 deletions mepo.d/repository/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ def get_full_local_path(self):
def get_remote_url(self):
return self.__remote

def clone(self, recurse):
def clone(self, version, recurse):
cmd = 'git clone '
if recurse:
cmd += '--recurse-submodules '
cmd += '--quiet {} {}'.format(self.__remote, self.__local)
cmd += '--branch {} --quiet {} {}'.format(version, self.__remote, self.__local)
shellcmd.run(cmd.split())

def checkout(self, version):
Expand Down

0 comments on commit 5fa4144

Please sign in to comment.