@@ -126,7 +126,7 @@ def register_repo(self, repo_path, repo_meta):
126126
127127 if repo_meta .get ('deps' ):
128128 for dep in repo_meta ['deps' ]:
129- self .pull_repo (dep ['url' ], branch = dep .get ('branch' ), checkout = dep .get ('checkout' ))
129+ self .pull_repo (dep ['url' ], branch = dep .get ('branch' ), checkout = dep .get ('checkout' ), ignore_on_conflict = dep . get ( 'is_alias_okay' , True ) )
130130
131131 # Get the path to the repos.json file in $HOME/MLC
132132 repos_file_path = os .path .join (self .repos_path , 'repos.json' )
@@ -248,7 +248,7 @@ def github_url_to_user_repo_format(self, url):
248248 else :
249249 return {"return" : 0 , "value" : os .path .basename (url ).replace (".git" , "" )}
250250
251- def pull_repo (self , repo_url , branch = None , checkout = None , tag = None , pat = None , ssh = None ):
251+ def pull_repo (self , repo_url , branch = None , checkout = None , tag = None , pat = None , ssh = None , ignore_on_conflict = False ):
252252
253253 # Determine the checkout path from environment or default
254254 repo_base_path = self .repos_path # either the value will be from 'MLC_REPOS'
@@ -269,7 +269,6 @@ def pull_repo(self, repo_url, branch=None, checkout = None, tag = None, pat = No
269269 if res ["return" ] > 0 :
270270 return res
271271 else :
272- print (res )
273272 repo_url = res ["url" ]
274273
275274
@@ -342,9 +341,13 @@ def pull_repo(self, repo_url, branch=None, checkout = None, tag = None, pat = No
342341 return {"return" : 0 }
343342 elif "already registered" in is_conflict ["error" ]:
344343 #logger.warning(is_conflict["error"])
345- logger .info ("No changes made to repos.json." )
344+ logger .debug ("No changes made to repos.json." )
346345 return {"return" : 0 }
347346 else :
347+ if ignore_on_conflict :
348+ logger .debug ("Repo alias existing. Ignoring the repo pull" )
349+ return {"return" : 0 }
350+
348351 logger .warning (f"The repo to be cloned has conflict with the repo already in the path: { is_conflict ['conflicting_path' ]} " )
349352 self .unregister_repo (is_conflict ['conflicting_path' ])
350353 self .register_repo (repo_path , meta_data )
0 commit comments