summaryrefslogtreecommitdiffstats
path: root/subcmds
diff options
context:
space:
mode:
Diffstat (limited to 'subcmds')
-rw-r--r--subcmds/sync.py27
1 files changed, 4 insertions, 23 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py
index a7df7c89..d4637d0c 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -538,7 +538,7 @@ uncommitted changes are present' % project.relpath
538 mp.PreSync() 538 mp.PreSync()
539 539
540 if opt.repo_upgraded: 540 if opt.repo_upgraded:
541 _PostRepoUpgrade(self.manifest, opt) 541 _PostRepoUpgrade(self.manifest, quiet=opt.quiet)
542 542
543 if not opt.local_only: 543 if not opt.local_only:
544 mp.Sync_NetworkHalf(quiet=opt.quiet, 544 mp.Sync_NetworkHalf(quiet=opt.quiet,
@@ -563,31 +563,12 @@ uncommitted changes are present' % project.relpath
563 to_fetch.extend(all_projects) 563 to_fetch.extend(all_projects)
564 to_fetch.sort(key=self._fetch_times.Get, reverse=True) 564 to_fetch.sort(key=self._fetch_times.Get, reverse=True)
565 565
566 fetched = self._Fetch(to_fetch, opt) 566 self._Fetch(to_fetch, opt)
567 _PostRepoFetch(rp, opt.no_repo_verify) 567 _PostRepoFetch(rp, opt.no_repo_verify)
568 if opt.network_only: 568 if opt.network_only:
569 # bail out now; the rest touches the working tree 569 # bail out now; the rest touches the working tree
570 return 570 return
571 571
572 # Iteratively fetch missing and/or nested unregistered submodules
573 previously_missing_set = set()
574 while True:
575 self.manifest._Unload()
576 all_projects = self.GetProjects(args, missing_ok=True)
577 missing = []
578 for project in all_projects:
579 if project.gitdir not in fetched:
580 missing.append(project)
581 if not missing:
582 break
583 # Stop us from non-stopped fetching actually-missing repos: If set of
584 # missing repos has not been changed from last fetch, we break.
585 missing_set = set(p.name for p in missing)
586 if previously_missing_set == missing_set:
587 break
588 previously_missing_set = missing_set
589 fetched.update(self._Fetch(missing, opt))
590
591 if self.manifest.IsMirror: 572 if self.manifest.IsMirror:
592 # bail out now, we have no working tree 573 # bail out now, we have no working tree
593 return 574 return
@@ -612,10 +593,10 @@ uncommitted changes are present' % project.relpath
612 if self.manifest.notice: 593 if self.manifest.notice:
613 print self.manifest.notice 594 print self.manifest.notice
614 595
615def _PostRepoUpgrade(manifest, opt): 596def _PostRepoUpgrade(manifest, quiet=False):
616 wrapper = WrapperModule() 597 wrapper = WrapperModule()
617 if wrapper.NeedSetupGnuPG(): 598 if wrapper.NeedSetupGnuPG():
618 wrapper.SetupGnuPG(opt.quiet) 599 wrapper.SetupGnuPG(quiet)
619 for project in manifest.projects.values(): 600 for project in manifest.projects.values():
620 if project.Exists: 601 if project.Exists:
621 project.PostRepoUpgrade() 602 project.PostRepoUpgrade()