Don't prompt the user for name/email unless necessary

If the user has already configured a workspace, use these values
when re-running 'repo init'.

Otherwise, if the user has global name and e-mail set, use these.

It's always possible to override this and be prompted by specifying
--config-name when running 'repo init'.

Change-Id: If45f0e4b14884071439fb02709dc5cb53f070f60
This commit is contained in:
Victor Boivie
2011-04-05 11:31:10 +02:00
committed by Shawn O. Pearce
parent ee1c2f5717
commit 841be34968
2 changed files with 31 additions and 1 deletions

5
repo
View File

@ -139,6 +139,11 @@ group.add_option('--no-repo-verify',
dest='no_repo_verify', action='store_true',
help='do not verify repo source code')
# Other
group = init_optparse.add_option_group('Other options')
group.add_option('--config-name',
dest='config_name', action="store_true", default=False,
help='Always prompt for name/e-mail')
class CloneFailure(Exception):
"""Indicate the remote clone of repo itself failed.