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
This commit is contained in:
David Pursehouse 2012-11-21 14:41:58 +09:00
parent e0b6de32f7
commit 254709804d

View File

@ -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):