Better guessing of username.

Also check USER env variable, and prompt if not found.

Change-Id: I91327a7869be2de6f0e5586142c517e13c64cb49
This commit is contained in:
James E. Blair 2011-10-20 15:39:57 -05:00
parent 22cdd15b5d
commit 1d3fe5a7b5

View File

@ -113,6 +113,10 @@ def add_remote(username, hostname, port, project):
if username is None:
username = os.getenv("USERNAME")
if username is None:
username = os.getenv("USER")
if username is None:
username = raw_input("Enter your gerrit username: ")
if port is None:
port = 29418