sync: Recommend using --no-use-superproject if sync fails.

If superproject was not available for a branch, then the next
repo sync would also fail because --use-superproject is
remembered across repo init. In such cases, hoping the hint to
to use --no-use-superproject will help.

Tested the code with the following commands and by forcing
a failure.

$ ./run_tests -v

Bug: [google internal] b/187459275
Change-Id: Ie250812b7ba83afc230b5b1d154ba11f245f8b8a
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/305622
Reviewed-by: Xin Li <delphij@google.com>
Tested-by: Raman Tenneti <rtenneti@google.com>
This commit is contained in:
Raman Tenneti 2021-05-07 10:22:16 -07:00
parent b44294395f
commit f907ced0fe

View File

@ -307,7 +307,8 @@ later is required to fix a server side protocol bug.
submodules_ok=opt.fetch_submodules)
manifest_path = superproject.UpdateProjectsRevisionId(all_projects)
if not manifest_path:
print('error: Update of revsionId from superproject has failed',
print('error: Update of revsionId from superproject has failed. '
'Please resync with --no-use-superproject option',
file=sys.stderr)
sys.exit(1)
self._ReloadManifest(manifest_path, load_local_manifests)