Better error message when using --mirror in existing workspace If repo init is run with the --mirror option, repo checks if there is already a workspace initialized in the current location, and if so, exits with an error message: --mirror not supported on existing client This error can cause confusion; the users do not understand what is wrong and what they need to do to fix it. Change the error message to make it a bit clearer. Change-Id: Ifd06ef64fd264bd1117e4184c49afe0345b75d8c
diff --git a/subcmds/init.py b/subcmds/init.py index 9396f3c..55497d8 100644 --- a/subcmds/init.py +++ b/subcmds/init.py
@@ -180,8 +180,10 @@ if is_new: m.config.SetString('repo.mirror', 'true') else: - print('fatal: --mirror not supported on existing client', - file=sys.stderr) + print('fatal: --mirror is only supported when initializing a new ' + 'workspace.', file=sys.stderr) + print('Either delete the .repo folder in this workspace, or initialize ' + 'in another location.', file=sys.stderr) sys.exit(1) if not m.Sync_NetworkHalf(is_new=is_new):