summaryrefslogtreecommitdiffstats
path: root/subcmds/sync.py
diff options
context:
space:
mode:
Diffstat (limited to 'subcmds/sync.py')
-rw-r--r--subcmds/sync.py27
1 files changed, 23 insertions, 4 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py
index b83f2d4a..d565af7b 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -423,7 +423,7 @@ uncommitted changes are present' % project.relpath
423 # in the .netrc file. 423 # in the .netrc file.
424 print >>sys.stderr, 'No credentials found for %s in .netrc' % \ 424 print >>sys.stderr, 'No credentials found for %s in .netrc' % \
425 parse_result.hostname 425 parse_result.hostname
426 except netrc.NetrcParseError, e: 426 except netrc.NetrcParseError as e:
427 print >>sys.stderr, 'Error parsing .netrc file: %s' % e 427 print >>sys.stderr, 'Error parsing .netrc file: %s' % e
428 428
429 if (username and password): 429 if (username and password):
@@ -470,11 +470,11 @@ uncommitted changes are present' % project.relpath
470 else: 470 else:
471 print >>sys.stderr, 'error: %s' % manifest_str 471 print >>sys.stderr, 'error: %s' % manifest_str
472 sys.exit(1) 472 sys.exit(1)
473 except (socket.error, IOError, xmlrpclib.Fault), e: 473 except (socket.error, IOError, xmlrpclib.Fault) as e:
474 print >>sys.stderr, 'error: cannot connect to manifest server %s:\n%s' % ( 474 print >>sys.stderr, 'error: cannot connect to manifest server %s:\n%s' % (
475 self.manifest.manifest_server, e) 475 self.manifest.manifest_server, e)
476 sys.exit(1) 476 sys.exit(1)
477 except xmlrpclib.ProtocolError, e: 477 except xmlrpclib.ProtocolError as e:
478 print >>sys.stderr, 'error: cannot connect to manifest server %s:\n%d %s' % ( 478 print >>sys.stderr, 'error: cannot connect to manifest server %s:\n%d %s' % (
479 self.manifest.manifest_server, e.errcode, e.errmsg) 479 self.manifest.manifest_server, e.errcode, e.errmsg)
480 sys.exit(1) 480 sys.exit(1)
@@ -511,12 +511,31 @@ uncommitted changes are present' % project.relpath
511 to_fetch.extend(all_projects) 511 to_fetch.extend(all_projects)
512 to_fetch.sort(key=self._fetch_times.Get, reverse=True) 512 to_fetch.sort(key=self._fetch_times.Get, reverse=True)
513 513
514 self._Fetch(to_fetch, opt) 514 fetched = self._Fetch(to_fetch, opt)
515 _PostRepoFetch(rp, opt.no_repo_verify) 515 _PostRepoFetch(rp, opt.no_repo_verify)
516 if opt.network_only: 516 if opt.network_only:
517 # bail out now; the rest touches the working tree 517 # bail out now; the rest touches the working tree
518 return 518 return
519 519
520 # Iteratively fetch missing and/or nested unregistered submodules
521 previously_missing_set = set()
522 while True:
523 self.manifest._Unload()
524 all_projects = self.GetProjects(args, missing_ok=True)
525 missing = []
526 for project in all_projects:
527 if project.gitdir not in fetched:
528 missing.append(project)
529 if not missing:
530 break
531 # Stop us from non-stopped fetching actually-missing repos: If set of
532 # missing repos has not been changed from last fetch, we break.
533 missing_set = set(p.name for p in missing)
534 if previously_missing_set == missing_set:
535 break
536 previously_missing_set = missing_set
537 fetched.update(self._Fetch(missing, opt))
538
520 if self.manifest.IsMirror: 539 if self.manifest.IsMirror:
521 # bail out now, we have no working tree 540 # bail out now, we have no working tree
522 return 541 return