-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #70. Add mepo pull, pull-all, fetch-all
- Loading branch information
Showing
5 changed files
with
75 additions
and
7 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
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,11 @@ | ||
from state.state import MepoState | ||
from repository.git import GitRepository | ||
from utilities import colors | ||
|
||
def run(args): | ||
allcomps = MepoState.read_state() | ||
for comp in allcomps: | ||
git = GitRepository(comp.remote, comp.local) | ||
print("Fetching %s" % | ||
colors.YELLOW + comp.name + colors.RESET) | ||
git.fetch(args) |
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,22 @@ | ||
from state.state import MepoState | ||
from repository.git import GitRepository | ||
from state.component import MepoVersion | ||
from utilities import colors | ||
from pprint import pprint | ||
|
||
def run(args): | ||
allcomps = MepoState.read_state() | ||
detached_comps=[] | ||
for comp in allcomps: | ||
git = GitRepository(comp.remote, comp.local) | ||
name, tYpe, detached = MepoVersion(*git.get_version()) | ||
if detached: | ||
detached_comps.append(comp.name) | ||
else: | ||
print("Pulling branch %s in %s " % | ||
(colors.YELLOW + name + colors.RESET, | ||
colors.RESET + comp.name + colors.RESET)) | ||
git.pull() | ||
if len(detached_comps) > 0: | ||
print("The following repos were not pulled (detached HEAD): %s" % (', '.join(map(str, detached_comps)))) | ||
|
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,16 @@ | ||
from state.state import MepoState | ||
from utilities import verify | ||
from repository.git import GitRepository | ||
from state.component import MepoVersion | ||
|
||
def run(args): | ||
allcomps = MepoState.read_state() | ||
verify.valid_components(args.comp_name, allcomps) | ||
comps2dev = [x for x in allcomps if x.name in args.comp_name] | ||
for comp in comps2dev: | ||
git = GitRepository(comp.remote, comp.local) | ||
is_detached = MepoVersion(*git.get_version()).detached | ||
if is_detached: | ||
raise Exception('{} has detached head! Cannot stage.'.format(comp.name)) | ||
else: | ||
git.pull() |