diff options
Diffstat (limited to 'subcmds/sync.py')
-rw-r--r-- | subcmds/sync.py | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py index 9e4a9754..a4ca344a 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
@@ -474,7 +474,7 @@ uncommitted changes are present' % project.relpath | |||
474 | # in the .netrc file. | 474 | # in the .netrc file. |
475 | print >>sys.stderr, 'No credentials found for %s in .netrc' % \ | 475 | print >>sys.stderr, 'No credentials found for %s in .netrc' % \ |
476 | parse_result.hostname | 476 | parse_result.hostname |
477 | except netrc.NetrcParseError, e: | 477 | except netrc.NetrcParseError as e: |
478 | print >>sys.stderr, 'Error parsing .netrc file: %s' % e | 478 | print >>sys.stderr, 'Error parsing .netrc file: %s' % e |
479 | 479 | ||
480 | if (username and password): | 480 | if (username and password): |
@@ -521,11 +521,11 @@ uncommitted changes are present' % project.relpath | |||
521 | else: | 521 | else: |
522 | print >>sys.stderr, 'error: %s' % manifest_str | 522 | print >>sys.stderr, 'error: %s' % manifest_str |
523 | sys.exit(1) | 523 | sys.exit(1) |
524 | except (socket.error, IOError, xmlrpclib.Fault), e: | 524 | except (socket.error, IOError, xmlrpclib.Fault) as e: |
525 | print >>sys.stderr, 'error: cannot connect to manifest server %s:\n%s' % ( | 525 | print >>sys.stderr, 'error: cannot connect to manifest server %s:\n%s' % ( |
526 | self.manifest.manifest_server, e) | 526 | self.manifest.manifest_server, e) |
527 | sys.exit(1) | 527 | sys.exit(1) |
528 | except xmlrpclib.ProtocolError, e: | 528 | except xmlrpclib.ProtocolError as e: |
529 | print >>sys.stderr, 'error: cannot connect to manifest server %s:\n%d %s' % ( | 529 | print >>sys.stderr, 'error: cannot connect to manifest server %s:\n%d %s' % ( |
530 | self.manifest.manifest_server, e.errcode, e.errmsg) | 530 | self.manifest.manifest_server, e.errcode, e.errmsg) |
531 | sys.exit(1) | 531 | sys.exit(1) |
@@ -562,12 +562,31 @@ uncommitted changes are present' % project.relpath | |||
562 | to_fetch.extend(all_projects) | 562 | to_fetch.extend(all_projects) |
563 | to_fetch.sort(key=self._fetch_times.Get, reverse=True) | 563 | to_fetch.sort(key=self._fetch_times.Get, reverse=True) |
564 | 564 | ||
565 | self._Fetch(to_fetch, opt) | 565 | fetched = self._Fetch(to_fetch, opt) |
566 | _PostRepoFetch(rp, opt.no_repo_verify) | 566 | _PostRepoFetch(rp, opt.no_repo_verify) |
567 | if opt.network_only: | 567 | if opt.network_only: |
568 | # bail out now; the rest touches the working tree | 568 | # bail out now; the rest touches the working tree |
569 | return | 569 | return |
570 | 570 | ||
571 | # Iteratively fetch missing and/or nested unregistered submodules | ||
572 | previously_missing_set = set() | ||
573 | while True: | ||
574 | self.manifest._Unload() | ||
575 | all_projects = self.GetProjects(args, missing_ok=True) | ||
576 | missing = [] | ||
577 | for project in all_projects: | ||
578 | if project.gitdir not in fetched: | ||
579 | missing.append(project) | ||
580 | if not missing: | ||
581 | break | ||
582 | # Stop us from non-stopped fetching actually-missing repos: If set of | ||
583 | # missing repos has not been changed from last fetch, we break. | ||
584 | missing_set = set(p.name for p in missing) | ||
585 | if previously_missing_set == missing_set: | ||
586 | break | ||
587 | previously_missing_set = missing_set | ||
588 | fetched.update(self._Fetch(missing, opt)) | ||
589 | |||
571 | if self.manifest.IsMirror: | 590 | if self.manifest.IsMirror: |
572 | # bail out now, we have no working tree | 591 | # bail out now, we have no working tree |
573 | return | 592 | return |