Skip to content

Commit

Permalink
Merge branch 'develop' into feature/mathomp4/#30-add-develop-override
Browse files Browse the repository at this point in the history
  • Loading branch information
tclune authored Mar 8, 2021
2 parents 32081e7 + 18e1108 commit 20af0ad
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
{
"name": "Chakraborty, Purnendu"
},
{
"name": "Jamieson, William",
"affiliation": "GMAO SSAI",
"orcid": "0000-0001-5976-4492"
},
{
"name": "Clune, Tom",
"affiliation": "NASA",
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# mepo [![Actions Status](https://github.com/pchakraborty/mepo/workflows/Unit%20testing%20of%20mepo/badge.svg)](https://github.com/pchakraborty/mepo/actions)
`mepo` is a tool, written in Python3 (3.6.0+), to manage (m)ultiple git r(epo)sitories, by attempting to create an illusion of a 'single repository' for multi-repository projects. Please see the [Wiki](../../wiki) for examples of `mepo` workflows.

## Presentation

The SI Team has made a PowerPoint about `mepo` that can be found [here](https://github.com/GEOS-ESM/mepo/wiki/files/MEPO-2020Nov19.pptx).
6 changes: 3 additions & 3 deletions mepo.d/command/save/save.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ def _update_comp(comp):
git = GitRepository(comp.remote, comp.local)
orig_ver = comp.version
curr_ver = MepoVersion(*git.get_version())
if _version_has_changed(curr_ver, orig_ver):
if _version_has_changed(curr_ver, orig_ver, comp.name):
_verify_local_and_remote_commit_ids_match(git, curr_ver.name, comp.name, curr_ver.type)
comp.version = curr_ver

def _version_has_changed(curr_ver, orig_ver):
def _version_has_changed(curr_ver, orig_ver, name):
result = False
if curr_ver != orig_ver:
if curr_ver.type == 'b':
assert curr_ver.detached is False, '{}'.format(curr_ver)
assert curr_ver.detached is False, f'You cannot save a detached branch, have you committed your code in {name}?\n {curr_ver}'
result = True
elif curr_ver.type == 't':
result = True
Expand Down
4 changes: 3 additions & 1 deletion mepo.d/repository/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,9 @@ def get_version(self):
name = tmp[5:]
tYpe = 't'
else:
name = tmp
cmd_for_branch = self.__git + ' reflog HEAD -n 1'
reflog_output = shellcmd.run(cmd_for_branch.split(), output=True)
name = reflog_output.split()[-1].strip()
tYpe = 'b'
elif output.startswith('HEAD'): # Assume hash
cmd = self.__git + ' rev-parse HEAD'
Expand Down

0 comments on commit 20af0ad

Please sign in to comment.