diff options
author | Raman Tenneti <rtenneti@google.com> | 2021-12-06 18:12:59 -0800 |
---|---|---|
committer | Raman Tenneti <rtenneti@google.com> | 2021-12-07 16:46:41 +0000 |
commit | cf0ba48649bab9fc6c88dcf15c1ae66d3717693d (patch) | |
tree | af867b7c29b842c5607b026c49764d706f25d0c0 | |
parent | 2a089cfee4a3eb0c28cfb441861fc1fcb05797d3 (diff) | |
download | git-repo-cf0ba48649bab9fc6c88dcf15c1ae66d3717693d.tar.gz |
sync: With --mirror option, don't display no-use-superproject... message.
+ Display 'Defaulting to no-use-superproject because there is no working tree.'
message if --use-superproject option is used and we are not using
superproject because manifest is either a mirror or is an archive.
Tested the code with the following commands.
$ ./run_tests -v
Tested the sync code by using repo_dev alias and pointing to this CL.
$ repo init -u https://android.googlesource.com/mirror/manifest --mirror
$ repo_dev sync
Receiving objects: 100% (3/3), done.eiving objects: 33% (1/3)
$ repo_dev sync --use-superproject
Defaulting to no-use-superproject because there is no working tree.
Fetching: 0% (0/2158) warming up
Bug: https://crbug.com/gerrit/15368
Change-Id: I16b87ee9623315dbc3100b612b1decdaab7ac1dc
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/325797
Reviewed-by: Mike Frysinger <vapier@google.com>
Tested-by: Raman Tenneti <rtenneti@google.com>
-rw-r--r-- | subcmds/sync.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py index 4898430b..707c5bbd 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
@@ -986,10 +986,11 @@ later is required to fix a server side protocol bug. | |||
986 | 986 | ||
987 | load_local_manifests = not self.manifest.HasLocalManifests | 987 | load_local_manifests = not self.manifest.HasLocalManifests |
988 | use_superproject = git_superproject.UseSuperproject(opt, self.manifest) | 988 | use_superproject = git_superproject.UseSuperproject(opt, self.manifest) |
989 | if self.manifest.IsMirror or self.manifest.IsArchive: | 989 | if use_superproject and (self.manifest.IsMirror or self.manifest.IsArchive): |
990 | # Don't use superproject, because we have no working tree. | 990 | # Don't use superproject, because we have no working tree. |
991 | use_superproject = False | 991 | use_superproject = False |
992 | print('Defaulting to no-use-superproject because there is no working tree.') | 992 | if opt.use_superproject is not None: |
993 | print('Defaulting to no-use-superproject because there is no working tree.') | ||
993 | superproject_logging_data = { | 994 | superproject_logging_data = { |
994 | 'superproject': use_superproject, | 995 | 'superproject': use_superproject, |
995 | 'haslocalmanifests': bool(self.manifest.HasLocalManifests), | 996 | 'haslocalmanifests': bool(self.manifest.HasLocalManifests), |