diff options
Diffstat (limited to 'subcmds/sync.py')
| -rw-r--r-- | subcmds/sync.py | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py index e68a025e..90e2908f 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
| @@ -503,12 +503,31 @@ uncommitted changes are present' % project.relpath | |||
| 503 | to_fetch.append(rp) | 503 | to_fetch.append(rp) |
| 504 | to_fetch.extend(all_projects) | 504 | to_fetch.extend(all_projects) |
| 505 | 505 | ||
| 506 | self._Fetch(to_fetch, opt) | 506 | fetched = self._Fetch(to_fetch, opt) |
| 507 | _PostRepoFetch(rp, opt.no_repo_verify) | 507 | _PostRepoFetch(rp, opt.no_repo_verify) |
| 508 | if opt.network_only: | 508 | if opt.network_only: |
| 509 | # bail out now; the rest touches the working tree | 509 | # bail out now; the rest touches the working tree |
| 510 | return | 510 | return |
| 511 | 511 | ||
| 512 | # Iteratively fetch missing and/or nested unregistered submodules | ||
| 513 | previously_missing_set = set() | ||
| 514 | while True: | ||
| 515 | self.manifest._Unload() | ||
| 516 | all = self.GetProjects(args, missing_ok=True) | ||
| 517 | missing = [] | ||
| 518 | for project in all: | ||
| 519 | if project.gitdir not in fetched: | ||
| 520 | missing.append(project) | ||
| 521 | if not missing: | ||
| 522 | break | ||
| 523 | # Stop us from non-stopped fetching actually-missing repos: If set of | ||
| 524 | # missing repos has not been changed from last fetch, we break. | ||
| 525 | missing_set = set(p.name for p in missing) | ||
| 526 | if previously_missing_set == missing_set: | ||
| 527 | break | ||
| 528 | previously_missing_set = missing_set | ||
| 529 | fetched.update(self._Fetch(missing, opt)) | ||
| 530 | |||
| 512 | if self.manifest.IsMirror: | 531 | if self.manifest.IsMirror: |
| 513 | # bail out now, we have no working tree | 532 | # bail out now, we have no working tree |
| 514 | return | 533 | return |
