From 254709804d83d611831d4c78fe17280750e2eb2a Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Wed, 21 Nov 2012 14:41:58 +0900 Subject: [PATCH] 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 --- subcmds/init.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 @@ to update the working directory files. 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):