diff options
author | Raman Tenneti <rtenneti@google.com> | 2021-05-07 14:01:54 -0700 |
---|---|---|
committer | Raman Tenneti <rtenneti@google.com> | 2021-05-08 00:04:00 +0000 |
commit | 23ea7545244e4bae1fdaed360fa8c25225fa03ec (patch) | |
tree | 03bb9e2711f16706e9580d81cd6325ba2e3699f7 /subcmds/sync.py | |
parent | f907ced0fead284b733872d9d5fd950996e52e9e (diff) | |
download | git-repo-23ea7545244e4bae1fdaed360fa8c25225fa03ec.tar.gz |
sync: added --no-use-superproject to disable superproject.
Tested the code with the following commands.
$ ./run_tests -v
$ repo_dev sync -c -j8 --no-use-superproject
Fetching: 100% (1041/1041), done in 1m22.743s
$ repo_dev sync -c -j8 --use-superproject
WARNING: --use-superproject is experimental and not for general use
..
Bug: [google internal] b/187459275
Change-Id: I3f4269df38cd24a21723e8b2be5a1f013e7b5a91
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/305682
Tested-by: Raman Tenneti <rtenneti@google.com>
Reviewed-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'subcmds/sync.py')
-rw-r--r-- | subcmds/sync.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py index 4d95b023..6f5b5644 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
@@ -235,6 +235,9 @@ later is required to fix a server side protocol bug. | |||
235 | help='fetch submodules from server') | 235 | help='fetch submodules from server') |
236 | p.add_option('--use-superproject', action='store_true', | 236 | p.add_option('--use-superproject', action='store_true', |
237 | help='use the manifest superproject to sync projects') | 237 | help='use the manifest superproject to sync projects') |
238 | p.add_option('--no-use-superproject', action='store_false', | ||
239 | dest='use_superproject', | ||
240 | help='disable use of manifest superprojects') | ||
238 | p.add_option('--tags', | 241 | p.add_option('--tags', |
239 | action='store_false', | 242 | action='store_false', |
240 | help='fetch tags') | 243 | help='fetch tags') |
@@ -276,9 +279,10 @@ later is required to fix a server side protocol bug. | |||
276 | 279 | ||
277 | def _UseSuperproject(self, opt): | 280 | def _UseSuperproject(self, opt): |
278 | """Returns True if use-superproject option is enabled""" | 281 | """Returns True if use-superproject option is enabled""" |
279 | return (opt.use_superproject or | 282 | if opt.use_superproject is not None: |
280 | self.manifest.manifestProject.config.GetBoolean( | 283 | return opt.use_superproject |
281 | 'repo.superproject')) | 284 | else: |
285 | return self.manifest.manifestProject.config.GetBoolean('repo.superproject') | ||
282 | 286 | ||
283 | def _GetCurrentBranchOnly(self, opt): | 287 | def _GetCurrentBranchOnly(self, opt): |
284 | """Returns True if current-branch or use-superproject options are enabled.""" | 288 | """Returns True if current-branch or use-superproject options are enabled.""" |