diff options
author | Raman Tenneti <rtenneti@google.com> | 2021-11-16 11:48:09 -0800 |
---|---|---|
committer | Raman Tenneti <rtenneti@google.com> | 2021-11-18 01:27:41 +0000 |
commit | 6bd89aa6579cb5a108554c392d7d87a6ce978aa8 (patch) | |
tree | a82f37473cc0a7070b0b77f902c029fe8b3081b2 /subcmds/init.py | |
parent | 9c1fc5bc5d1e78f7794ae0ddfa379b448fcb4b1f (diff) | |
download | git-repo-6bd89aa6579cb5a108554c392d7d87a6ce978aa8.tar.gz |
superproject: Inherit --no-use-superproject with --mirror option.
init.py
+ Similar to opt.archive, gave an error if --mirror option is
used with --use-superproject.
sync.py
+ Defaulted to --no-use-superproject if manifest is a mirror or
archive (similar to error at line# 1067).
Tested:
+ run_tests
+ flake8 (will fix known errors in another CL).
$ repo_dev init -u sso://googleplex-android.git.corp.google.com/platform/manifest --use-superproject --mirror
Usage: repo init [options] [manifest url]
main.py: error: --mirror and --use-superproject cannot be used together.
+ repo init and repo sync with --mirror and without --mirror
options.
$ repo_dev init -u https://android.googlesource.com/platform/manifest
$ repo_dev sync
...superproject.git: Initial setup for superproject completed.
+ With --mirror option, verfied there are no exceptions in git_superproject.py
Bug: [google internal] b/206537893
Change-Id: I059f20e76f0ab36f0587f29779bb53ede4663bd4
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/323955
Reviewed-by: Mike Frysinger <vapier@google.com>
Tested-by: Raman Tenneti <rtenneti@google.com>
Diffstat (limited to 'subcmds/init.py')
-rw-r--r-- | subcmds/init.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/subcmds/init.py b/subcmds/init.py index a3f3241a..1fbe4654 100644 --- a/subcmds/init.py +++ b/subcmds/init.py | |||
@@ -478,8 +478,13 @@ to update the working directory files. | |||
478 | 478 | ||
479 | # Check this here, else manifest will be tagged "not new" and init won't be | 479 | # Check this here, else manifest will be tagged "not new" and init won't be |
480 | # possible anymore without removing the .repo/manifests directory. | 480 | # possible anymore without removing the .repo/manifests directory. |
481 | if opt.archive and opt.mirror: | 481 | if opt.mirror: |
482 | self.OptionParser.error('--mirror and --archive cannot be used together.') | 482 | if opt.archive: |
483 | self.OptionParser.error('--mirror and --archive cannot be used ' | ||
484 | 'together.') | ||
485 | if opt.use_superproject is not None: | ||
486 | self.OptionParser.error('--mirror and --use-superproject cannot be ' | ||
487 | 'used together.') | ||
483 | 488 | ||
484 | if opt.standalone_manifest and ( | 489 | if opt.standalone_manifest and ( |
485 | opt.manifest_branch or opt.manifest_name != 'default.xml'): | 490 | opt.manifest_branch or opt.manifest_name != 'default.xml'): |