diff options
author | LaMont Jones <lamontjones@google.com> | 2022-04-13 15:58:58 +0000 |
---|---|---|
committer | LaMont Jones <lamontjones@google.com> | 2022-04-14 00:07:25 +0000 |
commit | 2cc3ab7663ae867c6103bcf5c90a8e9e7999c15e (patch) | |
tree | 008af2af181517192f55f46d81d4c587eadc0331 /git_superproject.py | |
parent | d56e2eb4216827284220fcc35af42e60b4faaea6 (diff) | |
download | git-repo-2cc3ab7663ae867c6103bcf5c90a8e9e7999c15e.tar.gz |
git_superproject: only print beta notice once.
This eliminates duplicate notices during multi-manifest syncs.
Change-Id: Idcb038ddeb363368637c58c11346ebf8fd2b27ac
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/334939
Reviewed-by: Mike Frysinger <vapier@google.com>
Tested-by: LaMont Jones <lamontjones@google.com>
Diffstat (limited to 'git_superproject.py')
-rw-r--r-- | git_superproject.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/git_superproject.py b/git_superproject.py index 9f585e5d..1293f352 100644 --- a/git_superproject.py +++ b/git_superproject.py | |||
@@ -238,8 +238,8 @@ class Superproject(object): | |||
238 | f'{self._manifest.manifestFile}') | 238 | f'{self._manifest.manifestFile}') |
239 | return SyncResult(False, False) | 239 | return SyncResult(False, False) |
240 | 240 | ||
241 | print('NOTICE: --use-superproject is in beta; report any issues to the ' | 241 | _PrintBetaNotice() |
242 | 'address described in `repo version`', file=sys.stderr) | 242 | |
243 | should_exit = True | 243 | should_exit = True |
244 | if not self._remote_url: | 244 | if not self._remote_url: |
245 | self._LogWarning(f'superproject URL is not defined in manifest: ' | 245 | self._LogWarning(f'superproject URL is not defined in manifest: ' |
@@ -364,6 +364,13 @@ class Superproject(object): | |||
364 | return UpdateProjectsResult(manifest_path, False) | 364 | return UpdateProjectsResult(manifest_path, False) |
365 | 365 | ||
366 | 366 | ||
367 | @functools.lru_cache(maxsize=10) | ||
368 | def _PrintBetaNotice(): | ||
369 | """Print the notice of beta status.""" | ||
370 | print('NOTICE: --use-superproject is in beta; report any issues to the ' | ||
371 | 'address described in `repo version`', file=sys.stderr) | ||
372 | |||
373 | |||
367 | @functools.lru_cache(maxsize=None) | 374 | @functools.lru_cache(maxsize=None) |
368 | def _UseSuperprojectFromConfiguration(): | 375 | def _UseSuperprojectFromConfiguration(): |
369 | """Returns the user choice of whether to use superproject.""" | 376 | """Returns the user choice of whether to use superproject.""" |