Skip to content

Commit

Permalink
bugfix: replace Mepo with mepo_state
Browse files Browse the repository at this point in the history
  • Loading branch information
pchakraborty committed Oct 28, 2019
1 parent 30ad1cb commit 4bf721e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
15 changes: 8 additions & 7 deletions mepo.d/branch/branch.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
from Mepo import MepoState
from mepo_state import MepoState
from create import create
from switch import switch

def run(args):
branch_cmd = args.mepo_branch_cmd
branch_name = args.branch_name
if branch_cmd == 'create':
create.run(branch_name)
elif branch_cmd == 'switch':
switch.run(args.repo_name, args.branch_name)
else:
raise Exception('"mepo branch %s" has not yet been implemented' % branch_cmd)
raise NotImplementedError('"mepo branch %s" has not yet been implemented' % branch_cmd)
# if branch_cmd == 'create':
# create.run(branch_name)
# elif branch_cmd == 'switch':
# switch.run(args.repo_name, args.branch_name)
# else:
# raise NotImplementedError('"mepo branch %s" has not yet been implemented' % branch_cmd)
2 changes: 1 addition & 1 deletion mepo.d/branch/create/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sys
import subprocess as sp

from Mepo import MepoState
from mepo_state import MepoState

def run(branch_name):
allrepos = MepoState.read_state()
Expand Down
2 changes: 1 addition & 1 deletion mepo.d/branch/switch/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sys
import subprocess as sp

from Mepo import MepoState
from mepo_state import MepoState

def run(repo_name, branch_name):
allrepos = MepoState.read_state()
Expand Down
8 changes: 8 additions & 0 deletions mepo.d/cmdline/mepo_branch_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def __init__(self, branch):
self.__push()
self.__pull()
self.__switch()
self.__sync()

def __create(self):
branch_create = self.branch_subparsers.add_parser(
Expand All @@ -34,3 +35,10 @@ def __switch(self):
description='switch repository <repo-name> to branch <branch-name>')
branch_switch.add_argument('repo_name', metavar='repo-name')
branch_switch.add_argument('branch_name', metavar='branch-name')

def __sync(self):
branch_sync = self.branch_subparsers.add_parser(
'sync',
description = 'sync branch <branch-name> with remote')
branch_sync.add_argument('branch_name', metavar='branch-name')

0 comments on commit 4bf721e

Please sign in to comment.