diff options
Diffstat (limited to 'subcmds')
| -rw-r--r-- | subcmds/sync.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py index 2953ee3b..b14ad246 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
| @@ -277,6 +277,16 @@ later is required to fix a server side protocol bug. | |||
| 277 | branch = branch[len(R_HEADS):] | 277 | branch = branch[len(R_HEADS):] |
| 278 | return branch | 278 | return branch |
| 279 | 279 | ||
| 280 | def _UseSuperproject(self, opt): | ||
| 281 | """Returns True if use-superproject option is enabled""" | ||
| 282 | return (opt.use_superproject or | ||
| 283 | self.manifest.manifestProject.config.GetBoolean( | ||
| 284 | 'repo.superproject')) | ||
| 285 | |||
| 286 | def _GetCurrentBranchOnly(self, opt): | ||
| 287 | """Returns True if current-branch or use-superproject options are enabled.""" | ||
| 288 | return opt.current_branch_only or self._UseSuperproject(opt) | ||
| 289 | |||
| 280 | def _UpdateProjectsRevisionId(self, opt, args): | 290 | def _UpdateProjectsRevisionId(self, opt, args): |
| 281 | """Update revisionId of every project with the SHA from superproject. | 291 | """Update revisionId of every project with the SHA from superproject. |
| 282 | 292 | ||
| @@ -363,7 +373,7 @@ later is required to fix a server side protocol bug. | |||
| 363 | quiet=opt.quiet, | 373 | quiet=opt.quiet, |
| 364 | verbose=opt.verbose, | 374 | verbose=opt.verbose, |
| 365 | output_redir=buf, | 375 | output_redir=buf, |
| 366 | current_branch_only=opt.current_branch_only, | 376 | current_branch_only=self._GetCurrentBranchOnly(opt), |
| 367 | force_sync=opt.force_sync, | 377 | force_sync=opt.force_sync, |
| 368 | clone_bundle=opt.clone_bundle, | 378 | clone_bundle=opt.clone_bundle, |
| 369 | tags=opt.tags, archive=self.manifest.IsArchive, | 379 | tags=opt.tags, archive=self.manifest.IsArchive, |
| @@ -735,7 +745,7 @@ later is required to fix a server side protocol bug. | |||
| 735 | if not opt.local_only: | 745 | if not opt.local_only: |
| 736 | start = time.time() | 746 | start = time.time() |
| 737 | success = mp.Sync_NetworkHalf(quiet=opt.quiet, verbose=opt.verbose, | 747 | success = mp.Sync_NetworkHalf(quiet=opt.quiet, verbose=opt.verbose, |
| 738 | current_branch_only=opt.current_branch_only, | 748 | current_branch_only=self._GetCurrentBranchOnly(opt), |
| 739 | force_sync=opt.force_sync, | 749 | force_sync=opt.force_sync, |
| 740 | tags=opt.tags, | 750 | tags=opt.tags, |
| 741 | optimized_fetch=opt.optimized_fetch, | 751 | optimized_fetch=opt.optimized_fetch, |
| @@ -830,9 +840,7 @@ later is required to fix a server side protocol bug. | |||
| 830 | else: | 840 | else: |
| 831 | self._UpdateManifestProject(opt, mp, manifest_name) | 841 | self._UpdateManifestProject(opt, mp, manifest_name) |
| 832 | 842 | ||
| 833 | if (opt.use_superproject or | 843 | if self._UseSuperproject(opt): |
| 834 | self.manifest.manifestProject.config.GetBoolean( | ||
| 835 | 'repo.superproject')): | ||
| 836 | manifest_name = self._UpdateProjectsRevisionId(opt, args) | 844 | manifest_name = self._UpdateProjectsRevisionId(opt, args) |
| 837 | 845 | ||
| 838 | if self.gitc_manifest: | 846 | if self.gitc_manifest: |
