-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/mathomp4/#30-add-develop-override
- Loading branch information
Showing
27 changed files
with
629 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"license": "other-open", | ||
"upload_type": "software", | ||
"creators": [ | ||
{ | ||
"name": "Thompson, Matthew", | ||
"affiliation": "GMAO SSAI", | ||
"orcid": "0000-0001-6222-6863" | ||
}, | ||
{ | ||
"name": "Chakraborty, Purnendu" | ||
}, | ||
{ | ||
"name": "Clune, Tom", | ||
"affiliation": "NASA", | ||
"orcid": "0000-0003-3320-0204" | ||
} | ||
], | ||
"contributors": [ | ||
{ | ||
"name": "Thompson, Matthew", | ||
"affiliation": "GMAO SSAI", | ||
"orcid": "0000-0001-6222-6863", | ||
"type": "ContactPerson" | ||
}, | ||
{ | ||
"name": "Clune, Tom", | ||
"affiliation": "NASA", | ||
"orcid": "0000-0003-3320-0204", | ||
"type": "ProjectLeader" | ||
} | ||
], | ||
"keywords": [ | ||
"git", | ||
"repository", | ||
"python", | ||
"yaml" | ||
], | ||
"access_right": "open" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import argparse | ||
|
||
class MepoStashArgParser(object): | ||
|
||
def __init__(self, stash): | ||
self.stash = stash.add_subparsers() | ||
self.stash.title = 'mepo stash sub-commands' | ||
self.stash.dest = 'mepo_stash_cmd' | ||
self.stash.required = True | ||
self.__push() | ||
self.__list() | ||
self.__pop() | ||
self.__apply() | ||
self.__show() | ||
|
||
def __push(self): | ||
stpush = self.stash.add_parser( | ||
'push', | ||
description = 'Push (create) stash in component <comp-name>') | ||
stpush.add_argument( | ||
'-m', '--message', | ||
type=str, | ||
metavar = 'message', | ||
default=None, | ||
help = 'Message for the stash') | ||
stpush.add_argument( | ||
'comp_name', | ||
metavar = 'comp-name', | ||
nargs = '+', | ||
help = 'Component to push stash in') | ||
|
||
def __show(self): | ||
stshow = self.stash.add_parser( | ||
'show', | ||
description = 'show stash in component <comp-name>') | ||
stshow.add_argument( | ||
'-p', '--patch', | ||
action = 'store_true', | ||
help = 'Message for the stash') | ||
stshow.add_argument( | ||
'comp_name', | ||
metavar = 'comp-name', | ||
nargs = '+', | ||
help = 'Component to show stash in') | ||
|
||
def __list(self): | ||
stlist = self.stash.add_parser( | ||
'list', | ||
description = 'List local stashes of all components') | ||
|
||
def __pop(self): | ||
stpop = self.stash.add_parser( | ||
'pop', | ||
description = 'Pop stash in component <comp-name>') | ||
stpop.add_argument( | ||
'comp_name', | ||
metavar = 'comp-name', | ||
nargs = '+', | ||
help = 'Component to pop stash in') | ||
|
||
def __apply(self): | ||
stapply = self.stash.add_parser( | ||
'apply', | ||
description = 'apply stash in component <comp-name>') | ||
stapply.add_argument( | ||
'comp_name', | ||
metavar = 'comp-name', | ||
nargs = '+', | ||
help = 'Component to apply stash in') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import argparse | ||
|
||
class MepoTagArgParser(object): | ||
|
||
def __init__(self, tag): | ||
self.tag = tag.add_subparsers() | ||
self.tag.title = 'mepo tag sub-commands' | ||
self.tag.dest = 'mepo_tag_cmd' | ||
self.tag.required = True | ||
self.__list() | ||
self.__create() | ||
self.__delete() | ||
|
||
def __list(self): | ||
tglist = self.tag.add_parser( | ||
'list', | ||
description = 'List tags.' | ||
'If no component is specified, runs over all components') | ||
tglist.add_argument( | ||
'comp_name', | ||
metavar = 'comp-name', | ||
nargs = '*', | ||
help = 'Component to list tags in') | ||
|
||
def __create(self): | ||
create = self.tag.add_parser( | ||
'create', | ||
description = 'Create tag <tag-name> in component <comp-name>') | ||
create.add_argument('tag_name', metavar = 'tag-name') | ||
create.add_argument( | ||
'-a', '--annotate', | ||
action = 'store_true', | ||
help = "Make an annotated tag") | ||
create.add_argument( | ||
'-m', '--message', | ||
type=str, | ||
metavar = 'message', | ||
default = None, | ||
help = "Message for the tag" | ||
) | ||
create.add_argument( | ||
'comp_name', | ||
metavar = 'comp-name', | ||
nargs = '+', | ||
help = 'Component to create tags in') | ||
|
||
def __delete(self): | ||
delete = self.tag.add_parser( | ||
'delete', | ||
description = 'Delete tag <tag-name> in component <comp-name>') | ||
delete.add_argument('tag_name', metavar = 'tag-name') | ||
delete.add_argument( | ||
'comp_name', | ||
metavar = 'comp-name', | ||
nargs = '+', | ||
help = 'Component to delete tags in') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,22 @@ | ||
from state.state import MepoState | ||
from utilities import verify | ||
from repository.git import GitRepository | ||
|
||
def run(args): | ||
allcomps = MepoState.read_state() | ||
max_namelen = len(max([x.name for x in allcomps], key=len)) | ||
comps2list = _get_comps_to_list(args.comp_name, allcomps) | ||
max_namelen = len(max([x.name for x in comps2list], key=len)) | ||
FMT = '{:<%s.%ss} | {:<s}' % (max_namelen, max_namelen) | ||
for comp in allcomps: | ||
for comp in comps2list: | ||
git = GitRepository(comp.remote, comp.local) | ||
output = git.list_branch(args.all).rstrip().split('\n') | ||
print(FMT.format(comp.name, output[0])) | ||
for line in output[1:]: | ||
print(FMT.format('', line)) | ||
|
||
def _get_comps_to_list(specified_comps, allcomps): | ||
comps_to_list = allcomps | ||
if specified_comps: | ||
verify.valid_components(specified_comps, allcomps) | ||
comps_to_list = [x for x in allcomps if x.name in specified_comps] | ||
return comps_to_list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.