Skip to content

Commit

Permalink
Merge 880a4e7 into 5b5e1c2
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Sep 17, 2020
2 parents 5b5e1c2 + 880a4e7 commit 194c3a3
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions manic/sourcetree.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,13 @@ def checkout(self, verbosity, load_all, load_comp=None):
printlog('Checking out externals: ', end='')

if load_all:
load_comps = self._all_components.keys()
tmp_comps = self._all_components.keys()
elif load_comp is not None:
load_comps = [load_comp]
tmp_comps = [load_comp]
else:
load_comps = self._required_compnames
tmp_comps = self._required_compnames

load_comps = self.order_comps_by_local_path(tmp_comps)
# checkout the primary externals
for comp in load_comps:
if verbosity < VERBOSITY_VERBOSE:
Expand All @@ -351,3 +352,18 @@ def checkout(self, verbosity, load_all, load_comp=None):
# now give each external an opportunitity to checkout it's externals.
for comp in load_comps:
self._all_components[comp].checkout_externals(verbosity, load_all)

def order_comps_by_local_path(self, comps_in):
"""
put the comps into an order so that comp local_paths
that are nested are checked out in correct order
"""
comps_out = []
local_paths = []
for comp in comps_in:
local_paths.append(self._all_components[comp].get_local_path())
for path in sorted(local_paths, key=len):
for comp in comps_in:
if self._all_components[comp].get_local_path() == path:
comps_out.append(comp)
return comps_out

0 comments on commit 194c3a3

Please sign in to comment.